Gitlab runner fails : (error: could not lock config file .git/config: Permission denied)

Hi there,

I’m using gitlab for my php projects for a while but i’m just entering to the world of CI.
I updated my gitlab to the 10.0.1, installed gitlab-runner, registered it as a specific runner for my project.

After some reading about .gitlab-ci.yml, I created a config file and pushed it to my repository. The runner takes the job, but fails early in the process …

Here is the error thrown by the runner

Running with gitlab-runner 10.0.0 (2055cfdc)
  on batlab-runner (503f24e3)
Using Shell executor...
Running on xxxxxx ...
Fetching changes...
error: could not lock config file .git/config: Permission denied
ERROR: Job failed: exit status 1

the yml config file

cache:
  paths:
  - vendor/

before_script:
# Install composer dependencies
- wget https://composer.github.io/installer.sig -O - -q | tr -d '\n' > installer.sig
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php -r "if (hash_file('SHA384', 'composer-setup.php') === file_get_contents('installer.sig')) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
- php composer-setup.php
- php -r "unlink('composer-setup.php'); unlink('installer.sig');"
- php composer.phar install

test:app:
  script:
  - ./vendor/phpunit/phpunit/phpunit --configuration phpunit.xml

I searched on the internet and found some suggestions about file permissions but nothing changed.
Do you have an idea of where does it could come from ?

By the way, when the runner clone or fetch the git, where does that occurs exactly on the filesystem ?

no one has encountered the same problem when the runner clones the git ?

Hi @brice,
I ran into exactly the same problem today.
Did you find a solution meanwhile?

Thanks
~Peter

Hi @bauschan,

Unfortunately not.
Please don’t hesitate if you find a solution

Thanks

Hi there,

getting the same error:

   $ vendor/bin/phpunit --configuration "phpunit.xml" --coverage-textCould not read "phpunit.xml".ERROR: Job failed: exit code 1
   ``` 

BR,
B.

Had the same issue today, was happening because of a mismatch or ci-runner and gitlab version

Hope this helps for some