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

PluginManager: Installing non-existing plugin returns confusing error message #17226

Closed
spinscale opened this issue Mar 21, 2016 · 9 comments · Fixed by #18876
Closed

PluginManager: Installing non-existing plugin returns confusing error message #17226

spinscale opened this issue Mar 21, 2016 · 9 comments · Fixed by #18876
Labels
>bug :Core/Infra/Plugins Plugin API and infrastructure v5.0.0-alpha4

Comments

@spinscale
Copy link
Contributor

If a plugin does not exist, then this is returned

bin/elasticsearch-plugin install nonexistentplugin
-> Downloading nonexistentplugin
Exception in thread "main" java.net.MalformedURLException: no protocol: nonexistentplugin
    at java.net.URL.<init>(URL.java:586)
    at java.net.URL.<init>(URL.java:483)
    at java.net.URL.<init>(URL.java:432)
    at org.elasticsearch.plugins.InstallPluginCommand.downloadZip(InstallPluginCommand.java:211)
    at org.elasticsearch.plugins.InstallPluginCommand.download(InstallPluginCommand.java:206)
    at org.elasticsearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:174)
    at org.elasticsearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:162)
    at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:88)
    at org.elasticsearch.cli.MultiCommand.execute(MultiCommand.java:69)
    at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:88)
    at org.elasticsearch.cli.Command.main(Command.java:53)
    at org.elasticsearch.plugins.PluginCli.main(PluginCli.java:57)

Also I cant seem to find out the URL which is actually requested for debugging purposes anymore, might be intended though?

@spinscale spinscale added >bug :Core/Infra/Plugins Plugin API and infrastructure v5.0.0-alpha1 labels Mar 21, 2016
@rjernst
Copy link
Member

rjernst commented Mar 21, 2016

nonexistentplugin is the url the plugin cli is trying to resolve. The logic is simple (1) is it a known official plugin? (2) is it maven coordinates? (3) finally, try it as a url.

@rjernst
Copy link
Member

rjernst commented Mar 21, 2016

If we want this to be "nicer" we could print a message in this final case on the usage info about what is supported (official plugin name, maven coordinates, or url).

@javanna
Copy link
Member

javanna commented Mar 21, 2016

If we want this to be "nicer" we could print a message in this final case on the usage info about what is supported (official plugin name, maven coordinates, or url).

++ that was the purpose of this issue I believe. The logic is clear to developers, but the current error is confusing to users.

@nik9000
Copy link
Member

nik9000 commented Mar 21, 2016

The logic is clear to developers, but the current error is confusing to users.

I suspect this mostly comes up in the "I misspelled kuromoji" kind of use case.

@rjernst
Copy link
Member

rjernst commented Mar 21, 2016

Perhaps we should improve the usage information, and throw a UserError with USAGE here then. This way we don't have to repeat in this case, and in the general help.

@nikoncode
Copy link
Contributor

I think need to show message like follows:

$elasticsearch-plugin install lipsum
Not found as core plugin.
Not found as maven artifact.
Not found as URL.
Usages:
install name
install groupId:artifactId:version
install file:///name.zip

Why github isn't supported now (5.x)?

@clintongormley
Copy link

Why github isn't supported now (5.x)?

Site plugins are no longer supported, only Java plugins. Site plugins should be reimplemented as Kibana plugins.

@clintongormley
Copy link

It's easy enough to figure out whether the argument looks like a protocol or not, and it would be much friendlier to say "unknown plugin" in this case than "no protocol: foo". Also, the current usage method doesn't mention that you can pass a URL or maven coordinates to install.

@rjernst
Copy link
Member

rjernst commented Jun 15, 2016

I opened #18876 to give a nicer error message. It does not yet force listing out all the acceptable patterns for installing, but that is a broader issue I think we need to address with real usage lines.

rjernst added a commit to rjernst/elasticsearch that referenced this issue Jun 15, 2016
When installing plugins, we first try the elastic download service for
official plugins, then try maven coordinates, and finally try the
argument as a url. This can lead to confusing error messages about
unknown protocols when eg an official plugin name is mispelled. This
change adds a heuristic for determining if the argument in the final
case is in fact a url that we should try, and gives a simplified error
message in the case it is definitely not a url.

closes elastic#17226
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Core/Infra/Plugins Plugin API and infrastructure v5.0.0-alpha4
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants