Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-48258

git client plugin occasionally fails with "text file busy" error

    XMLWordPrintable

Details

    Description

      Occasionally I get the following git error early in some of my pipeline builds, but have not been able to reproduce the issue during testing.

      Perhaps the createUnixGitSSH method in CliGitAPIImpl.java should explicitly close the PrintWriter before returning?  Or maybe it just needs to flush the stream, and the script should be executed as "sh tmpfile.sh" instead of "./tmpfile.sh" ?

      using GIT_SSH to set credentials 
       > git ls-remote -h -t git.example.org:/var/git/foo.git # timeout=10
      hudson.plugins.git.GitException: Command "git ls-remote -h -t git.example.org:/var/git/foo.git" returned status code 128:
      stdout: 
      stderr: fatal: cannot exec '/tmp/ssh4044675960910064496.sh': Text file busy
      fatal: unable to fork
      
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1970)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1689)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1600)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1591)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getRemoteReferences(CliGitAPIImpl.java:2785)
      	at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:708)
      	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:598)
      	at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrieve(SCMSourceRetriever.java:80)
      	at org.jenkinsci.plugins.workflow.libs.LibraryAdder.retrieve(LibraryAdder.java:153)
      	at org.jenkinsci.plugins.workflow.libs.LibraryAdder.add(LibraryAdder.java:134)
      	at org.jenkinsci.plugins.workflow.libs.LibraryDecorator$1.call(LibraryDecorator.java:125)
      	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1065)
      	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
      	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
      	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
      	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
      	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
      	at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
      	at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
      	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:129)
      	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:123)
      	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:517)
      	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:480)
      	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:269)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:421)
      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      WorkflowScript: Loading libraries failed
      
      1 error
      

      Attachments

        Activity

          mbmop Mostyn Bramley-Moore created issue -
          markewaite Mark Waite made changes -
          Field Original Value New Value
          Assignee Mark Waite [ markewaite ]
          mbmop Mostyn Bramley-Moore made changes -
          Resolution Not A Defect [ 7 ]
          Status Open [ 1 ] Resolved [ 5 ]
          mbmop Mostyn Bramley-Moore made changes -
          Resolution Not A Defect [ 7 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          tsniatowski Tomasz Śniatowski made changes -
          Attachment JavaCloexec.java [ 41076 ]
          markewaite Mark Waite made changes -
          Resolution Fixed [ 1 ]
          Status Reopened [ 4 ] Fixed but Unreleased [ 10203 ]
          phgr100x phgr100x phgr100x made changes -
          Comment [ This is probably caused by https://bugs.openjdk.java.net/browse/JDK-8068370 ]
          markewaite Mark Waite made changes -
          Status Fixed but Unreleased [ 10203 ] Closed [ 6 ]

          People

            Unassigned Unassigned
            mbmop Mostyn Bramley-Moore
            Votes:
            8 Vote for this issue
            Watchers:
            27 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: