[JIRA] (JENKINS-33843) It's not possible to disable/uninstall optional dependencies

8 views
Skip to first unread message

dholmes@netapp.com (JIRA)

unread,
May 9, 2018, 1:31:03 PM5/9/18
to jenkinsc...@googlegroups.com
NetAppBlueDevil commented on Bug JENKINS-33843
 
Re: It's not possible to disable/uninstall optional dependencies

+1

 

Trying to simplify by removing unneeded plugins is just no possible any more.  I don't even know why the Green Balls plugin has the LDAP plugin listed as an optional dependency, but it means I can't drop the LDAP one.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

dholmes@netapp.com (JIRA)

unread,
May 9, 2018, 1:31:04 PM5/9/18
to jenkinsc...@googlegroups.com
NetAppBlueDevil edited a comment on Bug JENKINS-33843
+1

 

Trying to simplify by removing unneeded plugins is just
no not possible any more .  I don't even know why the Green Balls plugin has the LDAP plugin listed as an optional dependency, but it means I can't drop the LDAP one.

jglick@cloudbees.com (JIRA)

unread,
Apr 26, 2019, 10:00:04 AM4/26/19
to jenkinsc...@googlegroups.com
Jesse Glick assigned an issue to Jesse Glick
 
Jenkins / Bug JENKINS-33843
Change By: Jesse Glick
Assignee: Jesse Glick
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

jglick@cloudbees.com (JIRA)

unread,
Apr 26, 2019, 10:13:02 AM4/26/19
to jenkinsc...@googlegroups.com
Jesse Glick commented on Bug JENKINS-33843
 
Re: It's not possible to disable/uninstall optional dependencies

pjdarton

Enhance the dependency algorithm to differentiate between hard dependencies and soft dependencies

Jenkins has long made that distinction. It just was not being honored in this feature.

it'd be nice to have a "I know what I'm doing! Do it anyway." option

Would be useless since Jenkins core will refuse to even load a plugin which is missing a hard dependency.


NetAppBlueDevil

I don't even know why the Green Balls plugin has the LDAP plugin listed as an optional dependency

This is because it was a plugin split out of core, and for compatibility reasons these are made implicit optional dependencies of all other plugins which were built against a version of core predating that split.

But this brings up an important point. Why are these implicit dependencies optional? Well, in the vast majority of cases the old plugin was not actually using the detached functionality, so we do not want to prevent the split plugin from being disabled or uninstalled if it is obviously unused. There are a few cases where something was detached which a number of other plugins actually relied on—the most prominent cases being maven-plugin, matrix-project, and junit—and so there is some risk that an admin would accidentally disable an “optional” dep that was actually critical to some still-enabled plugin’s functioning, typically seen as a NoClassDefFoundError at runtime. Those cases which are not already mitigated by use of @Extension(optional = true) or other defensive coding patterns can be addressed merely by releasing a downstream plugin update which builds against a newer version of Jenkins core: the Maven build will fail until the split plugin is added as a dependency to the POM, causing it to appear as a hard dependency in the binary plugin’s manifest.

jglick@cloudbees.com (JIRA)

unread,
Apr 26, 2019, 2:37:03 PM4/26/19
to jenkinsc...@googlegroups.com
Jesse Glick started work on Bug JENKINS-33843
 
Change By: Jesse Glick
Status: Open In Progress

jglick@cloudbees.com (JIRA)

unread,
Apr 26, 2019, 2:54:19 PM4/26/19
to jenkinsc...@googlegroups.com
Jesse Glick updated an issue
 

The following example

Jenkins.instance.pluginManager.plugins.sort(false, {it.shortName}).each {p ->
  println(p.shortName);
  println("  dependencies:");
  println("    unspecified: ${p.dependencies*.shortName.sort()}");
  println("    optional: ${p.optionalDependencies*.shortName.sort()}");
  println("    mandatory: ${(p.dependencies - p.optionalDependencies)*.shortName.sort()}");
  println("  dependents:");
  println("    unspecified: ${p.dependents.sort()}");
  println("    optional: ${p.optionalDependents.sort()}");
  println("    mandatory: ${(p.dependents - p.optionalDependents).sort()}");
}; null

reveals a mess:

antisamy-markup-formatter
  dependencies:
    unspecified: [bouncycastle-api, command-launcher, jdk-tool, junit]
    optional: [bouncycastle-api, command-launcher, jdk-tool, junit]
    mandatory: []
  dependents:
    unspecified: [greenballs, uno-choice]
    optional: []
    mandatory: [greenballs, uno-choice]
bouncycastle-api
  dependencies:
    unspecified: [command-launcher, jdk-tool]
    optional: [command-launcher, jdk-tool]
    mandatory: []
  dependents:
    unspecified: [antisamy-markup-formatter, credentials, external-monitor-job, greenballs, junit, ldap, mailer, matrix-project, windows-slaves]
    optional: []
    mandatory: [antisamy-markup-formatter, credentials, external-monitor-job, greenballs, junit, ldap, mailer, matrix-project, windows-slaves]
command-launcher
  dependencies:
    unspecified: [jdk-tool, script-security]
    optional: [jdk-tool]
    mandatory: [script-security]
  dependents:
    unspecified: [antisamy-markup-formatter, bouncycastle-api, config-file-provider, credentials, external-monitor-job, greenballs, junit, ldap, mailer, matrix-project, scm-api, ssh-credentials, structs, uno-choice, windows-slaves]
    optional: []
    mandatory: [antisamy-markup-formatter, bouncycastle-api, config-file-provider, credentials, external-monitor-job, greenballs, junit, ldap, mailer, matrix-project, scm-api, ssh-credentials, structs, uno-choice, windows-slaves]
config-file-provider
  dependencies:
    unspecified: [command-launcher, credentials, jdk-tool, ssh-credentials, structs, token-macro]
    optional: [cloudbees-folder, command-launcher, jdk-tool]
    mandatory: [credentials, ssh-credentials, structs, token-macro]
  dependents:
    unspecified: [job-dsl]
    optional: [job-dsl]
    mandatory: []
credentials
  dependencies:
    unspecified: [bouncycastle-api, command-launcher, jdk-tool, structs]
    optional: [bouncycastle-api, command-launcher, jdk-tool]
    mandatory: [structs]
  dependents:
    unspecified: [config-file-provider, ssh-credentials]
    optional: []
    mandatory: [config-file-provider, ssh-credentials]
display-url-api
  dependencies:
    unspecified: [jdk-tool]
    optional: [jdk-tool]
    mandatory: []
  dependents:
    unspecified: [mailer]
    optional: []
    mandatory: [mailer]
external-monitor-job
  dependencies:
    unspecified: [bouncycastle-api, command-launcher, jdk-tool]
    optional: [bouncycastle-api, command-launcher, jdk-tool]
    mandatory: []
  dependents:
    unspecified: [greenballs]
    optional: []
    mandatory: [greenballs]
greenballs
  dependencies:
    unspecified: [antisamy-markup-formatter, bouncycastle-api, command-launcher, external-monitor-job, jdk-tool, junit, ldap, mailer, matrix-auth, matrix-project, pam-auth, windows-slaves]
    optional: [antisamy-markup-formatter, bouncycastle-api, command-launcher, external-monitor-job, jdk-tool, junit, ldap, mailer, matrix-auth, matrix-project, pam-auth, windows-slaves]
    mandatory: []
  dependents:
    unspecified: []
    optional: []
    mandatory: []
jdk-tool
  dependencies:
    unspecified: []
    optional: []
    mandatory: []
  dependents:
    unspecified: [antisamy-markup-formatter, bouncycastle-api, command-launcher, config-file-provider, credentials, display-url-api, external-monitor-job, greenballs, junit, ldap, mailer, matrix-project, scm-api, script-security, ssh-credentials, structs, uno-choice, windows-slaves]
    optional: []
    mandatory: [antisamy-markup-formatter, bouncycastle-api, command-launcher, config-file-provider, credentials, display-url-api, external-monitor-job, greenballs, junit, ldap, mailer, matrix-project, scm-api, script-security, ssh-credentials, structs, uno-choice, windows-slaves]
job-dsl
  dependencies:
    unspecified: [config-file-provider, script-security, structs]
    optional: [config-file-provider, configuration-as-code, managed-scripts, vsphere-cloud]
    mandatory: [script-security, structs]
  dependents:
    unspecified: []
    optional: []
    mandatory: []
junit
  dependencies:
    unspecified: [bouncycastle-api, command-launcher, jdk-tool, script-security, structs, workflow-api, workflow-step-api]
    optional: [bouncycastle-api, command-launcher, jdk-tool]
    mandatory: [script-security, structs, workflow-api, workflow-step-api]
  dependents:
    unspecified: [antisamy-markup-formatter, greenballs, matrix-project]
    optional: []
    mandatory: [antisamy-markup-formatter, greenballs, matrix-project]
ldap
  dependencies:
    unspecified: [bouncycastle-api, command-launcher, jdk-tool, mailer]
    optional: [bouncycastle-api, command-launcher, jdk-tool]
    mandatory: [mailer]
  dependents:
    unspecified: [greenballs]
    optional: []
    mandatory: [greenballs]
mailer
  dependencies:
    unspecified: [bouncycastle-api, command-launcher, display-url-api, jdk-tool]
    optional: [bouncycastle-api, command-launcher, jdk-tool]
    mandatory: [display-url-api]
  dependents:
    unspecified: [greenballs, ldap]
    optional: []
    mandatory: [greenballs, ldap]
matrix-auth
  dependencies:
    unspecified: []
    optional: [cloudbees-folder, configuration-as-code]
    mandatory: []
  dependents:
    unspecified: [greenballs]
    optional: []
    mandatory: [greenballs]
matrix-project
  dependencies:
    unspecified: [bouncycastle-api, command-launcher, jdk-tool, junit, script-security]
    optional: [bouncycastle-api, command-launcher, jdk-tool]
    mandatory: [junit, script-security]
  dependents:
    unspecified: [greenballs]
    optional: []
    mandatory: [greenballs]
pam-auth
  dependencies:
    unspecified: []
    optional: []
    mandatory: []
  dependents:
    unspecified: [greenballs]
    optional: []
    mandatory: [greenballs]
scm-api
  dependencies:
    unspecified: [command-launcher, jdk-tool, structs]
    optional: [command-launcher, jdk-tool]
    mandatory: [structs]
  dependents:
    unspecified: [workflow-api]
    optional: []
    mandatory: [workflow-api]
script-security
  dependencies:
    unspecified: [jdk-tool]
    optional: [jdk-tool]
    mandatory: []
  dependents:
    unspecified: [command-launcher, job-dsl, junit, matrix-project, uno-choice]
    optional: []
    mandatory: [command-launcher, job-dsl, junit, matrix-project, uno-choice]
ssh-credentials
  dependencies:
    unspecified: [command-launcher, credentials, jdk-tool]
    optional: [command-launcher, jdk-tool]
    mandatory: [credentials]
  dependents:
    unspecified: [config-file-provider]
    optional: []
    mandatory: [config-file-provider]
structs
  dependencies:
    unspecified: [command-launcher, jdk-tool]
    optional: [command-launcher, jdk-tool]
    mandatory: []
  dependents:
    unspecified: [config-file-provider, credentials, job-dsl, junit, scm-api, token-macro, workflow-api, workflow-step-api]
    optional: []
    mandatory: [config-file-provider, credentials, job-dsl, junit, scm-api, token-macro, workflow-api, workflow-step-api]
token-macro
  dependencies:
    unspecified: [structs, workflow-step-api]
    optional: []
    mandatory: [structs, workflow-step-api]
  dependents:
    unspecified: [config-file-provider]
    optional: []
    mandatory: [config-file-provider]
uno-choice
  dependencies:
    unspecified: [antisamy-markup-formatter, command-launcher, jdk-tool, script-security]
    optional: [command-launcher, jdk-tool, scriptler]
    mandatory: [antisamy-markup-formatter, script-security]
  dependents:
    unspecified: []
    optional: []
    mandatory: []
windows-slaves
  dependencies:
    unspecified: [bouncycastle-api, command-launcher, jdk-tool]
    optional: [bouncycastle-api, command-launcher, jdk-tool]
    mandatory: []
  dependents:
    unspecified: [greenballs]
    optional: []
    mandatory: [greenballs]
workflow-api
  dependencies:
    unspecified: [scm-api, structs, workflow-step-api]
    optional: []
    mandatory: [scm-api, structs, workflow-step-api]
  dependents:
    unspecified: [junit]
    optional: []
    mandatory: [junit]
workflow-step-api
  dependencies:
    unspecified: [structs]
    optional: []
    mandatory: [structs]
  dependents:
    unspecified: [junit, token-macro, workflow-api]
    optional: []
    mandatory: [junit, token-macro, workflow-api]

First of all, dependencies usually includes those entries in optionalDependencies, but not in all cases.

More to the point for this issue, dependents in fact includes optional dependents. Also, optionalDependents for detached plugins lacks implied optional dependencies.

Also I think I saw that some of the values change from a Jenkins session in which a plugin is newly installed from the update center and dynamically loaded to a session after the restart.

I am removing the newbie-friendly label since it seems to be anything but: the GUI actually looks OK, it is the data model which is all wrong.

Change By: Jesse Glick
Labels: 2.0 2.0-beta newbie-friendly

jglick@cloudbees.com (JIRA)

unread,
Apr 26, 2019, 3:11:03 PM4/26/19
to jenkinsc...@googlegroups.com
 
Re: It's not possible to disable/uninstall optional dependencies

At least the optionalDependents field was introduced in JENKINS-27177. It seems that the use of dependents to mean all dependencies predated that. Hard to tell what the original intent was, since the Javadoc does not specify; some of this seems to date to Jenkins 2.0.

jglick@cloudbees.com (JIRA)

unread,
Apr 26, 2019, 3:50:02 PM4/26/19
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Apr 29, 2019, 12:50:02 PM4/29/19
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Apr 29, 2019, 12:51:04 PM4/29/19
to jenkinsc...@googlegroups.com

costescuandrei@skymail.ro (JIRA)

unread,
May 2, 2019, 6:26:02 AM5/2/19
to jenkinsc...@googlegroups.com
Andrei Costescu commented on Bug JENKINS-33843
 
Re: It's not possible to disable/uninstall optional dependencies

Great news that this is resolved. Which version will have this fixed?

(I see it in Jenkins ver. 2.164.2 where I can't uninstall Static Analysis Utilities 1.96 (which has a security warning and is end-of-life) due to an optional dependency to it from Email Extension Plugin 2.66 which I still use)

dbeck@cloudbees.com (JIRA)

unread,
May 2, 2019, 6:37:03 AM5/2/19
to jenkinsc...@googlegroups.com

Are you sure? analysis-core 1.96 should not have a security warning, we fixed that issue.

jglick@cloudbees.com (JIRA)

unread,
May 2, 2019, 9:54:02 AM5/2/19
to jenkinsc...@googlegroups.com

Andrei Costescu the fix is still open for review. If and when the fix is merged, this issue will be closed with details. In the meantime, see the *.disabled workaround above.

medianick@gmail.com (JIRA)

unread,
May 2, 2019, 10:01:03 PM5/2/19
to jenkinsc...@googlegroups.com

medianick@gmail.com (JIRA)

unread,
May 2, 2019, 10:02:03 PM5/2/19
to jenkinsc...@googlegroups.com
Nick Jones commented on Bug JENKINS-33843
 
Re: It's not possible to disable/uninstall optional dependencies

Daniel Beck FWIW, analysis-core 1.96 still shows the security warning:

We first saw the warning with 1.95 installed, upgraded, and still see it.

dbeck@cloudbees.com (JIRA)

unread,
May 3, 2019, 6:26:02 AM5/3/19
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Jun 17, 2019, 9:18:07 AM6/17/19
to jenkinsc...@googlegroups.com
Change By: Jesse Glick
Status: In Review Resolved
Resolution: Fixed
Released As: 2.181

ogondza@gmail.com (JIRA)

unread,
Jul 1, 2019, 3:00:05 AM7/1/19
to jenkinsc...@googlegroups.com
Oliver Gondža updated an issue
Change By: Oliver Gondža
Labels: 2.176.2-rejected lts-candidate

ogondza@gmail.com (JIRA)

unread,
Jul 1, 2019, 3:00:12 AM7/1/19
to jenkinsc...@googlegroups.com
Oliver Gondža commented on Bug JENKINS-33843
 
Re: It's not possible to disable/uninstall optional dependencies

I am postponing backport of this fix to give it some more soaking time.

ogondza@gmail.com (JIRA)

unread,
Aug 1, 2019, 7:05:05 AM8/1/19
to jenkinsc...@googlegroups.com
Oliver Gondža updated an issue
Change By: Oliver Gondža
Labels: 2.176.2-rejected lts 2.176.3 - candidate fixed

medianick@gmail.com (JIRA)

unread,
Aug 20, 2019, 9:58:03 AM8/20/19
to jenkinsc...@googlegroups.com
Nick Jones commented on Bug JENKINS-33843
 
Re: It's not possible to disable/uninstall optional dependencies

In case it's helpful to anyone else (as I've just gone through this to uninstall Mask Passwords due to SECURITY-157), Jesse Glick's workaround disables the optional dependency in question (mask-passwords.jpi in my case), after which point the Uninstall button in the Manage Plugins page will enable, and the plugin can be uninstalled as desired.

reitzmichnicht@gmx.de (JIRA)

unread,
Aug 29, 2019, 5:27:02 AM8/29/19
to jenkinsc...@googlegroups.com

This change seems to allow now to also uninstall/disable implied plugins. So release 2.176.2 introduced with JENKINS-57528 the change that all implied plugins are also installed, and now I can uninstall them again manually?

jglick@cloudbees.com (JIRA)

unread,
Aug 29, 2019, 9:28:02 AM8/29/19
to jenkinsc...@googlegroups.com

Or disable them, yes. Really it might be better for Docker image users to have an alternate distribution of jenkins.war without any detached plugins.

Reply all
Reply to author
Forward
0 new messages