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

Running "jenkins-plugin-manager.jar --list" deletes all installed plugins #173

Closed
sebthom opened this issue Aug 24, 2020 · 10 comments · Fixed by #226
Closed

Running "jenkins-plugin-manager.jar --list" deletes all installed plugins #173

sebthom opened this issue Aug 24, 2020 · 10 comments · Fixed by #226
Assignees
Labels
bug Something isn't working

Comments

@sebthom
Copy link

sebthom commented Aug 24, 2020

Running /usr/lib/jenkins-plugin-manager.jar --list deletes all installed plugins.

Example:

jenkins@676e1f797b5e:/$ ls -l $REF/plugins
total 2484
-rw-r--r-- 1 jenkins jenkins 2262190 Aug 24 19:06 configuration-as-code.jpi
-rw-r--r-- 1 jenkins jenkins  277413 Aug 24 19:06 snakeyaml-api.jpi

jenkins@676e1f797b5e:/$ java -jar /usr/lib/jenkins-plugin-manager.jar --list

Installed plugins:

Bundled plugins:

Set of all requested plugins:

Set of all requested plugins that will be downloaded:

Set of all existing plugins and plugins that will be downloaded:
Done

jenkins@676e1f797b5e:/$ ls -l $REF/plugins
total 0

jenkins@676e1f797b5e:/$ java -jar /usr/lib/jenkins-plugin-manager.jar --version
2.0.0
@oleg-nenashev oleg-nenashev added the bug Something isn't working label Sep 17, 2020
@raspy
Copy link
Member

raspy commented Sep 29, 2020

Introduced and mentioned in review of #94 .

@raspy
Copy link
Member

raspy commented Sep 29, 2020

Additional "feature": running the same command twice means downloading everything twice, since everything is deleted before it is considered as being already installed.

@timja
Copy link
Member

timja commented Sep 29, 2020

@raspy most of what you said isn’t related to this issue.

The code needs to be reworked to not go through the path that deletes the plugins.

Updating the plugins file code is an example of where this should probably be invoked from.

The deleting bit can be reworked too but there’s no need for this code to go through that code path

@reinholdfuereder
Copy link

We just stumbled over this shocking bug as well: kind of "maximum surprise" principle ;-)

reinholdfuereder referenced this issue in oleg-nenashev/demo-jenkins-config-as-code Oct 21, 2020
@timja
Copy link
Member

timja commented Nov 14, 2020

I've had an initial look at this, the flag doesn't do what I expect at all.

It seems to be more about listing installation of plugins rather than a typical list command (which already get logged out anyway).

If no objections I would just completely re-work this to be a standalone flag that only lists installed plugins.

It would be a breaking change but I doubt people are actually using this

@reinholdfuereder
Copy link

@timja Yes, please!

@oleg-nenashev
Copy link
Member

Working on a fix restoring the option

@pwillis-els
Copy link
Contributor

@oleg-nenashev is there a PR or branch to track? Mainly I wanted to comment and ask if the new fix will involve an output to be able to diff the versions. Basically I want to use this tool mainly to tell me currently "latest" versions compared to versions in plugins.txt. The use case is to automate a build pipeline to rebuild Jenkins when a new plugin is released, run a series of tests, and if it fails, revert the plugin change and open a new bug (not here!) to investigate the break. (Without "-l" option the tool does not show what the current latest version is if you have unpinned plugins; I know I could script this myself, but would rather use a supported tool if possible)

@oleg-nenashev
Copy link
Member

2.4.0+ includes a fix

@jetersen
Copy link
Member

@pwillis-els you can always see the release notes: https://github.com/jenkinsci/plugin-installation-manager-tool/releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants