Jenkins error Unable to produce a script file - jenkins

I am getting the following error while trying to build an application.
It worked properly from long time, recently it stopped the build process and throws the error. The configuration of the build uses slave node, In google many suggested that the issue may related to the Java version issues in slave node and the selected version in jenkings configuration section.
FATAL: Unable to produce a script file
hudson.util.IOException2: Failed to create a temp file on
/scratch/jenkins/workspace/
at hudson.FilePath.createTextTempFile(FilePath.java:1223)
at hudson.tasks.CommandInterpreter.createScriptFile(CommandInterpreter.java:115)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:75)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:60)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
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:586)
at hudson.model.Run.execute(Run.java:1593)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:247)
Caused by: hudson.util.IOException2: remote file operation failed:
/scratch/jenkins/workspace/ERT_PC_CF7 at
hudson.remoting.Channel#1f9efe8:build- linux-1
at hudson.FilePath.act(FilePath.java:901)
at hudson.FilePath.act(FilePath.java:878)
at hudson.FilePath.createTextTempFile(FilePath.java:1200)
... 12 more
Caused by: hudson.util.IOException2: Failed to create a temporary directory in /tmp
at hudson.FilePath$14.invoke(FilePath.java:1212)
at hudson.FilePath$14.invoke(FilePath.java:1200)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2393)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
Caused by: java.io.IOException: Read-only file system
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.checkAndCreate(File.java:1717)
at java.io.File.createTempFile0(File.java:1738)
at java.io.File.createTempFile(File.java:1815)
at hudson.FilePath$14.invoke(FilePath.java:1210)

This is not a permission issue. The issue has been resolved by rebooting the slave nodes as the whole file system in slave node went into read mode, even the root user gets exception with touch command on the directory /scratch/jenkins/workspace/ .

Related

Jenkins java.io.FileNotFoundException: https://groovy.jfrog.io/artifactory/dist-release-local/groovy-zips/pache-groovy-binary-2.5.3.zip

Some of our jobs that use groovy scripts have started failing today. It appears the "a" in "apache" is missing and there is a typo in the jfrog download reference. I suspect this was a long lived typo in the jfrog repo and may have been fixed in the past day or so (I see uploads yesterday), but now is breaking anyone who used it. Anyone have ideas of how to rectify this?
Running as SYSTEM
[EnvInject] - Loading node environment variables.
Building on master in workspace D:\Data\Jenkins\.jenkins\jobs\Emergency Deployment\workspace
Unpacking https://groovy.jfrog.io/artifactory/dist-release-local/groovy-zips/pache-groovy-binary-2.5.3.zip to D:\Data\Jenkins\.jenkins\tools\hudson.plugins.groovy.GroovyInstallation\Groovy_2.5.3 on Jenkins
FATAL: Failed to install https://groovy.jfrog.io/artifactory/dist-release-local/groovy-zips/pache-groovy-binary-2.5.3.zip to D:\Data\Jenkins\.jenkins\tools\hudson.plugins.groovy.GroovyInstallation\Groovy_2.5.3
java.io.FileNotFoundException: https://groovy.jfrog.io/artifactory/dist-release-local/groovy-zips/pache-groovy-binary-2.5.3.zip
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1836)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2943)
at java.net.URLConnection.getHeaderFieldLong(URLConnection.java:629)
at java.net.URLConnection.getContentLengthLong(URLConnection.java:501)
at java.net.URLConnection.getContentLength(URLConnection.java:485)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getContentLength(HttpsURLConnectionImpl.java:398)
at org.jvnet.robust_http_client.RetryableHttpStream.<init>(RetryableHttpStream.java:90)
Caused: java.io.FileNotFoundException: https://groovy.jfrog.io/artifactory/dist-release-local/groovy-zips/pache-groovy-binary-2.5.3.zip
at sun.reflect.GeneratedConstructorAccessor345.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1890)
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1885)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1884)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1457)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at org.jvnet.robust_http_client.RetryableHttpStream.getStream(RetryableHttpStream.java:98)
at org.jvnet.robust_http_client.RetryableHttpStream.<init>(RetryableHttpStream.java:91)
at org.jvnet.robust_http_client.RetryableHttpStream.<init>(RetryableHttpStream.java:74)
at hudson.ProxyConfiguration.getInputStream(ProxyConfiguration.java:330)
at hudson.FilePath.installIfNecessaryFrom(FilePath.java:924)
Caused: java.io.IOException: Failed to install https://groovy.jfrog.io/artifactory/dist-release-local/groovy-zips/pache-groovy-binary-2.5.3.zip to D:\Data\Jenkins\.jenkins\tools\hudson.plugins.groovy.GroovyInstallation\Groovy_2.5.3
at hudson.FilePath.installIfNecessaryFrom(FilePath.java:938)
at hudson.FilePath.installIfNecessaryFrom(FilePath.java:851)
at hudson.tools.DownloadFromUrlInstaller.performInstallation(DownloadFromUrlInstaller.java:77)
at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:69)
at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:109)
at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:206)
at hudson.plugins.groovy.GroovyInstallation.forNode(GroovyInstallation.java:73)
at hudson.plugins.groovy.Groovy.buildCommandLine(Groovy.java:255)
at hudson.plugins.groovy.Groovy.perform(Groovy.java:79)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
at hudson.model.Build$BuildExecution.build(Build.java:197)
at hudson.model.Build$BuildExecution.doRun(Build.java:163)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:514)
at hudson.model.Run.execute(Run.java:1894)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:428)
Finished: FAILURE
REST API
Started hitting this yesterday too. We've also switched to Extract Zip/Tar installer. It's worth noting you probably have to specify the Subdirectory of extracted archive setting based on the root dir inside the zip. So for us we used:
https://groovy.jfrog.io/artifactory/dist-release-local/groovy-zips/apache-groovy-binary-2.4.9.zip
For the Download URL, and the following for the subdir:
groovy-2.4.9

Jenkins is unable to run arc

Here is a brief description of my current setup. We use
Git : revision control system
Phabricator : Code Review
Jenkins : for Continuous Integration and running builds.
Plugins : Phabricator differential, windows slaves plugin
Jenkins setup has a linux master , and windows & Mac Slaves. I also have Phabricator Differential enabled on the projects , and arcanist installed on all the Jenkins Nodes.
While Running Windows Projects,the build fails with the following error message that says it can not find arc in the specified folder.I m however able to run arc from the folder manually, I have made sure that the environment variables are set properly.Has anyone run into this issue before ?
`The system cannot find the file specified
FATAL: command execution failed
java.io.IOException: Cannot run program "sh" (in directory "C:\Users\Jenkins\workspace\windows_project"): CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at hudson.Proc$LocalProc.<init>(Proc.java:244)
at hudson.Proc$LocalProc.<init>(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:816)
at hudson.Launcher$ProcStarter.start(Launcher.java:382)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1149)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1114)
at hudson.remoting.UserRequest.perform(UserRequest.java:121)
at hudson.remoting.UserRequest.perform(UserRequest.java:49)
at hudson.remoting.Request$2.run(Request.java:325)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at hudson.remoting.Engine$1$1.run(Engine.java:69)
at java.lang.Thread.run(Thread.java:745)
at ......remote call to winbuild2(Native Method)
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1361)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)
at hudson.remoting.Channel.call(Channel.java:753)
at hudson.Launcher$RemoteLauncher.launch(Launcher.java:929)
at hudson.Launcher$ProcStarter.start(Launcher.java:382)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:97)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.Build$BuildExecution.build(Build.java:205)
at hudson.model.Build$BuildExecution.doRun(Build.java:162)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
at hudson.model.Run.execute(Run.java:1744)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:374)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
at java.lang.ProcessImpl.start(ProcessImpl.java:137)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
at hudson.Proc$LocalProc.<init>(Proc.java:244)
at hudson.Proc$LocalProc.<init>(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:816)
at hudson.Launcher$ProcStarter.start(Launcher.java:382)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1149)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1114)
at hudson.remoting.UserRequest.perform(UserRequest.java:121)
at hudson.remoting.UserRequest.perform(UserRequest.java:49)
at hudson.remoting.Request$2.run(Request.java:325)`
arc error message:
[windows_box_testing] $ arc call-conduit differential.querydiffs
The system cannot find the file specified
FATAL: Cannot run program "arc" (in directory "C:\Users\Jenkins\workspace\windows_box_testing"): CreateProcess error=2, The system cannot find the file specified
java.io.IOException: Cannot run program "arc" (in directory "C:\Users\Jenkins\workspace\windows_box_testing"): CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at hudson.Proc$LocalProc.<init>(Proc.java:244)
at hudson.Proc$LocalProc.<init>(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:816)
As mentioned by Anders, the log is indicating Cannot run program "sh". When you run arc on the box, are you running it from Windows Command Prompt or are you opening a linux-like shell.
For example, when I need to run arc commands on Windows, while logged in, I usually launch Git Bash, which does have a version of sh. However, to get that machine up and going as a build server with arc, I needed to install Cygwin and make Jenkins run the script in there.
I hope this helps.

After installation of github plugin into jenkins, restart not responding and showing errors

Even I remove the github plugin from jenkins not working. which is running under the tomcat7 server.
hudson.util.HudsonFailedToLoad: org.jvnet.hudson.reactor.ReactorException: java.io.IOException: Unable to read /usr/share/tomcat7/.jenkins/config.xml
at hudson.WebAppMain$3.run(WebAppMain.java:237)
Caused by: org.jvnet.hudson.reactor.ReactorException: java.io.IOException: Unable to read /usr/share/tomcat7/.jenkins/config.xml
at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:269)
at jenkins.InitReactorRunner.run(InitReactorRunner.java:44)
at jenkins.model.Jenkins.executeReactor(Jenkins.java:914)
at jenkins.model.Jenkins.<init>(Jenkins.java:813)
at hudson.model.Hudson.<init>(Hudson.java:83)
at hudson.model.Hudson.<init>(Hudson.java:79)
at hudson.WebAppMain$3.run(WebAppMain.java:225)
Caused by: java.io.IOException: Unable to read /usr/share/tomcat7/.jenkins/config.xml
at hudson.XmlFile.unmarshal(XmlFile.java:165)
at jenkins.model.Jenkins$16.run(Jenkins.java:2642)
at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
at jenkins.model.Jenkins$7.runTask(Jenkins.java:903)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
If you see a Java stack trace, you can usually find what the problem is by looking at the "Caused by:" line. Here is yours:
Caused by: org.jvnet.hudson.reactor.ReactorException: java.io.IOException: Unable to read /usr/share/tomcat7/.jenkins/config.xml
Jenkins is unable to read its configuration file. This could be due to one of:
The file doesn't exist
The file isn't readable by the user that runs the Jenkins process (note that it needs to be writable as well)
The JENKINS_HOME environment variable isn't set correctly for the user that runs the Jenkins process

Jenkins slave job fails after successful job

I have 2 jenkins servers because my 2 builds have some incompatible system requirements.
I setup a new node for one of the servers and migrated the jobs from the other server and set them up to run on the node.
The node runs the job just fine and even archives the artifacts (they are linked from the job) but the job throws and exception and gets marked as a failure.
** Below is the output from the jobs **
Completed build, now archiving <-- I print this out at the end of my last build step
FATAL: Remote call on ops-1-jenkins-android-10-186.fam.io failed
java.io.IOException: Remote call on ops-1-jenkins-android-10-186.fam.io failed
at hudson.remoting.Channel.call(Channel.java:748)
at hudson.Launcher$RemoteLauncher.kill(Launcher.java:940)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:556)
at hudson.model.Run.execute(Run.java:1745)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class hudson.slaves.SlaveComputer
at hudson.util.ProcessTree.getKillers(ProcessTree.java:151)
at hudson.util.ProcessTree$OSProcess.killByKiller(ProcessTree.java:212)
at hudson.util.ProcessTree$UnixProcess.kill(ProcessTree.java:557)
at hudson.util.ProcessTree$UnixProcess.killRecursively(ProcessTree.java:564)
at hudson.util.ProcessTree$Unix.killAll(ProcessTree.java:488)
at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:952)
at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:943)
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$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at hudson.remoting.Engine$1$1.run(Engine.java:63)
at java.lang.Thread.run(Thread.java:701)
Thanks Lovato!
After I updated all the plugins and jenkins things worked just fine.
We got this error: FATAL: java.io.IOException: Remote call on pm_jenprodslave_1 failed. We found the slave server was unresponsive and had to reboot it. Once it came back the build works again.

Mounting the DEV#cloud Private WebDav Repository fails

I'm using the private repository to store my own custom settings.xml. When i try to use it i get the following log message:
$ /usr/bin/tenant-isolate sudo /opt/jenkins/sbin/mount-webdav https://repository-laures.forge.cloudbees.com/private laures alert
mountpoint: /private/laures: No such file or directory
when my buildjob later wants to access my custom settings.xml i get an exception:
Executing Maven: -B -f /scratch/jenkins/workspace/JacksonLegacyIntrospector/pom.xml -gs /private/laures/settings.xml clean verify site emma:emma
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:100)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:66)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.apache.maven.cli.MavenExecutionRequestsBuilderException: The specified global settings file does not exist: /private/laures/settings.xml
at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.getMavenExecutionRequest(DefaultMavenExecutionRequestBuilder.java:148)
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.getMavenExecutionRequest(Maven3Launcher.java:94)
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:77)
... 18 more
Caused by: java.io.FileNotFoundException: The specified global settings file does not exist: /private/laures/settings.xml
at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.settings(DefaultMavenExecutionRequestBuilder.java:414)
at org.apache.maven.cli.DefaultMavenExecutionRequestBuilder.getMavenExecutionRequest(DefaultMavenExecutionRequestBuilder.java:126)
... 20 more
I was following the cloudbees guide: https://developer.cloudbees.com/bin/view/DEV/Sharing+Files+with+Build+Executors
Did i do something wrong?
This job is validating pull-requests. A malicious user could hack your build script in a pull request and extract confidential informations from your account.
To prevent this, CloudBees run such a build using tenant-isolate script. This prevent /private to get mounted, this is intentional - but not nicely reported on the web UI.

Resources