It is the 3rd time I am seeing the following error:
error: file write error: Bad file descriptor
fatal: unable to write loose object file
fatal: unpack-objects failed
It happens only if the pipeline is executed from SCM. Any idea how this can be fixed, beside the obvious - move the pipeline inside jenkins configuration.
I know we are running quite old Jenkins version (2.319.3), but at this moment of time it can not be upgraded. Still the issue happens from time to time. Once happened restarting the jenkins server fixed it, but it did not work this time.
You haven’t shared much info on how you encountered the error. Share more info about what you’re doing to encounter the error; commands, configuration, etc
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2671)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2096)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:84)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:618)
at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:366)
at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:197)
at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:173)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:118)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:70)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:310)
at hudson.model.ResourceController.execute(ResourceController.java:99)
at hudson.model.Executor.run(Executor.java:432)
Finished: FAILURE
It happens only if jenkins pipeline is configured to use SCM. If the pipeline is written inside the config - everything is working. So it is quite ambiguous.
UPDATE:
Changing the branch where from the files are pulled - fixes the issue, If you go back to the old branch that was broken and run the job again - fails with same error. If you go back again to the new branch that was working - it starts to fail as well.
I suspect that may be there is some cache in the jenkins_home that may be causes this. Any idea what possible could be cleared so this can be permanently resolved?