1
votes

I upgraded Jenkins to 2.32.3 version (in place upgrade) after taking necessary backups (THIN) or $JENKINS_HOME and Jenkins is now UP and running.

Under Manage Jenkins > Manage Plugins, I see the following RED error:

Manage Jenkins

Correct
There are dependency errors loading some plugins:
Environment Injector Plugin v2.1.3
envinject-api v1.2 is missing. To fix, install v1.2 or later.

While trying to install Environment Inject Plugin 2.1.3, the logs (during download/install) shows the same error:

Installing Plugins/Upgrades

Preparation 
Checking update center connectivity
Success
Environment Injector Plugin 
 Failure -
java.io.IOException: Failed to dynamically deploy this plugin
    at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1895)
    at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1652)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:110)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Failed to install envinject plugin
    at hudson.PluginManager.dynamicLoad(PluginManager.java:873)
    at hudson.PluginManager.dynamicLoad(PluginManager.java:813)
    at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1891)
    ... 5 more
Caused by: java.io.IOException: Environment Injector Plugin v2.1.3 failed to load.
 - envinject-api v1.2 is missing. To fix, install v1.2 or later.
    at hudson.PluginWrapper.resolvePluginDependencies(PluginWrapper.java:621)
    at hudson.PluginManager.dynamicLoad(PluginManager.java:863)
    ... 7 more

Where can I get this envinject-api 1.2 plugin? Should I go grab the Github project (clone it) and build the Maven project and put the hpi file under $JENKINS_HOME/plugins folder?

Under Available plugins tab, I don't see an option to select a given version (only 2.1.3 is available). I don't see envinject-api 1.2 plugin listed there either that I can select. My understanding it, selecting Environment Inject 2.1.3 should auto grab all of its dependent plugins for free per it's MANIFEST file.

$ cat $JENKINS_HOME/plugins/envinject/META-INF/MANIFEST.MF
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: nenashev
Build-Jdk: 1.8.0_121
Extension-Name: envinject
Specification-Title: The Jenkins Plugins Parent POM Project
Implementation-Title: envinject
Implementation-Version: 2.1.3
Plugin-Class: org.jenkinsci.plugins.envinject.EnvInjectPlugin
Group-Id: org.jenkins-ci.plugins
Short-Name: envinject
Long-Name: Environment Injector Plugin
Url: https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin
Compatible-Since-Version: 2.0
Plugin-Version: 2.1.3
Hudson-Version: 1.625.3
Jenkins-Version: 1.625.3
Plugin-Dependencies: envinject-api:1.2,ivy:1.21;resolution:=optional,m
 atrix-project:1.7,script-security:1.22
Plugin-Developers: Gregory Boissinot:gbois:[email protected]
 ,Oleg Nenashev:oleg_nenashev:[email protected],Manuel Recena:rec
 ena:[email protected]
1
Trying to get wget https://updates.jenkins-ci.org/download/plugins/envinject-api/1.2/envinject-api.hpi may be putting that with the jpi/hpi (for version 2.1.3 of env injector) will help in the plugins folder. Still Poking ...AKS
After placing the envinject-api.hpi file in plugins folder, did you restarted the JenkinsSuresh
Yea, it's solved. Kind of annoying though why the heck Jenkins didn't do the shit. Other issue is, now even though the main RED errors on the main Manage Jenkins > Manage Plugins page are gone, I still see "Updates available" for couple of plugins like: Git plugin, Subversion plug-in. I tried to upgrade those, and it gave me 3 more such dependency issues. To fix the new ones, I had to revert these plugins back to an older version.AKS
AFAIK when we are doing through the GUI while upgrading or installing plugins, resolving dependencies is taken care by Plugin Manager.Suresh
Yes, that's my understanding as well but if proxy / network access is not correctly set, may be it'll not properly download the dependent libs and during tail -f /var/log/jenkins/jenkins.log you'll see bunch of lines showing that missing x lib for installing Y plugin properly.AKS

1 Answers

2
votes

For some reason Jenkins plugins (didn't download the dependent plugins per the Manifest file).

As envinject-api plugin was not listed in the AVAILABLE plugin tab (under Manage Jenkins > Manage Plugins section), I had to manually download the .hpi / .jpi file directly from the following download plugins URL and then I placed the file in $JENKINS_HOME/plugins folder.

https://updates.jenkins-ci.org/download/plugins/

wget https://updates.jenkins-ci.org/download/plugins/envinject-api/1.2/envinject-api.hpi

Restarted Jenkins sudo service jenkins restart (or any other way you have setup) and this issue went away from both Jenkins GUI and from tail -f /var/log/jenkins/jenkins.log

PS: Don't just randomly select a latest version of any plugin or it's dependent plugin. It may not work and break more other plugins as it depends upon your current Jenkins version.

Found this link for Juseppe, not sure how relevant is this but seems interesting: https://github.com/yandex-qatools/juseppe