Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugins don't update #730

Open
ma3s7ro opened this issue Oct 15, 2024 · 4 comments
Open

Plugins don't update #730

ma3s7ro opened this issue Oct 15, 2024 · 4 comments

Comments

@ma3s7ro
Copy link

ma3s7ro commented Oct 15, 2024

Jenkins and plugins versions report

Environment Jenkins version: 2.462.2 ```text jenkins-plugin-manager-2.13.2.jar ```

What Operating System are you using (both controller, and any agents involved in the problem)?

Rocky Linux 9

Reproduction steps

java -jar jenkins-plugin-manager-*.jar --war /usr/share/java/jenkins.war --plugin-download-directory /var/lib/jenkins/plugins --plugin-file /var/lib/jenkins/update_plugins.txt --verbose

java -jar jenkins-plugin-manager-*.jar --war /usr/share/java/jenkins.war --plugin-download-directory /var/lib/jenkins/plugins --plugin-file /var/lib/jenkins/update_plugins.txt --latest false --verbose

Expected Results

Plugins update

Actual Results

java -jar jenkins-plugin-manager-*.jar --war /usr/share/java/jenkins.war --plugin-download-directory /var/lib/jenkins/plugins --plugin-file /var/lib/jenkins/update_plugins.txt --verbose

File containing list of plugins to be downloaded: /var/lib/jenkins/update_plugins.txt
Reading in plugins from /var/lib/jenkins/update_plugins.txt

Plugin download location: /var/lib/jenkins/plugins
No CLI option or environment variable set for update center, using default of https://updates.jenkins.io/update-center.json
No CLI option or environment variable set for experimental update center, using default of https://updates.jenkins.io/experimental/update-center.json
No CLI option or environment variable set for incrementals mirror, using default of https://repo.jenkins-ci.org/incrementals
No CLI option or environment variable set for plugin info, using default of https://updates.jenkins.io/plugin-versions.json
Will use war file: /usr/share/java/jenkins.war
Jenkins version: 2.462.2

Retrieving update center information
Update center URL: https://updates.jenkins.io/update-center.json?version=2.462.2
Returning cached value for: update-center-2.462.2
Returning cached value for: plugin-versions
Setting checksum for: JDK_Parameter_Plugin to HhmNVqBRKwqQ9or9rAaS8GHRXNsBX+QQVOQlF6VMPmY=
Setting checksum for: JDK_Parameter_Plugin to HhmNVqBRKwqQ9or9rAaS8GHRXNsBX+QQVOQlF6VMPmY=

JDK_Parameter_Plugin has no dependencies
Setting checksum for: JDK_Parameter_Plugin to HhmNVqBRKwqQ9or9rAaS8GHRXNsBX+QQVOQlF6VMPmY=
Setting checksum for: Parameterized-Remote-Trigger to m0sG4+MbJjhmE67TMQ9uuhxSOCGipbXU+Nel0gsvqj8=
Setting checksum for: Parameterized-Remote-Trigger to m0sG4+MbJjhmE67TMQ9uuhxSOCGipbXU+Nel0gsvqj8=

Parameterized-Remote-Trigger depends on:
opentelemetry 2.10.0
workflow-step-api 639.v6eca_cd8c04a_a_
credentials 1143.vb_e8b_b_ceee347
script-security 1218.v39ca_7f7ed0a_c
token-macro 321.vd7cc1f2a_52c8
Skipping dependency workflow-step-api:639.v6eca_cd8c04a_a_ and its sub-dependencies, because there is a higher version defined on the top level - workflow-step-api:678.v3ee58b_469476
Skipping dependency credentials:1143.vb_e8b_b_ceee347 and its sub-dependencies, because there is a higher version defined on the top level - credentials:1380.va_435002fa_924
Skipping dependency script-security:1218.v39ca_7f7ed0a_c and its sub-dependencies, because there is a higher version defined on the top level - script-security:1365.v4778ca_84b_de5
Skipping dependency token-macro:321.vd7cc1f2a_52c8 and its sub-dependencies, because there is a higher version defined on the top level - token-macro:400.v35420b_922dcb_
Setting checksum for: Parameterized-Remote-Trigger to m0sG4+MbJjhmE67TMQ9uuhxSOCGipbXU+Nel0gsvqj8=
Setting checksum for: Parameterized-Remote-Trigger to m0sG4+MbJjhmE67TMQ9uuhxSOCGipbXU+Nel0gsvqj8=
Setting checksum for: active-directory to zd4KTO8Pvwr9H7ZfGvEYcfLr+le2kJIEAgENQ63itzc=
Setting checksum for: active-directory to zd4KTO8Pvwr9H7ZfGvEYcfLr+le2kJIEAgENQ63itzc=

active-directory depends on:
caffeine-api 3.1.8-133.v17b_1ff2e0599
configuration-as-code 1836.vccda_4a_122a_a_e
mailer 470.vc91f60c5d8e2
Skipping dependency caffeine-api:3.1.8-133.v17b_1ff2e0599 and its sub-dependencies, because there is a higher version defined on the top level - caffeine-api:3.1.8-133.v17b_1ff2e0599
Skipping dependency mailer:470.vc91f60c5d8e2 and its sub-dependencies, because there is a higher version defined on the top level - mailer:488.v0c9639c1a_eb_3
Setting checksum for: active-directory to zd4KTO8Pvwr9H7ZfGvEYcfLr+le2kJIEAgENQ63itzc=
Setting checksum for: active-directory to zd4KTO8Pvwr9H7ZfGvEYcfLr+le2kJIEAgENQ63itzc=
Setting checksum for: android-emulator to MdGoXlMRCQsHXI0nfIdkvfxK279wqzwwTyIuSp0VIRo=
Setting checksum for: android-emulator to MdGoXlMRCQsHXI0nfIdkvfxK279wqzwwTyIuSp0VIRo=
Done

Anything else?

I writing bash script to updates Jenkins plugins.

# Get the list of installed plugins and save it to plugins.txt
java -jar jenkins-plugin-manager-*.jar --war /usr/share/java/jenkins.war --plugin-download-directory /var/lib/jenkins/plugins --list \
| tail -n +2 | grep -E '^[a-zA-Z0-9._-]+ [0-9a-zA-Z.-]+|^[a-zA-Z0-9._-]+-[0-9a-zA-Z.-]+$'| awk '{print $1 ":" $2}' > "$PLUGIN_FILE"

# Get available updates and save them to available_updates.txt
java -jar jenkins-plugin-manager-*.jar --war /usr/share/java/jenkins.war --plugin-download-directory /var/lib/jenkins/plugins --plugin-file /var/lib/jenkins/plugins.txt --available-updates --output txt > "$UPDATE_FILE"

# Update plugins
echo "Updating Jenkins plugins..."
java -jar jenkins-plugin-manager-*.jar  --war /usr/share/java/jenkins.war --plugin-download-directory /var/lib/jenkins/plugins --plugin-file /var/lib/jenkins/update_plugins.txt --verbose

I put plugins list with new version in file

update_plugins.txt

JDK_Parameter_Plugin:1.2
Parameterized-Remote-Trigger:3.2.0
active-directory:2.37
android-emulator:592.vb_b_6d427f1923
ansicolor:1.0.5
ant:511.v0a_a_1a_334f41b_

Example installed active-directory:2.36 available new active-directory:2.37

Could you assist, what do I wrong?

Are you interested in contributing a fix?

No response

@MarkEWaite
Copy link
Contributor

I use a different technique to generate the updated list of plugins. You might try it instead:

Generate the new plugins.txt file with this command:

java -jar jenkins-plugin-manager.jar --jenkins-version 2.462.3 -d ref/plugins -f plugins.txt --no-download --available-updates -o txt > x && mv x plugins.txt

Download the files defined in that plugins.txt file with this command:

java -jar jenkins-plugin-manager.jar --jenkins-version 2.462.3 -d ref/plugins -f plugins.txt

@ma3s7ro
Copy link
Author

ma3s7ro commented Oct 15, 2024

The same issue. I have done like you generating file.

java -jar jenkins-plugin-manager-2.13.2.jar --jenkins-version 2.462.3 -d /var/lib/jenkins/plugins -f /var/lib/jenkins/update_plugins.txt --verbose

File containing list of plugins to be downloaded: /var/lib/jenkins/update_plugins.txt
Reading in plugins from /var/lib/jenkins/update_plugins.txt

Plugin download location: /var/lib/jenkins/plugins
No CLI option or environment variable set for update center, using default of https://updates.jenkins.io/update-center.json
No CLI option or environment variable set for experimental update center, using default of https://updates.jenkins.io/experimental/update-center.json
No CLI option or environment variable set for incrementals mirror, using default of https://repo.jenkins-ci.org/incrementals
No CLI option or environment variable set for plugin info, using default of https://updates.jenkins.io/plugin-versions.json
No war entered. Will use default of /usr/share/java/jenkins.war

Retrieving update center information
Update center URL: https://updates.jenkins.io/update-center.json?version=2.462.3
Returning cached value for: update-center-2.462.3
Returning cached value for: plugin-versions
Setting checksum for: JDK_Parameter_Plugin to HhmNVqBRKwqQ9or9rAaS8GHRXNsBX+QQVOQlF6VMPmY=
Setting checksum for: JDK_Parameter_Plugin to HhmNVqBRKwqQ9or9rAaS8GHRXNsBX+QQVOQlF6VMPmY=

JDK_Parameter_Plugin has no dependencies
Setting checksum for: JDK_Parameter_Plugin to HhmNVqBRKwqQ9or9rAaS8GHRXNsBX+QQVOQlF6VMPmY=
Setting checksum for: Parameterized-Remote-Trigger to m0sG4+MbJjhmE67TMQ9uuhxSOCGipbXU+Nel0gsvqj8=
Setting checksum for: Parameterized-Remote-Trigger to m0sG4+MbJjhmE67TMQ9uuhxSOCGipbXU+Nel0gsvqj8=

Parameterized-Remote-Trigger depends on:
opentelemetry 2.10.0
workflow-step-api 639.v6eca_cd8c04a_a_
credentials 1143.vb_e8b_b_ceee347
script-security 1218.v39ca_7f7ed0a_c
token-macro 321.vd7cc1f2a_52c8
Skipping dependency workflow-step-api:639.v6eca_cd8c04a_a_ and its sub-dependencies, because there is a higher version defined on the top level - workflow-step-api:678.v3ee58b_469476
Skipping dependency credentials:1143.vb_e8b_b_ceee347 and its sub-dependencies, because there is a higher version defined on the top level - credentials:1384.vf0a_2ed06f9c6
Skipping dependency script-security:1218.v39ca_7f7ed0a_c and its sub-dependencies, because there is a higher version defined on the top level - script-security:1365.v4778ca_84b_de5
Skipping dependency token-macro:321.vd7cc1f2a_52c8 and its sub-dependencies, because there is a higher version defined on the top level - token-macro:400.v35420b_922dcb_
Setting checksum for: Parameterized-Remote-Trigger to m0sG4+MbJjhmE67TMQ9uuhxSOCGipbXU+Nel0gsvqj8=
Setting checksum for: Parameterized-Remote-Trigger to m0sG4+MbJjhmE67TMQ9uuhxSOCGipbXU+Nel0gsvqj8=
Setting checksum for: active-directory to zd4KTO8Pvwr9H7ZfGvEYcfLr+le2kJIEAgENQ63itzc=
Setting checksum for: active-directory to zd4KTO8Pvwr9H7ZfGvEYcfLr+le2kJIEAgENQ63itzc=

active-directory depends on:
caffeine-api 3.1.8-133.v17b_1ff2e0599
configuration-as-code 1836.vccda_4a_122a_a_e
mailer 470.vc91f60c5d8e2
Skipping dependency caffeine-api:3.1.8-133.v17b_1ff2e0599 and its sub-dependencies, because there is a higher version defined on the top level - caffeine-api:3.1.8-133.v17b_1ff2e0599
Skipping dependency mailer:470.vc91f60c5d8e2 and its sub-dependencies, because there is a higher version defined on the top level - mailer:488.v0c9639c1a_eb_3
Setting checksum for: active-directory to zd4KTO8Pvwr9H7ZfGvEYcfLr+le2kJIEAgENQ63itzc=
Setting checksum for: active-directory to zd4KTO8Pvwr9H7ZfGvEYcfLr+le2kJIEAgENQ63itzc=
Setting checksum for: android-emulator to MdGoXlMRCQsHXI0nfIdkvfxK279wqzwwTyIuSp0VIRo=
Setting checksum for: android-emulator to MdGoXlMRCQsHXI0nfIdkvfxK279wqzwwTyIuSp0VIRo=

@MarkEWaite
Copy link
Contributor

When I run your list of plugins with an empty plugins destination directory, it downloads active directory 2.37.

@ma3s7ro
Copy link
Author

ma3s7ro commented Oct 16, 2024

It's good that it works with a clean installation of plugins, but the functionality of the application implies updating already installed plugins.
From my experience, to update Jenkins, it is better to update plugins first. It would be great if it could be automated using this application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants