Re: pipeline : slave throws an exception on trying to create a tmp folder, despite creating the workspace and a subfolder just fine

2016-12-11 Thread Jonathan Hodgson


On Sunday, December 11, 2016 at 4:36:24 PM UTC, Daniel Beck wrote:
>
> Is this a file system that doesn't like the @ character? 
>

Seems unlikely, since

1) I created the folder manually without issue (and then things worked 
correctly)
2) Jenkins previously created those folders just fine, this issue seems to 
have popped up out of nowhere
3) Jenkins also failed to create C:\Jenkins2\worspace  (despite having 
previously created C:\Jenkins'workspace just fine)
4) If I run the slave on another windows system (albeit 10 rather than 7) 
it works as it should.


>

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/6de76b62-fc84-4864-ba78-c7e2eca236d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pipeline : slave throws an exception on trying to create a tmp folder, despite creating the workspace and a subfolder just fine

2016-12-11 Thread Daniel Beck
Is this a file system that doesn't like the @ character?

Set the system property hudson.slaves.WorkspaceList to e.g. _ to use a 
different separator as described on 
https://wiki.jenkins-ci.org/display/JENKINS/Features+controlled+by+system+properties


> On 11.12.2016, at 14:30, Jonathan Hodgson  wrote:
> 
> Ok, adding to the confusion...
> 
> I just tried changing the slave configuration to give a compleely new  root 
> folder (C:\Jenkins2 rather than C:\Jenkins)
> 
> Ran the same same job
> 
> Failed to mkdirs: C:\Jenkins2\workspace\pipeline-test2
> hudson.FilePath.mkdirs(FilePath.java:1169)
> org.jenkinsci.plugins.durabletask.FileMonitoringTask$FileMonitoringController.(FileMonitoringTask.java:99)
> org.jenkinsci.plugins.durabletask.WindowsBatchScript$BatchController.(WindowsBatchScript.java:94)
> org.jenkinsci.plugins.durabletask.WindowsBatchScript$BatchController.(WindowsBatchScript.java:92)
> org.jenkinsci.plugins.durabletask.WindowsBatchScript.doLaunch(WindowsBatchScript.java:60)
> org.jenkinsci.plugins.durabletask.FileMonitoringTask.launchWithCookie(FileMonitoringTask.java:66)
> org.jenkinsci.plugins.durabletask.FileMonitoringTask.launch(FileMonitoringTask.java:61)
> 
> 
> 
> As you can see, now it's failing to create the job workspace folder, in fact 
> looking on the slave I see it has failed to create the Jenkins2 filder so I 
> just tried the following...
> 
> 1) manually created C:\Jenkins2
> 
> - Job failed with same stack trace
> 2) Manually created C:\Jenkins2\workspace
> 
> - Job failed with different stackl trace
> 
> 
> Failed to mkdirs: C:\Jenkins2\workspace\pipeline-test2@tmp\durable-e94accb0
> hudson.FilePath.mkdirs(FilePath.java:1169)
> org.jenkinsci.plugins.durabletask.FileMonitoringTask$FileMonitoringController.(FileMonitoringTask.java:101)
> org.jenkinsci.plugins.durabletask.WindowsBatchScript$BatchController.(WindowsBatchScript.java:94)
> org.jenkinsci.plugins.durabletask.WindowsBatchScript$BatchController.(WindowsBatchScript.java:92)
> org.jenkinsci.plugins.durabletask.WindowsBatchScript.doLaunch(WindowsBatchScript.java:60)
> org.jenkinsci.plugins.durabletask.FileMonitoringTask.launchWithCookie(FileMonitoringTask.java:66)
> org.jenkinsci.plugins.durabletask.FileMonitoringTask.launch(FileMonitoringTask.java:61)
> org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.start(DurableTaskStep.java:158)
> 
> And when I look, I see it has created pipeline-test2!
> 
> So, I can only conclude that the slave creates pipeline-test2 via a different 
> mechanism to either C:\Jenkins2\workspace or pipeline-test2@tmp
> 
> -- 
> 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 jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/6233493b-0b4e-44df-98ff-df7ca47f8f46%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/BAA615F5-1AC4-46EE-B971-7E0A99086970%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Re: pipeline : slave throws an exception on trying to create a tmp folder, despite creating the workspace and a subfolder just fine

2016-12-11 Thread Jonathan Hodgson

>
> Ok, adding to the confusion...
>

I just tried changing the slave configuration to give a compleely new  root 
folder (C:\Jenkins2 rather than C:\Jenkins)

Ran the same same job

Failed to mkdirs: C:\Jenkins2\workspace\pipeline-test2
hudson.FilePath.mkdirs(FilePath.java:1169)
org.jenkinsci.plugins.durabletask.FileMonitoringTask$FileMonitoringController.(FileMonitoringTask.java:99)
org.jenkinsci.plugins.durabletask.WindowsBatchScript$BatchController.(WindowsBatchScript.java:94)
org.jenkinsci.plugins.durabletask.WindowsBatchScript$BatchController.(WindowsBatchScript.java:92)
org.jenkinsci.plugins.durabletask.WindowsBatchScript.doLaunch(WindowsBatchScript.java:60)
org.jenkinsci.plugins.durabletask.FileMonitoringTask.launchWithCookie(FileMonitoringTask.java:66)
org.jenkinsci.plugins.durabletask.FileMonitoringTask.launch(FileMonitoringTask.java:61)




As you can see, now it's failing to create the job workspace folder, in 
fact looking on the slave I see it has failed to create the Jenkins2 filder 
so I just tried the following...

1) manually created C:\Jenkins2

- Job failed with same stack trace
2) Manually created C:\Jenkins2\workspace

- Job failed with different stackl trace


Failed to mkdirs: C:\Jenkins2\workspace\pipeline-test2@tmp\durable-e94accb0
hudson.FilePath.mkdirs(FilePath.java:1169)
org.jenkinsci.plugins.durabletask.FileMonitoringTask$FileMonitoringController.(FileMonitoringTask.java:101)
org.jenkinsci.plugins.durabletask.WindowsBatchScript$BatchController.(WindowsBatchScript.java:94)
org.jenkinsci.plugins.durabletask.WindowsBatchScript$BatchController.(WindowsBatchScript.java:92)
org.jenkinsci.plugins.durabletask.WindowsBatchScript.doLaunch(WindowsBatchScript.java:60)
org.jenkinsci.plugins.durabletask.FileMonitoringTask.launchWithCookie(FileMonitoringTask.java:66)
org.jenkinsci.plugins.durabletask.FileMonitoringTask.launch(FileMonitoringTask.java:61)
org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.start(DurableTaskStep.java:158)


And when I look, I see it has created pipeline-test2!

So, I can only conclude that the slave creates pipeline-test2 via a 
different mechanism to either C:\Jenkins2\workspace or pipeline-test2@tmp

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/6233493b-0b4e-44df-98ff-df7ca47f8f46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pipeline : slave throws an exception on trying to create a tmp folder, despite creating the workspace and a subfolder just fine

2016-12-11 Thread Jonathan Hodgson
I tried a couple of experiments today.

Launching a cmd windows as an administrator and running the slave from 
there... no difference.

Manually created the pipeline-test2@tmp directory - build was successful

Deleted both pipeline-test2 and pipeline-test2@tmp and ran build - jenkins 
recreated pipeline-test2 but failed to create pipeline-test2@tmp

Tried running the slave on a different windows machine (running WIndows 10, 
it's my development laptop) - build was successful

This has me confused. The fact that it's different on two different 
machines makes me think permisssions.

But if permissions allow the creation of pipeline-test2 by the slave, they 
should also allow the creation of pipeline-test2@tmp right next to it 
surely?

On Thursday, December 8, 2016 at 5:59:15 PM UTC, Jonathan Hodgson wrote:
>
> Hi,
>
> I've been experiementing trying to get some information which might give a 
> clue to the issues I'm having with my Windows slave.
>
> It's rather confusing, since to start with it worked fine. and the errors 
> aren't consistent (looking for past logs I see an error with unstashing 
> which I don't seem to be getting now).
>
> Anyway, I created a pipeline with this groovy script
>
> @NonCPS def printException(err)
> {
> message = err.getMessage()
> stacktrace = err.getStackTrace()
> stacktrace.each { stackElem ->
> message += "\n" + stackElem.toString()
> }
> print message
> }
>
> def batch(platform)
> {
> try {
> if (isUnix())
> {
> sh script:"echo running shell script"
> }
> else
> {
> bat script:"echo running batch script"
> }
> echo "Batch file ran ok"
> }
> catch (Exception err)
> {
> echo "Failed to run batch file on $platform"
> printException(err)
> }
> }
>
> def dirStep(platform)
> {
> try {
> dir ("mySubDirectory")
> {
> echo "In subdirectory"
> writeFile file:"mySubFile.txt", text:"this is a file in 
> $platform"
> }
> }
> catch (Exception err)
> {
> echo "Failed enter subdirectory on $platform"
> printException(err)
> } 
> }
>
> def writeFileStep(platform)
> {
> try {
> writeFile file:"myFile.txt", text:"this is a file in $platform"
> echo "wrote File on $platform"
> }
> catch (Exception err)
> {
> echo "Failed to create file on $platform"
> printException(err)
> }   
> }
>
> def testUnstash(platform)
> {
>  try {
> unstash "myStash"
> echo "instashed on $platform"
> }
> catch (Exception err)
> {
> echo "Failed to unstash on $platform"
> printException(err)
> }  
> }
>
> def runTests(nodeID)
> {
> node (nodeID)
> {
> batch(nodeID)
> writeFileStep(nodeID)
> dirStep(nodeID)
> testUnstash(nodeID)
> }
> }
>
> stage("testing")
> {
> node ("master")
> {
> writeFile file:"toStash.txt",text:"Testing stashing and unstashing"
> stash name:"myStash", include:"toStash.txt"
> }
> runTests("master")
> runTests("XCode")
> runTests("VS2013")
> }
>
>
> And when I run it, everything seems to work fine, except for the batch 
> file step on windows. which gives an error related to MkDir
>
> Started by user Jonathan Hodgson 
> [Pipeline] 
> stage[Pipeline] { (testing)[Pipeline] nodeRunning on master in 
> /var/lib/jenkins/workspace/pipeline-test2[Pipeline] {[Pipeline] 
> writeFile[Pipeline] stashStashed 3 file(s)[Pipeline] }[Pipeline] // 
> node[Pipeline] nodeRunning on master in 
> /var/lib/jenkins/workspace/pipeline-test2[Pipeline] {[Pipeline] 
> isUnix[Pipeline] sh[pipeline-test2] Running shell script
> + echo running shell script
> running shell script[Pipeline] echoBatch file ran ok[Pipeline] 
> writeFile[Pipeline] echowrote File on master[Pipeline] dirRunning in 
> /var/lib/jenkins/workspace/pipeline-test2/mySubDirectory[Pipeline] 
> {[Pipeline] echoIn subdirectory[Pipeline] writeFile[Pipeline] }[Pipeline] // 
> dir[Pipeline] unstash[Pipeline] echoinstahsed on master[Pipeline] }[Pipeline] 
> // node[Pipeline] nodeRunning on iMac in 
> /Users/jon/jenkins/workspace/pipeline-test2[Pipeline] {[Pipeline] 
> isUnix[Pipeline] sh[pipeline-test2] Running shell script
> + echo running shell script
> running shell script[Pipeline] echoBatch file ran ok[Pipeline] 
> writeFile[Pipeline] echowrote File on XCode[Pipeline] dirRunning in 
> /Users/jon/jenkins/workspace/pipeline-test2/mySubDirectory[Pipeline] 
> {[Pipeline] echoIn subdirectory[Pipeline] writeFile[Pipeline] }[Pipeline] // 
> dir[Pipeline] unstash[Pipeline] echoinstahsed on XCode[Pipeline] }[Pipeline] 
> // node[Pipeline] nodeRunning on Asus K51 in 
> C:\Jenkins\workspace\pipeline-test2[Pipeline] {[Pipeline] isUnix[Pipeline] 
> bat[Pipeline] echoFailed to run batch file on