Reputation: 21
I'm working in a Command line tool using boto3 in a container running python:3.4 image, In my laptop I can run the code without problem but inside the container I receive the following error:
File "/usr/local/lib/python3.4/site-packages/botocore-1.3.26-py3.4.egg/botocore/client.py", line 310, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/local/lib/python3.4/site-packages/botocore-1.3.26-py3.4.egg/botocore/client.py", line 407, in _make_api_call
raise ClientError(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (AuthFailure) when calling the DescribeInstances operation: AWS was not able to validate the provided access credentials
I've been trying to find the cause of the problem and I found a possible cause in timezone sync on docker, however I tried by changing the time zone but without any success, this is my Dockerfile:
#Docker container image
# Set the base image to use to Ubuntu
FROM python:3.4
MAINTAINER Dave J. Franco <[email protected]>
#Update OS
RUN apt-get update
#testing timezone
ENV TZ=America/Santiago
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
#Project directory
RUN mkdir ufl
#COPY source code
COPY . /ufl
WORKDIR /ufl
#Set permission for ssh keys
RUN chmod 600 -R data/keys
RUN python3 setup.py install
CMD ['ufl']
Upvotes: 0
Views: 1670
Reputation: 21
well I found a way to solve my problem by mapping the site-packages of python from the host machine into the container
ex:
docker run it -v ~/project/.pyenv/lib/python3.4/site-packages:/usr/local/lib/python3.4/site-packages \
davejfranco/python
Upvotes: 0
Reputation: 1255
Check that the server clock is synchronized.
If the clock is delayed, can cause this error:
AWS was not able to validate the provided access credentials
Upvotes: 1