Using CI_JOB_TOKEN to clone another GitLab repo causes too many redirects or authentication replays
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Background
We have an issue with GitLab on our self-hosted instance, but I think the same issue exists with gitlab.com.
Using the CI_JOB_TOKEN to make a git clone call (using pygit2) we get the following error message:
_pygit2.GitError: too many redirects or authentication replays
The clone command is executed in a pipeline and it tries to clone another git repository in our GitLab instance.
- We have added the project running the pipeline to
Settings > CI/CD Settings > Token Access > Allow access to this project with a CI_JOB_TOKENin the repo to be cloned. - It works if we use a Personal Access Token instead.
- We have confirmed the error message with a simple curl command as well.
It seems that there is some logic to CI_JOB_TOKEN that we have missed.
Edited by 🤖 GitLab Bot 🤖