-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Improve error message when installing an offline plugin #28298
Improve error message when installing an offline plugin #28298
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can detect this situation sooner and much more clearly (e.g., in install
). Would you take another approach?
} | ||
// TODO: no jars should be an error | ||
// TODO: verify the classname exists in one of the jars! | ||
} catch (IllegalStateException e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think this is right, we could catch an IllegalStateException for JAR hell and really we are only trying to detect when the offline plugin is contained in the plugins folder.
0718c7e
to
ec9b77f
Compare
I think |
ec9b77f
to
3a0b5a1
Compare
@mayya-sharipova Would you be able to incorporate the feedback here and iterate on this PR? |
@jasontedor Thanks Jason, I have already incorporated it. I followed the last suggestion from Ryan. |
@mayya-sharipova I see, again we see the problem with force pushing to a pull request; I do not think anyone knew that new commits were pushed here. Please ping when you push commits. Also, would you resolve the existing merge conflicts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @mayya-sharipova, the change looks good. I left one comment.
Path pluginsFile = Paths.get(url.getFile()); | ||
if (pluginsFile.startsWith(pluginsDir)) { | ||
throw new IllegalStateException("Installation failed! " + | ||
"Make sure `plugins` directory doesn't contain the plugin distribution! " ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can have a more actionable error message here like: "the plugins directory [" + pluginsDir + "] can not contain the plugin distribution [" + pluginsFile + "]; move the distribution to an alternate location"
Pinging @elastic/es-core-infra |
3a0b5a1
to
8c132d6
Compare
Provide more actionable error message when installing an offline plugin in the plugins directory, and the `plugins` directory for the node contains plugin distribution. Closes elastic#27401
8c132d6
to
68c91ac
Compare
Provide more actionable error message when installing an offline plugin in the plugins directory, and the `plugins` directory for the node contains plugin distribution. Closes #27401
@mayya-sharipova I’m confused. I left a comment about the user-facing message but I do not see that incorporated here nor a response to that comment although this change has been merged? |
Oh I see that you force pushed! Please prefer to push additional commits instead of force pushing. There are generally very few situations in which we need to force push. |
This reverts commit 0cc1ffd The reason is that Windows test are failing, because of the incorrect path for the plugin
This reverts commit 6284b7e. The reason is that Windows test are failing, because of the incorrect path for the plugin
* es/6.x: (89 commits) Clarify requirements of strict date formats. (#29090) Clarify that dates are always rendered as strings. (#29093) [Docs] Fix link to Grok patterns (#29088) Fix starting on Windows from another drive (#29086) Use removeTask instead of finishTask in PersistentTasksClusterService (#29055) Added minimal docs for reindex api in java-api docs Allow overriding JVM options in Windows service (#29044) Clarify how to set compiler and runtime JDKs (#29101) Fix Parsing Bug with Update By Query for Stored Scripts (#29039) TEST: write ops should execute under shard permit (#28966) [DOCS] Add X-Pack upgrade details (#29038) Revert "Improve error message for installing plugin (#28298)" Docs: HighLevelRestClient#exists (#29073) Validate regular expressions in dynamic templates. (#29013) [Tests] Fix GetResultTests and DocumentFieldTests failures (#29083) Reenable LiveVersionMapTests.testRamBytesUsed on Java 9. (#29063) Mute failing GetResultTests and DocumentFieldTests [Docs] Fix Java Api index administration usage (#28260) Improve error message for installing plugin (#28298) Decouple XContentBuilder from BytesReference (#28972) ...
* es/master: (97 commits) Clarify requirements of strict date formats. (#29090) Clarify that dates are always rendered as strings. (#29093) Compilation fix for #29067 [Docs] Fix link to Grok patterns (#29088) Store offsets in index prefix fields when stored in the parent field (#29067) Fix starting on Windows from another drive (#29086) Use removeTask instead of finishTask in PersistentTasksClusterService (#29055) Added minimal docs for reindex api in java-api docs Allow overriding JVM options in Windows service (#29044) Clarify how to set compiler and runtime JDKs (#29101) CLI: Close subcommands in MultiCommand (#28954) TEST: write ops should execute under shard permit (#28966) [DOCS] Add X-Pack upgrade details (#29038) Revert "Improve error message for installing plugin (#28298)" Docs: HighLevelRestClient#exists (#29073) Validate regular expressions in dynamic templates. (#29013) [Tests] Fix GetResultTests and DocumentFieldTests failures (#29083) Reenable LiveVersionMapTests.testRamBytesUsed on Java 9. (#29063) Mute failing GetResultTests and DocumentFieldTests Improve error message for installing plugin (#28298) ...
Provide more actionable error message when installing an offline plugin
in the plugins directory, and the
plugins
directory for the nodecontains plugin distribution.
Closes #27401