1
votes

I am getting a fatal: unable to access 'config': Permission denied error when trying to use gitlab-runner exec docker:

$ gitlab-runner exec docker \
    --docker-volumes  /home/username/.ssh/gitlab_ci_rsa:/root/.ssh/id_rsa:ro \
    --docker-volumes `pwd`:/public \
    test1
WARNING: You most probably have uncommitted changes.
WARNING: These changes will not be tested.        
Running with gitlab-ci-multi-runner 9.1.1 (6104325)
  on  ()
Using Docker executor with image condaforge/linux-anvil:latest ...
Using docker image sha256:11c5fbc4381916d9b2a4a4aaa59eb09ca02a528a949edb9bc2d6c0fe6a485d78 for predefined container...
Pulling docker image condaforge/linux-anvil:latest ...
Using docker image condaforge/linux-anvil:latest ID=sha256:1362d71153808174f2b29cdfbe347d1ebc0bcf89d9d3bb12a84986d4dcfc2933 for build container...
Running on runner--project-0-concurrent-0 via username-desktop...
Cloning repository...
Cloning into '/builds/project-0'...
fatal: unable to access 'config': Permission denied
fatal: Could not read from remote repository.
1

1 Answers

1
votes

It turns out the permissions of files inside my .git folder were screwed up.

Running:

chmod ug+rwX,o+rX .git -R

fixed the issue.