Jenkins Server Suddenly Fails. Cannot reach GUI - jenkins

I setup a Jenkins server on a redhat linux VM a while back to run our unit and integration tests. It has worked without much trouble for about two months, but now I suddenly can no longer browse to the GUI/HUB. I don't believe I have changed anything (I know everyone says that :) ) however when I look at the logs I get the following errors
WARNING: Untrapped servlet exception
winstone.ClientSocketException: Failed to write to client
at winstone.ClientOutputStream.write(ClientOutputStream.java:41)
The Jenkins service is running, I have restarted it and the VM with no resolution to this issue. Even the jenkins jobs that I have written are still running as far as I can tell providing emails every now and again, but I cannot browse to the GUI. Anyone run into something like this before. I've searched for this issue and some people have been suggesting to re-install jenkins, but I am not trying to do that!

alright a long time later I finally figured it out. Turns out winstone was not the issue, but rather file permissions were to blame. Some of the files in my jenkins folder /var/lib/jenkins/ had root as their owner rather than jenkins. There were some in .m2 some in .grails and just scattered all about, not sure how this happened.
Anyway I just navigated to the home dir of jenkins /var/lib/jenkins and ran the following command
chown -R jenkins:jenkins jenkins

Related

Failed to start Jenkins - Verify that you have sufficient privileges to start system services

I installed Jenkins previously but it had some issue (there was no start icon) in the folder, so I uninstalled it. Now I'm trying to install it again, but it tends to pop this error:
I tried all the solutions mentioned in this post , but no success - Jenkins failed to start - Verify that you have sufficient privileges to start system services
As mentioned in the option 2 of the post, I tried to start jenkins in services but got a 1067 error
I read a lot of similar posts, but none of them really helped. I believe my user has enough privileges to work without causing any trouble, so the underlying problem is something else. Please help me figure out the issue.
I found the solution!
Turns out Jenkins doesn't work on other JDKs except for 8,11. And I have the 14th version. I'm putting the link to the answer that helped me change the JDK version.
Jenkins requires Java versions [8, 11] but you are running with Java 16 from C:\Program Files\Java\jdk-16.0.1

Jenkins- Getting stuck on install initial plugin page

I have newly configured Jenkins, after setting up the proxy it asks to install plugins, i selected few plugins and after proceeding to install them some of them failed and the install bar completes for other plugins but the page hangs forever and i am not able to proceed further.
Please suggest !
restart jenkins using "http://localhost:8080/safeRestart"
It worked for me.
There's a bug report that pretty well fits to the description of your problem: Jenkins- Getting stuck on install initial plugin page. That bug should have been fixed in June (and Jenkins 2.6).
I had the same problem with Jenkis 2.7.3, though. To get the install running, I first removed the installation and started it again. Then I deselected the plugins which have caused the errors and could successfully finish the "getting started" process.
Once you have Jenkins running in normal mode you should be able to install the skipped plugins (didn't try that, though; don't need them).
A simple Page refresh did NOT help me.
I just restarted webapp service, TOMCAT in my case and then a page refresh allowed me to skip and continue to proceed further.
Try this it may help you.
go to this link - http://localhost:8080/safeRestart
go to the Dashboard -> Manage Plugins -> Available tab
Select all plugins and start installing
Jenkins will work after reboot
I had the same bug with Jenkins 2.19.3 on Windows. Resolved by reinstalling Jenkins with full Jenkins directory removal.
Okay let me share my success case of this stupid error.
I was using google chrome and i tried everything, uninstall jenkins complete from the face of my HDD, and reinstalling but non work.
Then i took petty on IE (or on myself for that matter) and i ran the jenkins (localhost:8080) on IE and voila! everything works perfectly.
Hope this help anybody.
well, I am running Jenkins on my remote machine after all the configuration and installing the required plugins the web client dint respond I tried to start it but with no gain.
After digging deeper all I had to do was to restart the Jenkins service and it picks up from where it left.
The reason might be during the installation of the plugins the server is stopped and the additional files are added so during the downtime the Jenkins becomes unresponsive.
hopes this helps.
sudo service restart jenkins
Then go back to refresh the browser.
I faced similar issue and did :
$ systemctl restart jenkins
and re-resumed and later continued and installation completed.
post that setup the first admin user and proceeding next.
Trying "Jenkins 2.277.4" at my local dev box

Jenkins won't start after plugin installation *and does not log anything*

I installed Jenkins' Gradle plugin and used the automatic restart option via the Jenkins web interface. Jenkins seemed to hang on the "restarting..." page, so I finally tried to manually restart the Jenkins service on the server (64-bit Debian 7) using service jenkins restart.
Now, Jenkins is no longer running at all (verified with ps -ef | grep -i [J]enkins and service jenkins status), and when I try service jenkins [re]start, I see an [ ok ] message but nothing else seems to happen. I've deleted /var/log/jenkins/jenkins.log, and each time I try a service start (or restart), the log file reappears, but it's blank (ls -lA shows that the file was recently made, but cat produces no output). I also tried rebooting the server, with no effect. I finally deleted the Gradle folders under /var/lib/jenkins/plugins, which also did not appear to make a difference.
How do I even begin to approach this problem? Should I just re-install Jenkins?
EDIT: System info:
> uname -a
Linux AUC-Workstation1 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u1 x86_64 GNU/Linux
According to dpkg -l, I'm using Debian's jenkins package, version 1.617.
EDIT 2: I'm actually using the jenkins package provided directly by Jenkins, as per the instructions here.
I just had a problem where multiple Jenkins plugins were breaking Jenkins startup (after an upgrade) and here is the procedure I followed to resolve the issue, which might work for other plugin startup issues.
I'm working on an Ubuntu server, but I expect that this would work for Debian if it's going to work at all - I encourage others to adjust the procedure:
logged into the server and switched to the jenkins user (sudo su jenkins in my case)
went to the main jenkins directory
renamed plugins to plugins.problems_YYYYMMDD
previously, I attempted to disable the plugins, but this did not work for me (system still would not start)
created an empty directory plugins
restarted jenkins (sudo service jenkins restart)
In my case, this started just fine
iteratively followed the following procedure to add plugins back in
copied 1 or more plugins from plugins.problems_YYYYMMDD/ to plugins/
restarted jenkins
went to the plugin center and installed updates as available
sometimes I needed to install updates in a particular order due to dependencies
evaluated results in 'Manage Old Data'
I think I'm facing some manual updates of the old data
Note: if you know which plugins are likely the problem, then it is easier to just disable or temporarily (re)move them rather than (re)moving all of the plugins!
I never did figure out the initial problem, but I did get Jenkins working again, sort of.
I uninstalled Jenkins (using apt-get purge) and then re-installed it. This time it failed to start because it needed Java 7, but I apparently only had Java 6 installed (this surprised me, because I thought I had previously configured Jenkins to use Java 7 on that machine). So I installed openjdk-7-jdk and openjdk-7-jre, set JAVA and JAVA_HOME appropriately in the Jenkins config file, and started the service again. This allowed Jenkins to start.

jenkins URL with computer name does not open page

I know this question is asked before but I could not find any right solution for that
I have install jenkins on my windows 7 as windows service, it works fine with default URL localhost:8080, but when I set //mycomputerName:8080 in configuration system- jenkins location and then save it and restarted jenkins and enter //mycomputerName:8080 in browser address jenking will not open. I have done the same installation on my laptop windows 7 without any problem, but on my desktop I have installed, uninstalled several times with the same problem.
I just want to give my solution
Go to Jenkins Home Directory ( I have mine in C:\Jenkins)
Edit jenkins.xml
Add this --prefix=/jenkins to the end of the argument as show below and restart the jenkins service ALL worked OK for me !
Example :
<arguments>-Xrs-Xmx256mDhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080 --prefix=/jenkins</arguments>
Open Url http://localhost:8080/jenkins this should bring up the home page of jenkins
As I said in my question above many people have asked this question and had the same problem but all answer have been something from jenkins documentation and actually not solution.
so finally I found the problem and write it here probably for some people with the same problem
first I uninstalled jenkins removed all files, folder and everything related to jenking also from windows registry and installed jenking but did not work.
reinstalled windows (upgrade) and installed jenking again but did not work.
next I clean reinstalled windows and installed jenkins and in this case jenkins works as I expected but I do not know what was wrong with the windows.
Add to Vamshi's answer. Instead of the config in the
C:\Users\XXXX\AppData\Local\Jenkins\.jenkins\config.xml (you won't find <argument> in this file)
add the --prefix=\jenkins to the <argument> in jenkins.xml
C:\Program Files\Jenkins and restart the service.

please wait while jenkins is restarting- waiting long

I updated some plugins and restarted the jenkins but now it says:
Please wait while Jenkins is restarting
Your browser will reload automatically when Jenkins is ready.
It is taking too much time (waiting from last 40 minutes). I have only 1 project with around 20 builds. I have restarted jenkins many times and worked fine but now it stucks.
Is there any way out to kill/suspend jenkins to avoid this wait?
I had a very similar issue when using jenkins build-in restart function. To fix it I killed the service (with crossed fingers), but somehow it kept serving the "Please wait" page. I guess it is served by a separate thread, but since i could not see any running java or jenkins processes i restarted the server to stop it.
After reboot jenkins worked but it was not updated. To make it work it I ran the update again and restarted the jenkins service manually - it took less than a minute and worked just fine...
Jenkins seems to have a number of bugs related to restarting, and at least one unresolved: jenkins issue
Windows ONLY....
All the solutions here didn't work and restarting the server was not an option. If you are in the same situation.
I had to kill java.exe and restart the jenkins service. After I did this Jenkins reloaded several times and then went back to normal.
I was stuck on the jenkins restarting page for 10-ish minutes untill I did this.
Hope this helps.
Running this in the command line helped me:
service jenkins restart
I had a similar issue when updating plugins from the pluging update page and I marked the restart jenkins options. jenkins only showed the waiting message for a long time.
I solved the issue restoring .bak to .jpi files of the the plugins that I tried to update.
I did the follow in my jenkins
cd $JENKINS_HOME/plugins/
>sudo mv git.bak git.jpi
.
. (more plugins files)
.
>sudo mv ldap.bak ldap.jpi
>sudo /sbin/service jenkins restart
Check Event Viewer.
I found that my Java died.
Faulting application java.exe, version 7.0.250.17, time stamp 0x51c4b3fd, faulting module ntdll.dll, version 6.0.6002.18541, time stamp 0x4ec3e39f, exception code 0xc0000374, fault offset 0x000abc4f, process id 0x1188, application start time 0x01cee4f42968bc81.
Finally I found that it's Jenkins 1.540 problem. Don't use it.
https://issues.jenkins-ci.org/browse/JENKINS-20630
I faced the same issue after upgrading some plugins on Windows. Looking on jenkins.err.log it displayed this error
Exception in thread "main" java.io.IOException: Jenkins has failed to create a temporary file in C:\Users\builder\AppData\Local\Temp\
at Main.extractFromJar(Main.java:350)
at Main._main(Main.java:194)
at Main.main(Main.java:91)
Caused by: java.io.IOException: There is not enough space on the disk
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createTempFile(Unknown Source)
at Main.extractFromJar(Main.java:347)
... 2 more
The problem was that the TEMP folder of the jenkins user had lots of temporary files. After cleaning that folder jenkins restarted correctly.
just performed a restart on the server. That fixed the issue !
In Command prompt execute this
C:\>service jenkins restart
Or
You can go for Service currently running in your machine( Win + R ) seach for Jenkins and Click on restart
For me, the cause seemed to be having lots of old job build logs hanging around. To clean them up, I ran:
cd $JENKINS_HOME/jobs
find -name 'builds' | xargs -n 1 bash -c 'rm -rf $0/[1-9]*'
Then I stopped and started Jenkins again, and it came up within a minute.
Credit to: https://stackoverflow.com/a/39230597/2255242
This is an old thread.. but my personal recommendation is to WAIT before attempting to do anything (such as restarting service, etc).
I wasted hours once trying to fix something that turned out to be not an issue in the first place. In the end, I messed things up and wasted a lot of time.
Just because you see errors in the logs doesn't necessarily mean that you need to take action.
The upgrade took about 45 minutes in the end for me. All i did at one point was refreshing my browser window. It can take a while.
Just my opinion
On Win 10: Stopping with the service command from the command line reported failure to stop the service, but I was able to stop it from services.msc (running as administrator). The updates were applied. Sorry, no definitive answer from me. YMMV.
I used TCPView and killed process that was using port 8080. BAsically it was all Java.exe from Jenkins. Killed all processes and restarted Jenkins Service
try to restart that inside windows services console, it will work
I have observed the same issue after installing a plugin and opting to restart the jenkins when no jobs are running.
When I looked at the jenkins server process, it was running fine and no issues.
On restarting the jenkins service using the below command and reloading the browser, Jenkins was up.
sudo service jenkins restart
If Jenkins is taking an unusually long time to restart the best recourse is to check the generated logs to see what may be wrong. However, even that may be of little help because many plugins try to be "quiet" by default, even if they are furiously working to load content. So if all else fails, you may have to resort to manually disabling plugins.
However here is a free tip: Some plugins are known to be messy. For example the Job Config History plugin we observed to write hundreds of thousands of records for both job configuration changes AND agent changes. Removing this plugin, and deleting the configHistory folder fixed one problem where our startup literally took > 4 hours.
In our case, the problem was we were launching ephemeral agents (via docker and/or kubernetes). Each new "agent" was treated as a configuration change. With thousands of agents per day, it didn't take long to fill up a substantial part of the disk with history that never was effectively cleared.
There are other plugins that leak data in this way. And you can also create self-inflicted wounds, e.g. by using a standalone process to remove "obsolete" files. An example where we were "bitten" is a process that tried to discard old build records, but did an incomplete job - and was "warring" with the running Jenkins process. Jenkins will try breaking its neck to load a build.xml record that is empty or incomplete.
Three more tips:
You can install the monitoring plugin. Often when the jenkins UI proper didn't start, we were able to see the /monitoring in action.
Likewise, /userContent can often be loaded even when the rest of the UI is not fully up.
Don't rule out bad actors. It just takes one aggressive script that tries, e.g. to load the entire build history and ship it back via a REST call to effectively deny service to all other UI users.
I try to fix a file named hudson.model.UpdateCenter.xml located /var/lib/jenkins
I change the URL to https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json
Finally, restart Jenkins. it solves my problem

Resources