I have recently upgraded Jenkins from 2.164.0 to 11.0.16 version and Java open Jdk 11.0.16
But facing issue when restarting, can you help us to find the cause and fix it.
It seems this topic has come up quite often recently, both here, google groups, gitter, and S/O.
Thinking out loud (as I don’t have it installed via package), is there a way Jenkins can know it has been installed via package manager, then based on that either disable the upgrade automatically button and/or throw up a warning, “It appears Jenkins was installed via a package manager. We recommend you update via the package manager rather than the UI or direct war replacement.” ?
In a perfect world, clicking upgrade in the UI would trigger the package manager to perform a package update and restart the service, but that is probably impractical, unrealistic and potentially consequential.
At least throwing up warning, guiding them to the best practice, or disabling, plus guidance could go a long way to reducing the support load.
I’m sure it’s doable with effort. You could query apt or rpm databases on startup and write a monitor. But it’s kinda too late for that. You want to display the warning before they do the upgrade, but you need the upgrade to get the warning. Potentially could check to see if the version running is the same as the package installed and spit out something to the startup log. I’m not sure anyone would want to spend the dev effort though. People tend to spend effort in areas that affect them
I’m pretty sure the problem isn’t people clicking upgrade in the UI. I’m pretty sure that’s only available if you can overwrite the war file, and I think the default packages all run as non root.
The problem so far is that people manually download new versions using curl/wget and override the war. We even had people doing this inside of docker images.
I’m not sure where these suggestions are coming from, but I should guess probably back in the days when releases were really unstable.
That message says that you are running a new Jenkins war file but using the service management system that was provided by an old Jenkins RPM installer. That usually means the upgrade was performed incorrectly.
When Jenkins is installed with rpm (or apt), it needs to be upgraded with rpm (or apt). Do not upgrade Jenkins by replacing the war file. That bypasses the rpm (or apt) upgrade process.
# yum upgrade jenkins
Details are included in the answer that was linked earlier in this thread