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

Use bc-fips to avoid jar hell with core. #5198

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

finnegancarroll
Copy link
Contributor

@finnegancarroll finnegancarroll commented Mar 21, 2025

Description

Testing with this fix for the core change to bouncycastle dependencies and noticing plugin installation is giving jar hell.

bcprov-jdk18on-1.78.jar and bc-fips-2.0.0.jar both have class org.bouncycastle.internal.asn1.eac.EACObjectIdentifiers.
Explicitely using bc-fips as implementation depenency appears to fix this issue:
org.bouncycastle:bcprov-jdk18on:1.78
->
org.bouncycastle:bc-fips:2.0.0

-> Installing file:///Users/carrofin/fdev/repos/security/build/distributions/opensearch-security-3.0.0.0-alpha1-SNAPSHOT.zip
-> Downloading file:///Users/carrofin/fdev/repos/security/build/distributions/opensearch-security-3.0.0.0-alpha1-SNAPSHOT.zip
[=================================================] 100%
-> Failed installing file:///Users/carrofin/fdev/repos/security/build/distributions/opensearch-security-3.0.0.0-alpha1-SNAPSHOT.zip
-> Rolling back file:///Users/carrofin/fdev/repos/security/build/distributions/opensearch-security-3.0.0.0-alpha1-SNAPSHOT.zip
-> Rolled back file:///Users/carrofin/fdev/repos/security/build/distributions/opensearch-security-3.0.0.0-alpha1-SNAPSHOT.zip
Exception in thread "main" java.lang.IllegalStateException: failed to load plugin opensearch-security due to jar hell
        at org.opensearch.plugins.PluginsService.checkBundleJarHell(PluginsService.java:733)
        at org.opensearch.plugins.PluginsService.checkJarHellForPlugin(PluginsService.java:373)
        at org.opensearch.tools.cli.plugin.InstallPluginCommand.jarHellCheck(InstallPluginCommand.java:831)
        at org.opensearch.tools.cli.plugin.InstallPluginCommand.loadPluginInfo(InstallPluginCommand.java:808)
        at org.opensearch.tools.cli.plugin.InstallPluginCommand.installPlugin(InstallPluginCommand.java:843)
        at org.opensearch.tools.cli.plugin.InstallPluginCommand.execute(InstallPluginCommand.java:275)
        at org.opensearch.tools.cli.plugin.InstallPluginCommand.execute(InstallPluginCommand.java:249)
        at org.opensearch.common.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:110)
        at org.opensearch.cli.Command.mainWithoutErrorHandling(Command.java:138)
        at org.opensearch.cli.MultiCommand.execute(MultiCommand.java:104)
        at org.opensearch.cli.Command.mainWithoutErrorHandling(Command.java:138)
        at org.opensearch.cli.Command.main(Command.java:101)
        at org.opensearch.tools.cli.plugin.PluginCli.main(PluginCli.java:66)
Caused by: java.lang.IllegalStateException: jar hell!
class: org.bouncycastle.internal.asn1.eac.EACObjectIdentifiers
jar1: /Users/carrofin/fdev/repos/OpenSearch/distribution/archives/darwin-tar/build/install/opensearch-3.0.0-SNAPSHOT/plugins/.installing-16777383944250648854/bcprov-jdk18on-1.78.jar
jar2: /Users/carrofin/fdev/repos/OpenSearch/distribution/archives/darwin-tar/build/install/opensearch-3.0.0-SNAPSHOT/plugins/.installing-16777383944250648854/bc-fips-2.0.0.jar
        at org.opensearch.common.bootstrap.JarHell.checkClass(JarHell.java:316)
        at org.opensearch.common.bootstrap.JarHell.checkJarHell(JarHell.java:215)
        at org.opensearch.plugins.PluginsService.checkBundleJarHell(PluginsService.java:719)
        ... 12 more

Issues Resolved

N/A

Testing

Check List

- [ ] New functionality includes testing
- [ ] New functionality has been documented
- [ ] New Roles/Permissions have a corresponding security dashboards plugin PR
- [ ] API changes companion pull request created
- [ ] Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

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

Successfully merging this pull request may close these issues.

1 participant