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?

Kara
  • 6,115
  • 16
  • 50
  • 57
Mainhattan
  • 51
  • 1
  • 2
  • It doesn't mention S3 *RequestTimeTooSkewed*, but same issue as [How to force a clock update using ntp?](http://askubuntu.com/questions/254826/how-to-force-a-clock-update-using-ntp) – smci Aug 27 '14 at 23:15

5 Answers5

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.

Ryan Parman
  • 6,855
  • 1
  • 29
  • 43
  • 1
    You can find a list of NTP servers here: http://www.pool.ntp.org/en/use.html And you can run this from your source machine ```sudo ntpdate 0.pool.ntp.org``` – plainjimbo Aug 06 '13 at 22:51
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.

datasage
  • 19,153
  • 2
  • 48
  • 54
1

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

Yuri Astrakhan
  • 8,808
  • 6
  • 63
  • 97
1

Restarting the ntp service usually fixes this:

sudo service ntpd restart

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

Community
  • 1
  • 1
smci
  • 32,567
  • 20
  • 113
  • 146
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.