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

Attempting to make AWS API request from boot2docker container results in failure due to RequestTimeTooSkewed #469

Closed
karlgrz opened this Issue Aug 6, 2014 · 9 comments

Comments

Projects
None yet
9 participants
@karlgrz
Copy link

karlgrz commented Aug 6, 2014

I replicated this in boot2docker, but the container built from the same Dockerfile on vagrant ubuntu 14.04 yields successful results.

When building the container on boot2docker, the time between the host and the container ends up being approximately 8 minutes off. Thus, any requests to the AWS API fail from the RequestTimeTooSkewed error.

I'd be happy to provide more details if necessary.

Traceback (most recent call last):
  File "application.py", line 11, in <module>
    from tsa import application
  File "/src/tsa/__init__.py", line 49, in <module>
    bucket = s3conn.create_bucket(BUCKET_NAME)
  File "/usr/local/lib/python2.7/dist-packages/boto/s3/connection.py", line 615, in create_bucket
    response.status, response.reason, body)
boto.exception.S3ResponseError: S3ResponseError: 403 Forbidden
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>RequestTimeTooSkewed</Code><Message>The difference between the request time and the current time is too large.</Message><MaxAllowedSkewMilliseconds>900000</MaxAllowedSkewMilliseconds><RequestId>redacted</RequestId><HostId>redacted</HostId><RequestTime>Wed, 06 Aug 2014 02:17:06 GMT</RequestTime><ServerTime>2014-08-06T17:36:03Z</ServerTime></Error>
@SvenDowideit

This comment has been minimized.

Copy link
Contributor

SvenDowideit commented Aug 6, 2014

We have some changes that may help going into boot2docker 1.2.0, see #486 for more :)

@tiborvass

This comment has been minimized.

Copy link

tiborvass commented Sep 22, 2014

@SvenDowideit I still see this with 1.2.0. I just restarted not long ago the VM and there's already time skew:

$ date -u; b2d ssh date -u
Mon Sep 22 14:43:49 UTC 2014
Warning: Permanently added '[localhost]:2022' (RSA) to the list of known hosts.
Mon Sep 22 14:43:44 UTC 2014
$ ps aux | grep ntp | grep -v grep
  737 root     /usr/local/bin/ntpclient -l -h pool.ntp.org

I'm not sure what's going on :(

@SvenDowideit

This comment has been minimized.

Copy link
Contributor

SvenDowideit commented Oct 7, 2014

This causes much pain - @tianon do you guys have time to figure this out?

@tianon

This comment has been minimized.

Copy link
Contributor

tianon commented Oct 9, 2014

There have been some ntpclient changes somewhat recently - has anyone tested since we merged those fixes to see if they improved this particular issue, or whether we need to do more digging?

At least for the VirtualBox case, we could improve this by getting a 64bit userspace (boot2docker/boot2docker-cli#264) and thus let the Guest Additions do the time sync (and then we get it for free without NTP), which might not be a bad stop-gap.

@tingletech

This comment has been minimized.

Copy link

tingletech commented Oct 17, 2014

I'm seeing the same thing -- can't use aws s3 ... because it complains of clock skew...

date -u; boot2docker ssh date -u; boot2docker version; docker version
Fri Oct 17 16:36:07 UTC 2014
Fri Oct 17 03:37:44 UTC 2014
Boot2Docker-cli version: v1.3.0
Git commit: deafc19
Client version: 1.2.0
Client API version: 1.14
Go version (client): go1.3.1
Git commit (client): fa7b24f
OS/Arch (client): darwin/amd64
Server version: 1.3.0
Server API version: 1.15
Go version (server): go1.3.3
Git commit (server): c78088f

This seems to be a workaround to use aws commands

boot2docker ssh sudo date -u -D %Y%m%dT%T --set="$(date -u +%Y%m%dT%T)"

@SvenDowideit SvenDowideit added this to the 1.3.1 milestone Oct 20, 2014

@tianon tianon modified the milestone: 1.3.1 Oct 23, 2014

@chancefeick

This comment has been minimized.

Copy link

chancefeick commented Nov 21, 2014

My docker container is a Rails 4.1 app using the aws-sdk gem. I ran into this error as well.

@tingletech solution worked for me:

boot2docker ssh sudo date -u -D %Y%m%dT%T --set="$(date -u +%Y%m%dT%T)"
@rguldener

This comment has been minimized.

Copy link

rguldener commented Dec 1, 2014

Running 1.3.2 and this is definitely still an issue, had to manually adjust the clock three times today (skew appears to get worse/clock appears to be still when the physical device sleeps).

Versions output:

$ boot2docker version; docker version
Boot2Docker-cli version: v1.3.2
Git commit: e41a9ae
Client version: 1.3.2
Client API version: 1.15
Go version (client): go1.3.3
Git commit (client): 39fa2fa
OS/Arch (client): darwin/amd64
Server version: 1.3.2
Server API version: 1.15
Go version (server): go1.3.3
Git commit (server): 39fa2fa

Running boot2docker on OS X 10.10

@SvenDowideit SvenDowideit added this to the 1.4.0 milestone Dec 3, 2014

@SvenDowideit SvenDowideit modified the milestones: v1.5.0, 1.4.0 Dec 16, 2014

@treeder

This comment has been minimized.

Copy link

treeder commented Dec 17, 2014

Probably a dupe of this: #290

And #661 appears to be the fix.

@yosifkit

This comment has been minimized.

Copy link
Contributor

yosifkit commented Oct 21, 2016

Fixed by #661. If you feel this issue was closed prematurely, please comment and let us know.

@yosifkit yosifkit closed this Oct 21, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment