Is the build running on a VM slave and you're trying to revert to a 
snapshot of that particular VM slave?

If so - that's not supported.  Jenkins requires that the slave doing a 
build be up and running for the entire duration of the build.  If you 
revert your slave while it's doing a build (sort of like rebooting your 
slave mid-build), the build will fail.

To work around this, split the job across two jobs.  First job reverts the 
targeted slave VM, second job runs on the targeted slave VM.

Jason Swager

On Monday, November 23, 2015 at 7:09:29 AM UTC-8, Andreas Tscharner wrote:
>
> Hello World, 
>
> We have Jenkins set up to build our product in a virtual machine. This 
> works so far. 
>
> Now I set the "Use Snapshot" checkbox and wanted to revert the VM to the 
> snapshot "production". This snapshot exists, I double checked: 
>
> root@buildserver:~# virsh snapshot-list build-vm2 
>   Name                 Creation Time             State 
> ------------------------------------------------------------ 
>   production           2015-11-09 23:48:03 +0100 shutoff 
>
> But if the job should be executed, I get the following error: 
>
> Build wurde durch eine SCM-Änderung ausgelöst. 
> Got snapshot production from job configuration 
> Preparing to revert build-vm2 to snapshot production. 
> [EnvInject] - Loading node environment variables. 
> ERROR: SEVERE ERROR occurs 
> org.jenkinsci.lib.envinject.EnvInjectException: 
> hudson.remoting.ChannelClosedException: channel is already closed 
>         at 
> org.jenkinsci.plugins.envinject.service.EnvironmentVariablesNodeLoader.gatherEnvironmentVariablesNode(EnvironmentVariablesNodeLoader.java:75)
>  
>
>         at 
> org.jenkinsci.plugins.envinject.EnvInjectListener.loadEnvironmentVariablesNode(EnvInjectListener.java:81)
>  
>
>         at 
> org.jenkinsci.plugins.envinject.EnvInjectListener.setUpEnvironment(EnvInjectListener.java:39)
>  
>
>         at 
> hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:572)
>  
>
>         at 
> hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:492) 
>
>         at hudson.model.Run.execute(Run.java:1738) 
>         at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 
>         at 
> hudson.model.ResourceController.execute(ResourceController.java:98) 
>         at hudson.model.Executor.run(Executor.java:410) 
> Caused by: hudson.remoting.ChannelClosedException: channel is already 
> closed 
>         at hudson.remoting.Channel.send(Channel.java:578) 
>         at hudson.remoting.Request.call(Request.java:130) 
>         at hudson.remoting.Channel.call(Channel.java:780) 
>         at hudson.FilePath.act(FilePath.java:1074) 
>         at 
> org.jenkinsci.plugins.envinject.service.EnvironmentVariablesNodeLoader.gatherEnvironmentVariablesNode(EnvironmentVariablesNodeLoader.java:44)
>  
>
>         ... 8 more 
> Caused by: java.io.IOException 
>         at hudson.remoting.Channel.close(Channel.java:1163) 
>         at hudson.remoting.Channel.close(Channel.java:1138) 
>         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:215) 
>         at hudson.model.Run.execute(Run.java:1734) 
>         ... 3 more 
> Checking console output 
> [description-setter] Description set: 
> [EnvInject] - [ERROR] - SEVERE ERROR occurs: channel is already closed 
> Email was triggered for: Failure - Any 
> Sending email for trigger: Failure - Any 
> ERROR: Error: No workspace found! 
> An attempt to send an e-mail to empty list of recipients, ignored. 
> Finished: FAILURE 
>
> What can I do to fix this? 
>
> TIA and best regards 
>
> WENZEL Metromec AG 
>         Andreas Tscharner 
> -- 
> Andreas Tscharner, Development 
> WENZEL Metromec AG, Rheinfelsstrasse 1, CH-7007 Chur, Switzerland 
> phone:          +41 (0)81 257 07 00 
> fax:            +41 (0)81 257 07 01 
> e-mail:         mailto:[email protected] <javascript:> 
> www:            http://www.metromec.ch 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/c44b5be2-b323-40bc-94cd-b5c0b5ffeb7d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to