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

Job DSL job generation results in java.nio.file.NoSuchFileException for config.xml

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Minor Minor
    • job-dsl-plugin
    • None
    • Job DSL 1.66 (happens also with previous versions)
      Jenkins 2.89.2 (happens also with previous versions)
      Oracle Java 1.8.0_141
      Suse Linux 11.3

      I'm sometimes getting this type of errors when a Job DSL is executing is executings its "Process Job DSLs - Look on Filesystem" step:

      ...
      17:10:12 Processing DSL script dsl_central_wm_jobs.groovy
      17:10:12 Existing items:
      17:10:12 GeneratedJob{name='a-first-job'}

      ...
      17:10:12 GeneratedJob{name='w-last-job'}

      17:10:13 FATAL: /nfs/path/to/job/config.xml
      17:10:13 java.nio.file.NoSuchFileException: /nfs/path/to/job/config.xml
      17:10:13 at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
      17:10:13 at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
      17:10:13 at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
      17:10:13 at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
      17:10:13 at java.nio.file.Files.newByteChannel(Files.java:361)
      17:10:13 at java.nio.file.Files.newByteChannel(Files.java:407)
      17:10:13 at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
      17:10:13 at java.nio.file.Files.newInputStream(Files.java:152)
      17:10:13 at hudson.Util.getDigestOf(Util.java:838)
      17:10:13 at javaposse.jobdsl.plugin.ExecuteDslScripts.updateGeneratedJobMap(ExecuteDslScripts.java:468)
      17:10:13 at javaposse.jobdsl.plugin.ExecuteDslScripts.updateGeneratedJobs(ExecuteDslScripts.java:449)
      17:10:13 at javaposse.jobdsl.plugin.ExecuteDslScripts.perform(ExecuteDslScripts.java:330)
      17:10:13 at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
      17:10:13 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      17:10:13 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
      17:10:13 at hudson.model.Build$BuildExecution.build(Build.java:206)
      17:10:13 at hudson.model.Build$BuildExecution.doRun(Build.java:163)
      17:10:13 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
      17:10:13 at hudson.model.Run.execute(Run.java:1724)
      17:10:13 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      17:10:13 at hudson.model.ResourceController.execute(ResourceController.java:97)
      17:10:13 at hudson.model.Executor.run(Executor.java:421)

      This happens in around 1% of Job DSL executions on that machine always for the same job.

      There are two things that can aid this in happening that look like a race condition:

      • Job configuration resides on a NFS drive.
      • The job whose config.xml file disappears is often run around at the same time as the job that generates Job DSL is run. This is a really short running job that can be remotely triggered many times during some minutes.

      NFS drives can mean that file operations that Jenkins uses to regenerate the config.xml files are not as fast as you would think them to be and running the job at the same time as this GeneratedJob{name="job-name"} clause is output could create some lock to the configuration file writing. These are naturally my assumptions without further implementation details knowledge, but as this looks like a race condition that happens couple of times per week, these could be reasons for it to be happening.

            daspilker Daniel Spilker
            ejusjud Jussi Judin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: