A bit of history on how I encountered this problem. I had a CICD server running Jenkins for my Symfony projects on a Ubuntu 18.04 VPS. I had Composer v1.0 running and there were several messages every time I ran a command to upgrade to Composer v2.0. So I ran a composer self update
$ composer self-update 2.5.5
I had PHP version 7.4.15 running on the VPS and Composer v2.0 required PHP 8 so I had to update PHP from the ondrej repositories. At this time I realised that Ubuntu 18.04 Bionic Beaver had reached end of life in May 2023 and the only was to upgrade my distribution. I had some initial hiccups with upgrading Chrome, Docker and Jenkins. With some googling I managed to upgrade Chrome and Docker. For Jenkins I had to use the new repository sigining keys.
After I upgraded the distribution to Ubuntu 20.04 I noticed that Jenkins failed to start. Do I did a
$sudo journalctl -u jenkins.service
and the log had the following entries
Running with Java 8 from /usr/lib/jvm/java-8-openjdk-amd64/jre, which is older than minimum required version (Java 11)
Supported Java versions are : [11, 17,21]
So I installed a newer version of Java
$sudo update-java-alternatives --set java-17-openjdk-amd64
I restarted Jenkins and this time I found the following entries in the log
Dec 26 16:50:04 ub-s-2vcpu-4gb-blr1-01-02 jenkins[823753]: 2023-12-26 11:20:04.319+0000 [id=30] INFO hudson.PluginManager#loadDetachedPlugins: Upgrading Jenkins. The last running version was 2.235.
2. This Jenkins is version 2.426.2.
Dec 26 16:50:04 ub-s-2vcpu-4gb-blr1-01-02 jenkins[823753]: 2023-12-26 11:20:04.397+0000 [id=30] INFO hudson.PluginManager#loadDetachedPlugins: Upgraded Jenkins from version 2.235.2 to version 2.426
.2. Loaded detached plugins (and dependencies): []
Dec 26 16:50:04 ub-s-2vcpu-4gb-blr1-01-02 jenkins[823753]: 2023-12-26 11:20:04.634+0000 [id=31] INFO jenkins.InitReactorRunner$1#onAttained: Started initialization
Dec 26 16:50:04 ub-s-2vcpu-4gb-blr1-01-02 jenkins[823753]: 2023-12-26 11:20:04.768+0000 [id=31] SEVERE hudson.PluginManager$1$3$2$1#reactOnCycle: found cycle in plugin dependencies: (root=Plugin:ss
hd, deactivating all involved) Plugin:sshd -> Plugin:mina-sshd-api-core -> Plugin:ssh-credentials -> Plugin:credentials -> Plugin:sshd
Dec 26 16:50:04 ub-s-2vcpu-4gb-blr1-01-02 jenkins[823753]: 2023-12-26 11:20:04.777+0000 [id=31] SEVERE hudson.PluginManager$1$3$2$1#reactOnCycle: found cycle in plugin dependencies: (root=Plugin:ss
hd, deactivating all involved) Plugin:sshd -> Plugin:mina-sshd-api-core -> Plugin:ssh-credentials -> Plugin:credentials -> Plugin:sshd
There was a dependency on the apache mina ssd plugin. With some googling I found that there was an issue with the current version of the mina plugin and the only way is to install the working versions as per the following posts
- Jenkins reports a cycle dependcy error with plugins after restart and will not start now
- Mina ssh plugin 2.8.0-30.vf9df64641cb_d has a cyclic dependency, breaks Jenkins plugin loading
I am unable to access the jenkins CLI to downgrade the plugins. So I deleted the current version of the plugins and the directory located at /var/lib/jenkins/plugins/ and downloaded the older versions and copied them to the plugins directory. I renamed the .hpi files to .jpi and restarted jenkins. This time I get the following message in the logs
Dec 26 17:20:14 ub-s-2vcpu-4gb-blr1-01-02 jenkins[826241]: 2023-12-26 11:50:14.271+0000 [id=30] SEVERE jenkins.InitReactorRunner$1#onTaskFailed: Failed Loading plugin SSH server v3.303.vefc7119b_ec
23 (sshd)
Dec 26 17:20:14 ub-s-2vcpu-4gb-blr1-01-02 jenkins[826241]: java.io.IOException: Failed to load: SSH server (sshd 3.303.vefc7119b_ec23)
Dec 26 17:20:14 ub-s-2vcpu-4gb-blr1-01-02 jenkins[826241]: - Update required: Mina SSHD API :: Common (mina-sshd-api-common 2.8.0-21.v493b_6b_db_22c6) to be updated to 2.10.0-69.v28e3e36d18eb_ or higher
Dec 26 17:20:14 ub-s-2vcpu-4gb-blr1-01-02 jenkins[826241]: - Update required: Mina SSHD API :: Core (mina-sshd-api-core 2.8.0-21.v493b_6b_db_22c6) to be updated to 2.10.0-69.v28e3e36d18eb_ or higher
If I switch back to mina-sshd-common and core to 2.10.. I get the cyclic plugin dependency error if I downgrade to 2.8 it looks for 2.10.. Looks like I have reached a dead end. Is there a way to resolve this and get Jenkins up and running?
Resolved this and got jenkins to startup. Apparently I figured out by trial and error that we should upgrade the plugins when Jenkins is upgraded to a newer version.I had upgraded my version to 2.426.2 but had done nothing to the plugins. They were all from the old installation. So Jenkins wasn't even allowing access to the Pluig-in manager. Manually removing and upgraading each plugin is quite cumbersome. So I downloaded the Jenkinsci Plugin Installation Manager Tool to my home directory.
I then listed the current version of all the plugins using this tool by running the following command from my HOME directory $ sudo java -jar jenkins-plugin-manager-2.12.14.jar --war /usr/share/java/jenkins.war --plugin-download-directory /var/lib/jenkins/plugins/ --plugin-file /var/lib/jenkins/plugins.txt --list >> InstalledPlugins.txt
So the InstalledPlugins.txt is written to the HOME directory. The contents of my InstalledPlugins.txt is as follows. (Yours could be different based on the plugins you've installed)
Make a copy of this file
Edit the plugins.txt and replace all version numbers with "latest" as follows
This means we want the Plugin Installation Manager Tool to install the latest versions for each of these plugins. Copy this file to the Jenkins director
Now use the Plugin Installation Manager Tool to upgrade the plugins as per the plugins.txt
This will install the latest version of plugins. In my case some of the plugins threw 404 errors as they were eithier depreciated or no longer maintained. Once the upgrade is complete start jenkins
Vist the URL and you will see the new version of Jenkins. In my case this is the version that showed up.