S3 RequestTimeTooSkewed error due to local machine's clock skew
Asked Answered
T

5

5

While working on my local machine I have been trying to upload images (which uploads them immediately to the amazon server), but it was giving me a bug (RequestTimeTooSkewed Error using PHP S3 Class), I could figure out that it's a time zone issue and that S3 uses the current time zone to authenticate request, do I need to set up or change any configuration on the EC2 server to be able to upload images locally?

Tephrite answered 13/3, 2013 at 11:34 Comment(1)
It doesn't mention S3 RequestTimeTooSkewed, but same issue as How to force a clock update using ntp?Huberthuberto
T
6

Sync your clock with an NTP time server. All modern OS's support this.

Wherever you're uploading from is the machine that needs to be synced.

Timms answered 13/3, 2013 at 16:48 Comment(1)
You can find a list of NTP servers here: pool.ntp.org/en/use.html And you can run this from your source machine sudo ntpdate 0.pool.ntp.orgDeviation
P
3

Check your time synchronization on your ec2 instance. Due to the nature of virtual machines, the clock can skew over time. S3 does not allow requests that are more than a few minutes off.

Pyrazole answered 13/3, 2013 at 12:48 Comment(0)
F
1

Running code from a virtual machine, had to do sudo ntpdate ntp.ubuntu.com to sync, and it worked.

Fiesta answered 4/7, 2014 at 1:51 Comment(0)
H
1

Restarting the ntp service usually fixes this:

sudo service ntpd restart

See also: How to force a clock update using ntp?

Huberthuberto answered 27/8, 2014 at 23:14 Comment(0)
G
0

sudo ntpdate -s time.nist.gov

This will set your local machines time to current time... you can change your timezone after local time is correct.

Gazetteer answered 28/3, 2019 at 4:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.