Could not write config file

57 views
Skip to first unread message

xJom

unread,
Jun 19, 2017, 3:30:51 AM6/19/17
to Jenkins Users
Hi!

Using Jenkins 2.46.1 LTS on an Ubuntu server, and a virtual Windows slave, we sometime get an error when initializing the git repo (from GitLab on the same Ubuntu server).

Originally, we thought it was an issue with the Git-plugin: https://issues.jenkins-ci.org/browse/JENKINS-41169

We have tried a lot of workarounds, like removing the entire workspace manually, adding delays in the start of the job, etc etc. (You can see it in the thread above.)

But nothing works as a solid solution. It is always coming back.

I am currently out of ideas on things to try, so please, if you can add some comment, that makes me dig in the right direction, it would be most welcome.

BR
/Mattias

Ivan Prokhorov

unread,
Jun 19, 2017, 11:42:51 AM6/19/17
to Jenkins Users
Please share your job logs

xJom

unread,
Jun 19, 2017, 2:08:32 PM6/19/17
to Jenkins Users
From the link:

Description
Sometimes, the git init-command fails because of the .git/config-file is non-writeable.
Logging into the slave, there seems to be nothing wrong with the permissions on the file.
When it is good, it just inits the repo.
12:33:36 Started by GitLab push by the_persion
12:33:36 [EnvInject] - Loading node environment variables.
12:33:36 Building remotely on the_machine in workspace C:\JenkinsVM_slave\workspace\the_job
12:33:36 [WS-CLEANUP] Deleting project workspace...
12:33:38 [WS-CLEANUP] Done
12:33:41 Wiping out workspace first.
12:33:41 Cloning the remote Git repository
12:33:41 Cloning repository the_repository.git
12:33:41 > git init C:\JenkinsVM_slave\workspace\the_job # timeout=10
12:33:41 Fetching upstream changes from the_repository.git

When it fails, it halts at git init:
11:38:32 Started by GitLab push by the_person
11:38:32 [EnvInject] - Loading node environment variables.
11:38:32 Building remotely on the_machine in workspace C:\JenkinsVM_slave\workspace\the_job
11:38:32 [WS-CLEANUP] Deleting project workspace...
11:38:32 [WS-CLEANUP] Done
11:38:32 Wiping out workspace first.
11:38:32 Cloning the remote Git repository
11:38:32 Cloning repository the_repository.git
11:38:32 > git init C:\JenkinsVM_slave\workspace\the_job # timeout=10
11:38:33 ERROR: Error cloning remote repo 'origin'
11:38:33 hudson.plugins.git.GitException: Could not init C:\JenkinsVM_slave\workspace\the_job
11:38:33 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:666)
11:38:33 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:467)
11:38:33 at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152)
11:38:33 at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145)
11:38:33 at hudson.remoting.UserRequest.perform(UserRequest.java:153)
11:38:33 at hudson.remoting.UserRequest.perform(UserRequest.java:50)
11:38:33 at hudson.remoting.Request$2.run(Request.java:332)
11:38:33 at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
11:38:33 at java.util.concurrent.FutureTask.run(Unknown Source)
11:38:33 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
11:38:33 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
11:38:33 at hudson.remoting.Engine$1$1.run(Engine.java:85)
11:38:33 at java.lang.Thread.run(Unknown Source)

Ivan Prokhorov

unread,
Jun 20, 2017, 1:17:30 AM6/20/17
to Jenkins Users
Try to check the following:
- try to monitor the folder - who uses the folder (sysinternals may contain something useful)
- disable antivirus or similar software (if possible)
- print content of the folder before git checkout (is it pipeline job or freestyle?)
- check network connectivity (i.e. ping before 'git clone')
- try "git clone" as a part of 'batch script' step - it may give you more information
- disk space (your slave is virtual, maybe it shares a hardware disk with another virtual instances)
Reply all
Reply to author
Forward
0 new messages