Jenkins循环插件依赖mina-sshd-api-common和mina-sshd-api-core

apeeds0o  于 10个月前  发布在  Jenkins
关注(0)|答案(1)|浏览(286)

关于我如何遇到这个问题的一些历史。我有一个CICD服务器在Ubuntu 18.04 VPS上运行Jenkins用于我的Symfony项目。我运行Composer v1.0,每次我运行命令升级到Composer v2.0时都会有几条消息。所以我运行了一个Composer自我更新

$ composer self-update 2.5.5

字符串
我在VPS上运行PHP 7.4.15版本,Composer v2.0需要PHP 8,所以我不得不从ondrej存储库更新PHP。此时我意识到Ubuntu 18.04 Bionic Beaver已于2023年5月结束生命,唯一的问题是升级我的发行版。我在升级Chrome时遇到了一些最初的打嗝,Docker和Jenkins。通过一些谷歌搜索,我设法升级了Chrome和Docker。对于Jenkins,我必须使用新的存储库签名密钥。
在我将发行版升级到Ubuntu 20.04后,我注意到Jenkins无法启动。

$sudo journalctl -u jenkins.service


日志记录了以下内容

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]


所以我安装了一个新版本的Java

$sudo update-java-alternatives --set java-17-openjdk-amd64


我重新启动了Jenkins,这次我在日志中发现了以下条目

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


有一个依赖于apache mina ssd插件。通过一些谷歌搜索,我发现mina插件的当前版本存在问题,唯一的方法是按照以下帖子安装工作版本

  1. Jenkins reports a cycle dependcy error with plugins after restart and will not start now
  2. Mina ssh plugin 2.8.0-30.vf9df64641cb_d has a cyclic dependency, breaks Jenkins plugin loading
    我无法访问jenkins CLI来降级插件。所以我删除了当前版本的插件和位于/var/lib/jenkins/plugins/的目录,并下载了旧版本并将其复制到插件目录。我将.hpi文件重命名为.jpi并重新启动jenkins。这次我在日志中收到以下消息
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


如果我切换回mina-sshd-common和核心到2.10..我得到循环插件依赖错误,如果我降级到2.8它寻找2.10..看起来我已经到达了死胡同。有没有办法解决这个问题,让Jenkins启动和运行?

t5fffqht

t5fffqht1#

解决了这个问题,并得到了Jenkins启动.显然,我想通了,通过试验和错误,我们应该升级插件时,Jenkins升级到一个新的版本.我已经升级了我的版本到2.426.2,但没有做任何插件.他们都是从旧的安装.所以Jenkins甚至不允许访问插件-在管理器中。手动删除和安装每个插件是相当麻烦的。所以我下载了Jenkinsci Plugin Installation Manager Tool到我的主目录。
然后,通过在HOME目录下运行以下命令,列出了使用此工具的所有插件的当前版本:$ 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
因此,InstalledPlugins.txt被写入HOME目录。我的InstalledPlugins.txt的内容如下。(根据您安装的插件,您的内容可能会有所不同)

Resulting plugin list:
ace-editor 1.1
analysis-core 1.96
analysis-model-api 8.1.3
ant 1.11
antisamy-markup-formatter 159.v25b_c67cd35fb_
apache-httpcomponents-client-4-api 4.5.14-150.v7a_b_9d17134a_5
authorize-project 1.4.0
bootstrap4-api 4.6.0-1
bootstrap5-api 5.3.0-1
bouncycastle-api 2.28
branch-api 2.5.6
build-timeout 1.20
caffeine-api 3.1.6-115.vb_8b_b_328e59d8
checks-api 2.0.0
checkstyle 4.0.0
cloudbees-folder 6.14
clover 4.11.1
cloverphp 0.5
command-launcher 100.v2f6722292ee8
commons-lang3-api 3.12.0-36.vd97de6465d5b_
commons-text-api 1.10.0-36.vc008c8fcda_7b_
conditional-buildstep 1.4.1
covcomplplot 1.1.1
crap4j 0.9
credentials 2.3.11
credentials-binding 1.23
cvs 2.11
data-tables-api 1.10.21-2
delivery-pipeline-plugin 1.4.2
discord-notifier 206.vee9f4569ee63
display-url-api 2.3.7
dry 3.0.0
dtkit-api 2.1.2
durable-task 1.34
echarts-api 5.4.0-5
email-ext 2.82
embeddable-build-status 2.0.3
envinject 2.3.0
envinject-api 1.8
external-monitor-job 1.7
font-awesome-api 6.4.0-1
forensics-api 0.7.0
git 4.3.0
git-client 3.3.0
git-server 1.9
github 1.30.0
github-api 1.114.3
github-branch-source 2.8.2
gradle 1.36
handlebars 1.1.1
htmlpublisher 1.23
instance-identity 173.va_37c494ec4e5
ionicons-api 56.v1b_1c8c49374e
jackson2-api 2.15.2-350.v0c2f3f8fc595
jakarta-activation-api 2.0.1-3
jakarta-mail-api 2.0.1-3
javadoc 1.5
javax-activation-api 1.2.0-6
javax-mail-api 1.6.2-9
jaxb 2.3.8-1
jdepend 1.3.0
jdk-tool 66.vd8fa_64ee91b_d
jquery 1.12.4-1
jquery-detached 1.2.1
jquery3-api 3.7.0-1
jsch 0.1.55.2
junit 1207.va_09d5100410f
ldap 1.24
lockable-resources 2.8
mailer 457.v3f72cb_e015e5
mapdb-api 1.0.9.0
matrix-auth 3.1.8
matrix-project 789.v57a_725b_63c79
maven-plugin 3.8
mina-sshd-api-common 2.10.0-69.v28e3e36d18eb_
mina-sshd-api-core 2.10.0-69.v28e3e36d18eb_
momentjs 1.1.1
okhttp-api 3.14.9
pam-auth 1.6
parameterized-trigger 2.39
pipeline-build-step 2.12
pipeline-github-lib 1.0
pipeline-graph-analysis 1.10
pipeline-input-step 2.11
pipeline-milestone-step 1.3.1
pipeline-model-api 1.7.0
pipeline-model-definition 1.7.0
pipeline-model-extensions 1.7.0
pipeline-rest-api 2.13
pipeline-stage-step 2.5
pipeline-stage-tags-metadata 1.7.0
pipeline-stage-view 2.13
plain-credentials 1.7
plot 2.1.7
plugin-util-api 3.3.0
pmd 4.0.0
popper-api 1.16.1-1
resource-disposer 0.14
role-strategy 3.1.1
run-condition 1.3
scm-api 672.v64378a_b_20c60
script-security 1251.vfe552ed55f8d
snakeyaml-api 2.2-111.vc6598e30cc65
ssh 2.6.1
ssh-credentials 1.18.1
ssh-slaves 1.31.2
sshd 3.303.vefc7119b_ec23
structs 324.va_f5d6774f3a_d
subversion 2.13.1
timestamper 1.11.3
token-macro 2.13
trilead-api 2.84.v72119de229b_7
violations 0.7.11
warnings 5.0.1
warnings-ng 8.2.0
windows-slaves 1.6
workflow-aggregator 2.6
workflow-api 1213.v646def1087f9
workflow-basic-steps 2.20
workflow-cps 2.80
workflow-cps-global-lib 2.16
workflow-durable-task-step 2.35
workflow-job 2.40
workflow-multibranch 2.21
workflow-scm-step 2.11
workflow-step-api 639.v6eca_cd8c04a_a_
workflow-support 839.v35e2736cfd5c
ws-cleanup 0.38
xunit 2.3.9
xvfb 1.2

字符串
复制此文件

$ cp InstalledPLugins.txt plugins.txt


编辑plugins.txt并将所有版本号替换为“latest”,如下所示

ace-editor:latest
analysis-core:latest
analysis-model-api:latest
ant:latest


这意味着我们希望插件安装管理器工具为这些插件中的每一个安装最新版本。

$ cp plugins.txt /var/lib/jenkins/.


现在使用插件安装管理器工具按照plugins.txt升级插件

$ 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


这将安装最新版本的插件。在我的情况下,一些插件抛出404错误,因为它们是either贬值或不再维护。一旦升级完成启动Jenkins

$ sudo service jenkins start


访问URL,你会看到Jenkins的新版本。在我的例子中,这是显示的版本。x1c 0d1x

相关问题