pipeline : remote file operation on the windows slave no longer work

82 views
Skip to first unread message

Jonathan Hodgson

unread,
Dec 3, 2016, 11:34:40 AM12/3/16
to Jenkins Users
Hi,

Remote fie operations, such as mkdir (which in this case it appears is being called by the bat pipeline step), now fail on my windows slave.

At first I thought it was down to the user initiating the build, but it seems that may have been a red-herring, certainly the problem is user independent now.

It worked in the past, but now a simple script iike

stage("testing")
    node
("VS2013")
   
{
        echo
"Substage running on Windows"
        user_is
= bat script:"echo user %USERDOMAIN%\\%USERNAME%", returnStdout:true
        echo user_is
   
}
}

bombs out with

Started by user Jonathan Hodgson
[Pipeline] stage
[Pipeline] { (testing)
[Pipeline] node
Running on Asus K51 in C:\Jenkins\workspace\pipeline-test2
[Pipeline] {
[Pipeline] echo
Substage running on Windows
[Pipeline] bat
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // stage
[Pipeline] End of Pipeline
java
.io.IOException: Failed to mkdirs: C:\Jenkins\workspace\pipeline-test2@tmp\durable-69ea6505
 at hudson
.FilePath.mkdirs(FilePath.java:1169)
 at org
.jenkinsci.plugins.durabletask.FileMonitoringTask$FileMonitoringController.<init>(FileMonitoringTask.java:101)
 at org
.jenkinsci.plugins.durabletask.WindowsBatchScript$BatchController.<init>(WindowsBatchScript.java:94)
 at org
.jenkinsci.plugins.durabletask.WindowsBatchScript$BatchController.<init>(WindowsBatchScript.java:92)
 at org
.jenkinsci.plugins.durabletask.WindowsBatchScript.doLaunch(WindowsBatchScript.java:60)
 at org
.jenkinsci.plugins.durabletask.FileMonitoringTask.launchWithCookie(FileMonitoringTask.java:66)
 at org
.jenkinsci.plugins.durabletask.FileMonitoringTask.launch(FileMonitoringTask.java:61)
 at org
.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.start(DurableTaskStep.java:158)
 at org
.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:184)
 at org
.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:126)
 at org
.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)
 at groovy
.lang.GroovyObject$invokeMethod.call(Unknown Source)
 at org
.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
 at org
.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
 at org
.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:151)
 at org
.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21)
 at org
.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:115)
 at org
.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149)
 at org
.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146)
 at org
.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)
 at org
.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)
 at com
.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:16)
 at
WorkflowScript.run(WorkflowScript:6)
 at ___cps
.transform___(Native Method)

<snipped for brevity)

Debian Linux on the master, Windows 7 on the slave, both running the same version of Java.

The OSX slave has no such iisues.

Does anyone have any ideas? This is making my Jenkins setup pretty much unusable.

Joel Reed

unread,
Dec 5, 2016, 7:24:17 PM12/5/16
to Jenkins Users
This seemed to work for me:

stage("Testing"){

    node ("VS2013") {
        echo "Substage running on Windows"
        bat "echo user %USERDOMAIN%\\%USERNAME%"
    }
}

I don't know if it was your cut and paste or if you were in fact not properly encapsulating the stage { ... }. I would have expected a compilation error and not the error you posted above if that was the case. There also was a behavior change to stage syntax a few releases ago. Stage expects a block. Check the release notes, https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Stage+Step+Plugin. Your bat step was also a little verbose I think. Given that by default it will echo the output to the console.

You didn't say what versions your running but the above snippet ran as expected in my latest and greatest 2.35 and all the latest plugin updates.

Jonathan Hodgson

unread,
Dec 6, 2016, 9:28:44 AM12/6/16
to Jenkins Users
Sorry, the { got lost somewhere in cutting and pasting. what you have is what I was running.

I'm pretty sure my issue has nothing to do with syntax, this is all code which has worked in the past. The error messages all indicate problems with remote file access, I've had mkdir errors, also unstash errors.

I'm currently on 2.34, but this has been happening for a few versions now.

And yes, the bat is verbose, that's because I was experimenting seeing if I could get anything to display, before I realized that the crash was happening on creating the batch file, not on running it.

There are several issues raised on JIra which seem similar, and no activity I can see on them. That's a worry, since this is a bit of a showstopper.
Reply all
Reply to author
Forward
0 new messages