Jenkins从1.6xx升级到2.xx(1.642.3 - > 2.32.2)

时间:2017-07-31 07:24:34

标签: jenkins download jenkins-plugins missing-data jenkins-2

我在进行必要的备份(THIN)或$ JENKINS_HOME之后将Jenkins升级到2.32.3版本(就地升级),Jenkins现在已经启动并运行。

管理Jenkins>管理插件,我看到以下RED错误:

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.

尝试安装Environment Inject Plugin 2.1.3时,日志(在下载/安装期间)显示相同的错误:

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

我在哪里可以获得这个envinject-api 1.2插件?我应该去抓Github项目(克隆它)并构建Maven项目并将hpi文件放在$ JENKINS_HOME / plugins文件夹下吗?

在“可用插件”选项卡下,我看不到选择给定版本的选项(只有2.1.3可用)。我没有看到那里列出的envinject-api 1.2插件,我可以选择。我理解它,选择Environment Inject 2.1.3应该根据它的MANIFEST文件自动获取所有相关插件。

$ 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

1 个答案:

答案 0 :(得分:1)

出于某种原因Jenkins插件(没有按照Manifest文件下载相关插件)。

由于envinject-api插件未在AVAILABLE插件标签中列出(在管理Jenkins>管理插件部分下),我不得不直接从以下手动下载.hpi / .jpi文件下载插件 URL然后我将文件放在$ 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