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

[BUG] Snapshot bundle cannot be assembled #359

Closed
dblock opened this issue Aug 31, 2021 · 1 comment · Fixed by #360
Closed

[BUG] Snapshot bundle cannot be assembled #359

dblock opened this issue Aug 31, 2021 · 1 comment · Fixed by #360
Assignees
Labels
bug Something isn't working v1.1.0

Comments

@dblock
Copy link
Member

dblock commented Aug 31, 2021

Describe the bug

OpenSearch doesn't support installing builds that declare -SNAPSHOT in plugin descriptor. Assembly fails with java.lang.IllegalArgumentException: illegal version format - snapshot labels are not supported.

To Reproduce

./bundle-workflow/build.sh manifests/opensearch-1.1.0.yml --snapshot
./bundle-workflow/assemble.sh manifests/opensearch-1.1.0.yml

-> Installing file:/tmp/tmpe_np2do4/opensearch-security-1.1.0.0-SNAPSHOT.zip
-> Downloading file:/tmp/tmpe_np2do4/opensearch-security-1.1.0.0-SNAPSHOT.zip
-> Failed installing file:/tmp/tmpe_np2do4/opensearch-security-1.1.0.0-SNAPSHOT.zip
-> Rolling back file:/tmp/tmpe_np2do4/opensearch-security-1.1.0.0-SNAPSHOT.zip
-> Rolled back file:/tmp/tmpe_np2do4/opensearch-security-1.1.0.0-SNAPSHOT.zip
Exception in thread "main" java.lang.IllegalArgumentException: illegal version format - snapshot labels are not supported
        at org.opensearch.Version.fromStringSlow(Version.java:177)
        at org.opensearch.Version.fromString(Version.java:172)
        at org.opensearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:212)
        at org.opensearch.plugins.InstallPluginCommand.loadPluginInfo(InstallPluginCommand.java:799)
        at org.opensearch.plugins.InstallPluginCommand.installPlugin(InstallPluginCommand.java:858)
        at org.opensearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:263)
        at org.opensearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:237)
        at org.opensearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:99)
        at org.opensearch.cli.Command.mainWithoutErrorHandling(Command.java:140)
        at org.opensearch.cli.MultiCommand.execute(MultiCommand.java:104)
        at org.opensearch.cli.Command.mainWithoutErrorHandling(Command.java:140)
        at org.opensearch.cli.Command.main(Command.java:103)
        at org.opensearch.plugins.PluginCli.main(PluginCli.java:60)

Expected behavior

Not sure. Do we need to assemble a snapshot bundle? Probably not.

Additional Context

https://github.com/opensearch-project/OpenSearch/blob/19e54d662488a183c1388e66cfe7463a24c6aa7c/buildSrc/src/main/resources/plugin-descriptor.properties#L48 says that the version of opensearch.version is the one built against.

@dblock
Copy link
Member Author

dblock commented Aug 31, 2021

@nknize What was the original intent of this limitation? What's supposed to happen?

  1. We change the code to remove this limitation and 1.1.0.0-SNAPSHOT of a plugin can be installed on 1.1.0-SNAPSHOT of OpenSearch.
  2. We change the code to allow 1.1.0.0-SNAPSHOT to install on either 1.1.0 or 1.1.0-SNAPSHOT of OpenSearch.
  3. We change the meaning ofopensearch.version in plugin.descriptor to say "semantically compatible version of OpenSearch", so plugins will write 1.1.0 instead of 1.1.0-SNAPSHOT when compiling against OpenSearch 1.1.0-SNAPSHOT. This is actually what's happening with plugins today that use opensearchversion gradle build exgension.

Update: I am opting for 3 in opensearch-project/OpenSearch#1186

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