1

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:gregory.boissinot@gmail.com
 ,Oleg Nenashev:oleg_nenashev:o.v.nenashev@gmail.com,Manuel Recena:rec
 ena:recena@gmail.com
4

1 回答 1

2

出于某种原因,Jenkins 插件(没有根据 Manifest 文件下载依赖插件)。

由于 envinject-api 插件未在 AVAILABLE 插件选项卡中列出(在Manage Jenkins > Manage Plugins部分下),我必须直接从以下下载插件URL 手动下载 .hpi / .jpi 文件,然后将文件放在 $ JENKINS_HOME/plugins 文件夹。

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

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

重新启动 Jenkins sudo service jenkins restart(或您设置的任何其他方式)并且此问题从 Jenkins GUI 和tail -f /var/log/jenkins/jenkins.log

PS:不要只是随机选择任何插件的最新版本或其依赖插件。它可能无法工作并破坏更多其他插件,因为它取决于您当前的 Jenkins 版本。

找到了 Juseppe 的链接,不确定这有多相关,但看起来很有趣:https ://github.com/yandex-qatools/juseppe

于 2017-07-31T08:36:21.060 回答