I have a gitlab server and we’re experimenting with CI. It used to be working until I updated my installation and now it’s not working. I tried removing and registering the runner again and I’m not sure how to fix this. Here’s the error.

remote: You are not allowed to download code from this project.
fatal: unable to access ‘ https://gitlab-ci-token:[email protected]/user/project.git/ ’: The requested URL returned error: 403
ERROR: Job failed: exit code 1

I found something out and other users running into the same issue may find this useful.

I’m not sure if it’s in the documentation since I didn’t see it there but apparently, runners don’t like private repos. I “fixed” it by changing the repo to internal and setting project privacy settings to only project members.

We’re encountering other issues with the CI but this is something on our end this time.

Very strange behavior. I have two similar project for different runners.
Both project are just for test and set to be Private. One of them using Linux, and it works well. The other show 403 error while it is set to Private and only Internal works. How I can fix this issue?

GitLab Community Edition [12.6.2]
Windows runner:
Version: 12.6.0
Git revision: ac8e767a
Git branch: 12-6-stable
GO version: go1.13.4
Built: 2019-12-22T11:55:34+0000
OS/Arch: windows/amd64

For me the problem was a setting in CI/CD Settings.

Token Access

Control how the CI_JOB_TOKEN CI/CD variable is used for API access between projects.

Limit access to this project

Prevent access to this project from other project CI/CD job tokens, unless the other project is added to the allowlist.