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

Installing plugin without checksums ends up downloading from github #13197

Merged
merged 1 commit into from
Aug 29, 2015

Conversation

dadoonet
Copy link
Member

bin/plugin install lmenezes/elasticsearch-kopf/develop
-> Installing lmenezes/elasticsearch-kopf/develop...
Trying http://download.elastic.co/lmenezes/elasticsearch-kopf/elasticsearch-kopf-develop.zip ...
Trying http://search.maven.org/remotecontent?filepath=lmenezes/elasticsearch-kopf/develop/elasticsearch-kopf-develop.zip ...
Trying https://oss.sonatype.org/service/local/repositories/releases/content/lmenezes/elasticsearch-kopf/develop/elasticsearch-kopf-develop.zip ...
Trying https://github.com/lmenezes/elasticsearch-kopf/archive/develop.zip ...
Downloading .................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................DONE
Verifying https://github.com/lmenezes/elasticsearch-kopf/archive/develop.zip checksums if available ...
Trying https://github.com/lmenezes/elasticsearch-kopf/archive/master.zip ...
Downloading ....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................DONE
Verifying https://github.com/lmenezes/elasticsearch-kopf/archive/master.zip checksums if available ...

This happens because we don't have anymore ElasticsearchWrapperException here but standard java exceptions.

Closes #13196.

@s1monw
Copy link
Contributor

s1monw commented Aug 29, 2015

I think we should remove that catch block altogether and just rethrow the first exception from the HttpDownloadHelper instead of wrapping it in yet another IOException

@dadoonet
Copy link
Member Author

@s1monw I pushed a new commit.

@@ -153,7 +150,7 @@ public boolean downloadAndVerifyChecksum(URL checksumURL, Path originalFile, Pat
// checksum file doesn't exist
return false;
} catch (IOException e) {
if (ExceptionsHelper.unwrapCause(e) instanceof FileNotFoundException) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can remove the entire catch (IOException e) block here it's already handled correctly above

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. That was stupid keeping that.

@s1monw
Copy link
Contributor

s1monw commented Aug 29, 2015

left another comment

@@ -378,9 +369,6 @@ private URLConnection openConnection(URL aSource) throws IOException {
responseCode == HttpURLConnection.HTTP_MOVED_TEMP ||
responseCode == HttpURLConnection.HTTP_SEE_OTHER) {
String newLocation = httpConnection.getHeaderField("Location");
String message = aSource
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@s1monw I removed also this because it's not used in our code. It's unrelated to the change though.

@dadoonet
Copy link
Member Author

@s1monw pushed another commit.

@s1monw
Copy link
Contributor

s1monw commented Aug 29, 2015

LGTM

@dadoonet dadoonet force-pushed the fix/13196-pluginmanager-checksum branch from 998347d to 0df3a90 Compare August 29, 2015 20:59
```sh
bin/plugin install lmenezes/elasticsearch-kopf/develop
-> Installing lmenezes/elasticsearch-kopf/develop...
Trying http://download.elastic.co/lmenezes/elasticsearch-kopf/elasticsearch-kopf-develop.zip ...
Trying http://search.maven.org/remotecontent?filepath=lmenezes/elasticsearch-kopf/develop/elasticsearch-kopf-develop.zip ...
Trying https://oss.sonatype.org/service/local/repositories/releases/content/lmenezes/elasticsearch-kopf/develop/elasticsearch-kopf-develop.zip ...
Trying https://github.com/lmenezes/elasticsearch-kopf/archive/develop.zip ...
Downloading .................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................DONE
Verifying https://github.com/lmenezes/elasticsearch-kopf/archive/develop.zip checksums if available ...
Trying https://github.com/lmenezes/elasticsearch-kopf/archive/master.zip ...
Downloading ....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................DONE
Verifying https://github.com/lmenezes/elasticsearch-kopf/archive/master.zip checksums if available ...
```

This happens because we don't have anymore ElasticsearchWrapperException here but standard java exceptions.

Closes elastic#13196.
@dadoonet dadoonet force-pushed the fix/13196-pluginmanager-checksum branch from 0df3a90 to 03bb285 Compare August 29, 2015 21:01
@dadoonet dadoonet merged commit 03bb285 into elastic:master Aug 29, 2015
@dadoonet dadoonet removed the review label Aug 29, 2015
@dadoonet dadoonet deleted the fix/13196-pluginmanager-checksum branch August 29, 2015 21:03
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 v2.0.0-beta2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants