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

Using libvirt slave 'Before Job Snapshot' causes NPE

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • libvirt-slave-plugin
    • None
    • Jenkins ver. 1.565.2
      libvirt-slave 1.8.4

      I tried configuring a node to reset to a snapshot before any job starts, but it seems the job does not wait for this to finish.

      You can see from the build log that it triggers a snapshot revert, and then immediately proceeds to the scm checkout step of the job:

      Started by user Mikal H Henriksen
      Got snapshot phoenix from slave/node configuration
      Preparing to revert phoenix to snapshot phoenix.
      Building remotely on node-host (amd64) in workspace /var/jenkins/workspace/one-phoenix-3.1
      java.io.IOException: remote file operation failed: /var/jenkins/workspace/one-phoenix-3.1 at hudson.remoting.Channel@56eac72e:bgo-vmeo-smokeandmirrors-libvirt
      	at hudson.FilePath.act(FilePath.java:916)
      	at hudson.FilePath.act(FilePath.java:893)
      	at hudson.FilePath.mkdirs(FilePath.java:1063)
      	at hudson.model.AbstractProject.checkout(AbstractProject.java:1245)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:615)
      	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:524)
      	at hudson.model.Run.execute(Run.java:1706)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:232)
      Caused by: hudson.remoting.ChannelClosedException: channel is already closed
      	at hudson.remoting.Channel.send(Channel.java:541)
      	at hudson.remoting.Request.call(Request.java:129)
      	at hudson.remoting.Channel.call(Channel.java:739)
      	at hudson.FilePath.act(FilePath.java:909)
      	... 10 more
      Caused by: java.io.IOException
      	at hudson.remoting.Channel.close(Channel.java:1027)
      	at hudson.remoting.Channel.close(Channel.java:1009)
      	at hudson.plugins.libvirt.LibvirtSnapshotRevertRunListener.revertVMSnapshot(LibvirtSnapshotRevertRunListener.java:84)
      	at hudson.plugins.libvirt.LibvirtSnapshotRevertRunListener.onStarted(LibvirtSnapshotRevertRunListener.java:58)
      	at hudson.model.listeners.RunListener.fireStarted(RunListener.java:213)
      	at hudson.model.Run.execute(Run.java:1702)
      	... 3 more
      

      After that follows more steps like archiving failing in the same way.

          [JENKINS-24654] Using libvirt slave 'Before Job Snapshot' causes NPE

          Mikal Henriksen created issue -
          Mikal Henriksen made changes -
          Summary Original: Using libvirt slave 'Before Job Snapshot' does not work, job starts executing immediately New: Using libvirt slave 'Before Job Snapshot' causes NPE
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 157681 ] New: JNJira + In-Review [ 179649 ]
          Bastian Germann made changes -
          Released As New: https://github.com/jenkinsci/libvirt-slave-plugin/commit/34c70fd1b65df1f157bd34b61230f123237a6412
          Assignee New: Bastian Germann [ bgermann ]
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Fixed but Unreleased [ 10203 ]
          Bastian Germann made changes -
          Link New: This issue is duplicated by JENKINS-40675 [ JENKINS-40675 ]
          Bastian Germann made changes -
          Status Original: Fixed but Unreleased [ 10203 ] New: Resolved [ 5 ]
          Bastian Germann made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]

            bgermann Bastian Germann
            stylpe Mikal Henriksen
            Votes:
            6 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: