# Installing elasticsearch-image plugin from my repository isn't working

**URL:** <https://discuss.elastic.co/t/installing-elasticsearch-image-plugin-from-my-repository-isnt-working/83310>\
**Category:** Elasticsearch\
**Created:** [April 23, 2017, 7:24am UTC](https://discuss.elastic.co/t/installing-elasticsearch-image-plugin-from-my-repository-isnt-working/83310 "2017-04-23T07:24:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abozanona](https://avatars.discourse-cdn.com/v4/letter/a/d78d45/32.png) [@abozanona](https://discuss.elastic.co/u/abozanona)\
**Post date:** [April 23, 2017, 7:24am UTC](https://discuss.elastic.co/t/installing-elasticsearch-image-plugin-from-my-repository-isnt-working/83310/1 "2017-04-23T07:24:05Z")

</div>

I tried to install elasticsearch-image plugin from [https://github.com/kzwang/elasticsearch-image](https://github.com/kzwang/elasticsearch-image) by typing the commands

```
bin/plugin -install com.github.kzwang/elasticsearch-image/1.2.0
sudo service elasticsearch restart

```

And when I tried to index images and search for them I've got this Exception

```
{"error":"MapperParsingException[failed to parse]; nested: NoSuchMethodError[org.elasticsearch.common.io.stream.BytesStreamInput.<init>([BZ)V]; ","status":400}

```

When I checked for this exception I found an issue here that talks about this exception. [https://github.com/kzwang/elasticsearch-image/issues/20](https://github.com/kzwang/elasticsearch-image/issues/20)

As I searched more, I found that the reason why this exception is appearing is because the class `org.elasticsearch.common.io.stream.BytesStreamInput` implementation differs between ElasticSearch 1.3.2 AND ElasticSearch 1.7.2

The plugin is built for ElasticSearch 1.3.2, and it uses the class `BytesStreamInput` in those lines

[https://github.com/kzwang/elasticsearch-image/blob/master/src/main/java/org/elasticsearch/index/mapper/image/ImageMapper.java#L258](https://github.com/kzwang/elasticsearch-image/blob/master/src/main/java/org/elasticsearch/index/mapper/image/ImageMapper.java#L258)

[https://github.com/kzwang/elasticsearch-image/blob/master/src/main/java/org/elasticsearch/index/mapper/image/ImageMapper.java#L344](https://github.com/kzwang/elasticsearch-image/blob/master/src/main/java/org/elasticsearch/index/mapper/image/ImageMapper.java#L344)

[https://github.com/kzwang/elasticsearch-image/blob/master/src/main/java/org/elasticsearch/index/query/image/ImageQueryParser.java#L117](https://github.com/kzwang/elasticsearch-image/blob/master/src/main/java/org/elasticsearch/index/query/image/ImageQueryParser.java#L117)

Which all uses the constructor defined in ElasticSearch 1.3.2

[https://github.com/elastic/elasticsearch/blob/v1.3.2/src/main/java/org/elasticsearch/common/io/stream/BytesStreamInput.java#L52](https://github.com/elastic/elasticsearch/blob/v1.3.2/src/main/java/org/elasticsearch/common/io/stream/BytesStreamInput.java#L52)

But in ElasticSearch 1.7.2 that constructor is removed and replaced by

[https://github.com/elastic/elasticsearch/blob/v1.7.2/src/main/java/org/elasticsearch/common/io/stream/BytesStreamInput.java#L49](https://github.com/elastic/elasticsearch/blob/v1.7.2/src/main/java/org/elasticsearch/common/io/stream/BytesStreamInput.java#L49)

So what I did is forking the project

```
https://github.com/abozanona/elasticsearch-image

```

and removing the second parameter to be like in lines

```
https://github.com/abozanona/elasticsearch-image/blob/master/src/main/java/org/elasticsearch/index/mapper/image/ImageMapper.java#L258

https://github.com/abozanona/elasticsearch-image/blob/master/src/main/java/org/elasticsearch/index/mapper/image/ImageMapper.java#L344

https://github.com/abozanona/elasticsearch-image/blob/master/src/main/java/org/elasticsearch/index/query/image/ImageQueryParser.java#L117

```

Then tried to install the plugin from the forked project

I tried to use this command

```
sudo /usr/share/elasticsearch/bin/plugin --install com.github.abozanona.elasticsearch-image/1.2.1

```

But it gives me this error

```
Failed to install com.github.abozanona.elasticsearch-image/1.2.1, reason: failed to download out of all possible locations

```

I tried also to run this command

```
sudo ./plugin --install readonlyrest --url 'https://github.com/abozanona/elasticsearch-image/archive/1.2.1.zip?raw=true'
OR
sudo ./plugin -install abozanona/elasticsearch-image

```

But it gives me this error

```
Error while installing plugin, reason: IllegalArgumentException: Plugin installation assumed to be site plugin, but contains source code, aborting installation.

```

##My question  
How can I install the modified plugin from [https://github.com/abozanona/elasticsearch-image](https://github.com/abozanona/elasticsearch-image) ?

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [April 28, 2017, 7:54pm UTC](https://discuss.elastic.co/t/installing-elasticsearch-image-plugin-from-my-repository-isnt-working/83310/2 "2017-04-28T19:54:54Z")

</div>

I assume from your description that you are running elasticsearch 1.7.2? The plugin cli back then was considerably lenient and error prone. You should really upgrade to a modern version, for many other reasons than just that.

With that said, you need to actually compile your fork. The zip that you are getting from github is of the sourcecode, and using that method of an autogenerated zip from github was meant specfically for site plugins (which have been removed since 5.0).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 26, 2017, 7:56pm UTC](https://discuss.elastic.co/t/installing-elasticsearch-image-plugin-from-my-repository-isnt-working/83310/3 "2017-05-26T19:56:26Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
