Windows slave: Unable to produce a script file

519 views
Skip to first unread message

jmohre

unread,
Feb 16, 2017, 9:16:11 AM2/16/17
to Jenkins Users

Hi,

 

I get an error when I try to execute a job on a windows slave.

I added the error log below.

I seems that depending on how I start the windows salve – the error occurs or not.

 

I want to start the slave via execution command on the master, like this ssh -v mcetestuser@20-MCE-UT2 javaw -jar C:/JenkinsSlave/slave.jar

This worked before on other slave PCs, but I have no idea why not on this one.

The slave is start but when executing a job I get an error that the script file can not be created.

If I start the slave via Web Start by executing the following command on the slave PC

“java -jar slave.jar -jnlpUrl http://MyPI:Port/computer/20-MCE-UT2/slave-agent.jnlp -secret 499086c90bbea551feeb64913a25946832e84329203be2090e67b4d19a454344” I have no problems.
 
The same and most interesting thing happens if put this command in batch.
If I log in with ssh to slave PC and call that batch file everything works (slave connected and job succeeded), but
if I call this batch script direct with the ssh command, like ssh use@testPC batchFile.bat only the slave is connected but the job 
failed with same error(see below).
 
Hope someone has ideas or tips to solve that issue.
 
Thanks
 
Jörg
 

Error log:

 

Started by user mcetestuser
[EnvInject] - Loading node environment variables.
Building remotely on 20-MCE-UT2 in workspace C:\JenkinsSlave\workspace\Test
FATAL: Unable to produce a script file
java.io.IOException: Failed to create a temp file on C:\JenkinsSlave\workspace\Test
        at hudson.FilePath.createTextTempFile(FilePath.java:1265)
        at hudson.tasks.CommandInterpreter.createScriptFile(CommandInterpreter.java:128)
        at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:79)
        at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:63)
        at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
        at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
        at hudson.model.Build$BuildExecution.build(Build.java:199)
        at hudson.model.Build$BuildExecution.doRun(Build.java:160)
        at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:566)
        at hudson.model.Run.execute(Run.java:1678)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
        at hudson.model.ResourceController.execute(ResourceController.java:88)
        at hudson.model.Executor.run(Executor.java:231)
Caused by: java.io.IOException: remote file operation failed: C:\JenkinsSlave\workspace\Test at hudson.remoting.Channel@6d6d6d6d:20-MCE-UT2
        at hudson.FilePath.act(FilePath.java:910)
        at hudson.FilePath.act(FilePath.java:887)
        at hudson.FilePath.createTextTempFile(FilePath.java:1239)
        ... 12 more
Caused by: java.io.IOException: Failed to create a temporary directory in C:\Windows
        at hudson.FilePath$15.invoke(FilePath.java:1251)
        at hudson.FilePath$15.invoke(FilePath.java:1239)
        at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2461)
        at hudson.remoting.UserRequest.perform(UserRequest.java:118)
        at hudson.remoting.UserRequest.perform(UserRequest.java:48)
        at hudson.remoting.Request$2.run(Request.java:328)
        at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at hudson.remoting.Engine$1$1.run(Engine.java:63)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Zugriff verweigert
        at java.io.WinNTFileSystem.createFileExclusively(Native Method)
        at java.io.File.createTempFile(Unknown Source)
        at hudson.FilePath$15.invoke(FilePath.java:1249)
        ... 11 more
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE

 

jmohre

unread,
Feb 16, 2017, 11:32:48 AM2/16/17
to Jenkins Users
I found the problem by myself.
It was indeed wrong access rights to C:\╗Windows.
I was not able to create files in that directory - after disablig UAC by the following
it works.

Press keys “Windows Key + R”, type regedit
Locate HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA
Update the EnableLUA value to 0 (turn if off)
Restart Windows.
Reply all
Reply to author
Forward
0 new messages