# Repository S3 plugin amazon\_client\_exception

**URL:** <https://discuss.elastic.co/t/repository-s3-plugin-amazon-client-exception/117126>\
**Category:** Elasticsearch\
**Created:** [January 25, 2018, 9:57pm UTC](https://discuss.elastic.co/t/repository-s3-plugin-amazon-client-exception/117126 "2018-01-25T21:57:59Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmarinm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mmarinm/32/30812_2.png) [@mmarinm](https://discuss.elastic.co/u/mmarinm)\
**Post date:** [January 25, 2018, 9:57pm UTC](https://discuss.elastic.co/t/repository-s3-plugin-amazon-client-exception/117126/1 "2018-01-25T21:57:59Z")

</div>

Hi, I need some help with the issue I am getting when I try to take a snapshot with repository s3 plugin. I can't figure out what is the reason for the error. I don't know Java. But as far as I could understand it seems there is an issue with some internal java issues for the version of java that runs in the elastic container.

Please help me troubleshoot this.

I am using elasticsearch 5.6.4 and repository-s3 5.6.4

When I try to create repository I am getting 500 error more details below:

```auto
{"type":"amazon_client_exception","reason":"Unable to calculate a request signature: Unable to calculate a request signature: Algorithm HmacSHA1 not available","caused_by":{"type":"amazon_client_exception","reason":"Unable to calculate a request signature: Algorithm HmacSHA1 not available","caused_by":{"type":"no_such_algorithm_exception","reason":"Algorithm HmacSHA1 not available"}}}},"status":500

```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 26, 2018, 12:59pm UTC](https://discuss.elastic.co/t/repository-s3-plugin-amazon-client-exception/117126/2 "2018-01-26T12:59:14Z")

</div>

This might indicate a broken installation of the JDK.

What is `java -version` printing?

---

<div class="post-metadata">

**Author:** ![mmarinm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mmarinm/32/30812_2.png) [@mmarinm](https://discuss.elastic.co/u/mmarinm)\
**Post date:** [January 29, 2018, 3:15pm UTC](https://discuss.elastic.co/t/repository-s3-plugin-amazon-client-exception/117126/3 "2018-01-29T15:15:40Z")

</div>

Hi, David thank you for your time and willingness to help.  
 ![19%20AM](https://us1.discourse-cdn.com/elastic/original/3X/f/2/f2b70338d64dc4b75e3d1f206236cf91b2e436f6.png)

And here is my Docker file for elastic:

```
FROM openjdk:8u121-jre-alpine

LABEL maintainer "itzg"

RUN apk -U add bash

ARG ES_VERSION=5.6.4
# avoid conflicts with debian host systems when mounting to host volume
ARG DEFAULT_ES_USER_UID=1100

ADD https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ES_VERSION.tar.gz /tmp
# need to adapt to both Docker's new remote-unpack-ADD behavior and the old behavior
RUN cd /usr/share && \
  if [-f /tmp/elasticsearch-$ES_VERSION.tar.gz]; then \
    tar xf /tmp/elasticsearch-$ES_VERSION.tar.gz; \
    else mv /tmp/elasticsearch-${ES_VERSION} /usr/share; \
    fi && \
  rm -f /tmp/elasticsearch-$ES_VERSION.tar.gz

EXPOSE 9200 9300

HEALTHCHECK --timeout=5s CMD wget -q -O - http://$HOSTNAME:9200/_cat/health

ENV ES_HOME=/usr/share/elasticsearch-$ES_VERSION \
    DEFAULT_ES_USER=elasticsearch \
    DEFAULT_ES_USER_UID=$DEFAULT_ES_USER_UID \
    ES_JAVA_OPTS="-Xms1g -Xmx1g"

RUN adduser -S -s /bin/sh -u $DEFAULT_ES_USER_UID $DEFAULT_ES_USER

VOLUME ["/data","/conf"]

WORKDIR $ES_HOME

COPY java.policy /usr/lib/jvm/java-1.8-openjdk/jre/lib/security/
COPY start /start
COPY log4j2.properties $ES_HOME/config/

CMD ["/start"]
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 29, 2018, 3:40pm UTC](https://discuss.elastic.co/t/repository-s3-plugin-amazon-client-exception/117126/4 "2018-01-29T15:40:51Z")

</div>

What do you have in `java.policy`, `start` and `log4j2.properties`?

Why not using the official elasticsearch docker image?

[https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html)

---

<div class="post-metadata">

**Author:** ![mmarinm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mmarinm/32/30812_2.png) [@mmarinm](https://discuss.elastic.co/u/mmarinm)\
**Post date:** [January 29, 2018, 9:21pm UTC](https://discuss.elastic.co/t/repository-s3-plugin-amazon-client-exception/117126/5 "2018-01-29T21:21:55Z")

</div>

this is a pretty much [repo](https://github.com/itzg/dockerfiles) we are using U can see java.policy and log4j2.properties there.

I wish I can just switch to the official elastic image but that's not the case at the moment. This wasn't my choice but I have to live with it for now.

I changed java.policy in docker file to:

`COPY java.policy /usr/lib/jvm/java-1.10.69-openjdk/jre/lib/security/`

Since that is the version that plugin is using so I thought it might magically fix the issue, but it didn't. Now I am getting different error

 ![57%20PM](https://us1.discourse-cdn.com/elastic/original/3X/d/5/d574a71a431ad887deb6f7fb6591886ef853777a.png)

---

<div class="post-metadata">

**Author:** ![mmarinm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mmarinm/32/30812_2.png) [@mmarinm](https://discuss.elastic.co/u/mmarinm)\
**Post date:** [January 30, 2018, 6:30pm UTC](https://discuss.elastic.co/t/repository-s3-plugin-amazon-client-exception/117126/6 "2018-01-30T18:30:21Z")

</div>

Issue solved, feel free to close

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 30, 2018, 11:44pm UTC](https://discuss.elastic.co/t/repository-s3-plugin-amazon-client-exception/117126/7 "2018-01-30T23:44:41Z")

</div>

COuld you share what the problem was and how you solved it?

---

<div class="post-metadata">

**Author:** ![mmarinm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mmarinm/32/30812_2.png) [@mmarinm](https://discuss.elastic.co/u/mmarinm)\
**Post date:** [January 31, 2018, 10:24pm UTC](https://discuss.elastic.co/t/repository-s3-plugin-amazon-client-exception/117126/8 "2018-01-31T22:24:44Z")

</div>

As I wrote earlier I don't know Java so I can't really identify the real issue. I solved it by trial, error and elimination.

- The first issue I had was with HmacSHA1 signature from the first post.

- My elastic container was working fine before I introduced repository s3. That's when I started to have this issue.

- Once I asked you for help you told me it might be broken installation of JDK, so I figure out, ok it must be that plugin installs something that breaks Java

- At this point, I entered the container and checked what does plugin install exactly. I figured out Java security policy plugin installs is version 1.10.69 and the version elasticsearch is using is 1.8

- So I thought ok that might be an issue and then I changed my docker file and I copied security policy for 1.10.69 and 1.8 which changed the error to MBeanServerPermission

- I tried to do curl request to take a snapshot and it succeeded despite the error in the elastic logs which I found weird

- I did some googling on MBeanServerPermission error and through Github issues, I found that I have to add additional permissions so I added in both policies 1.8 and 1.10.6:

- that fixed the errors

Maybe you will be able to explain me why it worked 🙂

---

<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:** [February 28, 2018, 10:25pm UTC](https://discuss.elastic.co/t/repository-s3-plugin-amazon-client-exception/117126/9 "2018-02-28T22:25:13Z")

</div>

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