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

Pipeline jobs sometimes fail due to being able to create <jobNo>/build.xml reporting it already exists

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • core, pipeline
    • None
    • Windows Server 2019
      Jenkins Version: 2.375.2
      Java Version: 11.0.17+8-LTS
      Java Flavour: Zulu JRE

      Occasionally pipeline jobs will fail saying that the build.xml file in the specific folder for this build already exists. This seems to happen randomly across several of our jobs Full stack trace below

      Started by upstream project "<UP Stream Project>" build number 9418
      originally caused by:
       Started by upstream project "<FURTHER UP STREAM PROJECT>
       originally caused by:
        Started by timer
      Obtained <Folder>/Jenkinsfile from git <SSH repo url>
      [Pipeline] Start of Pipeline
      [Pipeline] properties
      [Pipeline] End of Pipeline
      Also:   java.nio.file.AccessDeniedException: <redacted>\Jenkins\jobs\<JOB NAME>\builds\292\atomic3801775937435615278tmp -> <redacted>\Jenkins\jobs\<JOB NAME>\builds\292\build.xml
              at java.base/sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
              at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
              at java.base/sun.nio.fs.WindowsFileCopy.move(Unknown Source)
              at java.base/sun.nio.fs.WindowsFileSystemProvider.move(Unknown Source)
              at java.base/java.nio.file.Files.move(Unknown Source)
              at hudson.util.AtomicFileWriter.commit(AtomicFileWriter.java:195)
              at hudson.XmlFile.write(XmlFile.java:218)
              at org.jenkinsci.plugins.workflow.support.PipelineIOUtils.writeByXStream(PipelineIOUtils.java:30)
              at org.jenkinsci.plugins.workflow.job.WorkflowRun.save(WorkflowRun.java:1244)
              at jdk.internal.reflect.GeneratedMethodAccessor1528.invoke(Unknown Source)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              at java.base/java.lang.reflect.Method.invoke(Unknown Source)
              at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
              at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
              at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
              at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
              at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46)
              at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
              at org.jenkinsci.plugins.pipeline.modeldefinition.Utils.updateRunAndJobActions(Utils.groovy:301)
              at org.jenkinsci.plugins.pipeline.modeldefinition.Utils$updateRunAndJobActions$4.call(Unknown Source)
              at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
              at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
              at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:20)
      java.nio.file.FileAlreadyExistsException: <redacted>\Jenkins\jobs\<JOB NAME>\builds\292\atomic3801775937435615278tmp -> <redacted>\Jenkins\jobs\<JOB NAME>\builds\292\build.xml
          at java.base/sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
          at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
          at java.base/sun.nio.fs.WindowsFileCopy.move(Unknown Source)
          at java.base/sun.nio.fs.WindowsFileSystemProvider.move(Unknown Source)
          at java.base/java.nio.file.Files.move(Unknown Source)
          at hudson.util.AtomicFileWriter.commit(AtomicFileWriter.java:210)
          at hudson.XmlFile.write(XmlFile.java:218)
          at org.jenkinsci.plugins.workflow.support.PipelineIOUtils.writeByXStream(PipelineIOUtils.java:30)
          at org.jenkinsci.plugins.workflow.job.WorkflowRun.save(WorkflowRun.java:1244)
          at jdk.internal.reflect.GeneratedMethodAccessor1528.invoke(Unknown Source)
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.base/java.lang.reflect.Method.invoke(Unknown Source)
          at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
          at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
          at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
          at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
          at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
          at org.jenkinsci.plugins.pipeline.modeldefinition.Utils.updateRunAndJobActions(Utils.groovy:301)
          at org.jenkinsci.plugins.pipeline.modeldefinition.Utils$updateRunAndJobActions$4.call(Unknown Source)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
          at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:20)
          at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.call(ModelInterpreter.groovy:66)
          at WorkflowScript.run(WorkflowScript:20)
          at __cps.transform__(Native Method)
          at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:90)
          at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:116)
          at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:85)
          at jdk.internal.reflect.GeneratedMethodAccessor397.invoke(Unknown Source)
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.base/java.lang.reflect.Method.invoke(Unknown Source)
          at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
          at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:75)
          at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
          at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:65)
          at jdk.internal.reflect.GeneratedMethodAccessor441.invoke(Unknown Source)
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.base/java.lang.reflect.Method.invoke(Unknown Source)
          at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
          at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
          at com.cloudbees.groovy.cps.Next.step(Next.java:83)
          at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:152)
          at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:146)
          at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:136)
          at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:275)
          at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:146)
          at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
          at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
          at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:187)
          at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:420)
          at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:330)
          at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:294)
          at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
          at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
          at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
          at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:30)
          at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:70)
          at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
          at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at java.base/java.lang.Thread.run(Unknown Source)
      Finished: FAILURE

            Unassigned Unassigned
            daveq_work David
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: