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

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

Related

Jenkins - Upgrade to Version 2.346.1 from 2.319.1 - Fails to start due to use of ${ITEM_FULLNAME} variable on Windows

After upgrading Jenkins from 2.319 to 2.346, Jenkins fails to start with following error:
java.nio.file.InvalidPathException: Illegal char <:> at index 87: C:\Users\$DEVTO~1\AppData\Local\Temp\Jenkins-doCheckRawBuildsDir18416011757244540585foo:bar
at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:229)
at java.base/java.io.File.toPath(File.java:2290)
at jenkins.model.Jenkins.checkRawBuildsDir(Jenkins.java:3364)
Caused: jenkins.model.InvalidBuildsDir: D:\JenkinsData\jobs\${ITEM_FULLNAME}\builds contains ${ITEM_FULLNAME} but your system does not support it (JENKINS-12251). Use ${ITEM_FULL_NAME} instead
at jenkins.model.Jenkins.checkRawBuildsDir(Jenkins.java:3366)
at jenkins.model.Jenkins.loadConfig(Jenkins.java:3300)
Caused: java.io.IOException
at jenkins.model.Jenkins.loadConfig(Jenkins.java:3303)
at jenkins.model.Jenkins.access$1200(Jenkins.java:340)
at jenkins.model.Jenkins$12.run(Jenkins.java:3398)
at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:175)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:305)
at jenkins.model.Jenkins$5.runTask(Jenkins.java:1158)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:222)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:121)
at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused: org.jvnet.hudson.reactor.ReactorException
at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:291)
at jenkins.InitReactorRunner.run(InitReactorRunner.java:49)
at jenkins.model.Jenkins.executeReactor(Jenkins.java:1193)
at jenkins.model.Jenkins.<init>(Jenkins.java:983)
at hudson.model.Hudson.<init>(Hudson.java:86)
at hudson.model.Hudson.<init>(Hudson.java:82)
at hudson.WebAppMain$3.run(WebAppMain.java:247)
Caused: hudson.util.HudsonFailedToLoad
at hudson.WebAppMain$3.run(WebAppMain.java:264)
Previous upgrade was done without any issue.
I did not find any references in release note about these variables. Also in upgrade guides, no references found about changes related to these variables.
After investigation and checking into the Jenkins code, I found the reason.
in config.xml file I had to change 2 tag's values:
<workspaceDir>D:\JenkinsData\Workspaces\${ITEM_FULLNAME}</workspaceDir>
<buildsDir>D:\JenkinsData\jobs\${ITEM_FULLNAME}\builds</buildsDir>
by
<workspaceDir>D:\JenkinsData\Workspaces\${ITEM_FULL_NAME}</workspaceDir>
<buildsDir>D:\JenkinsData\jobs\${ITEM_FULL_NAME}\builds</buildsDir>
After this change Jenkins starts without issue.

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 error Unable to produce a script file

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/ .

Jenkins throws NullPointerException after upgrading Splunk plugin

I got tired of the security prompt at the top of the Jenkins window telling me to upgrade my plugins, so I upgraded those plugins. When I rebooted, the familiar Jenkins landing page was replaced with the following stack trace:
java.lang.NullPointerException
at com.splunk.splunkjenkins.utils.SplunkLogService.enqueue(SplunkLogService.java:174)
at com.splunk.splunkjenkins.utils.SplunkLogService.send(SplunkLogService.java:170)
at com.splunk.splunkjenkins.utils.SplunkLogService.send(SplunkLogService.java:107)
at com.splunk.splunkjenkins.JdkSplunkLogHandler.publish(JdkSplunkLogHandler.java:43)
at java.util.logging.Logger.log(Logger.java:616)
at java.util.logging.Logger.doLog(Logger.java:641)
at java.util.logging.Logger.log(Logger.java:664)
at java.util.logging.Logger.info(Logger.java:1182)
at com.splunk.splunkjenkins.LoggingInitStep.setupSplunkJenkins(LoggingInitStep.java:22)
Caused: 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 hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104)
Caused: java.lang.Error
at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:110)
at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
at jenkins.model.Jenkins$7.runTask(Jenkins.java:1089)
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)
Caused: org.jvnet.hudson.reactor.ReactorException
at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:269)
at jenkins.InitReactorRunner.run(InitReactorRunner.java:47)
at jenkins.model.Jenkins.executeReactor(Jenkins.java:1113)
at jenkins.model.Jenkins.<init>(Jenkins.java:929)
at hudson.model.Hudson.<init>(Hudson.java:86)
at hudson.model.Hudson.<init>(Hudson.java:82)
at hudson.WebAppMain$3.run(WebAppMain.java:231)
Caused: hudson.util.HudsonFailedToLoad
at hudson.WebAppMain$3.run(WebAppMain.java:248)
Is there any way to recover from this aside from restoring a backup? I don't presently have shell access to the system, so please keep that in mind for your answers.
Jenkins version: 2.46.2
Splunk plugin version: 1.3.1
I was able to get SSH access to the system and did the following to solve my problem. Solution taken from the Removing and Disabling Plugins wiki page.
touch /var/lib/jenkins/plugins/splunk-devops.jpi.disabled
touch /var/lib/jenkins/plugins/splunk-devops-extend.jpi.disabled
Then, I rebooted. From the documentation, I assume that this is possible with any plugin.

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