Amazon S3 : Carrier Wave : Error : The difference between the request time and the current time is too large.

Error:  Excon::Errors::Forbidden

You have sometime faced this error which you can see in the server log in development or any environment. This mainly concerns with Amazon S3 server or any other servers you rely upon for APIs.

Main Reason:

  • You have changed your system Date – Time by any means
  • You use Virtual Machine to run your operating system in which your development environment run and you have resumed the system from suspension after a while.
  • Your server Date – Time is not configured properly if you have your own server locally (Physically)

Solution

  • Set the system DateTime properly🙂 along with the correct time-zone.
  • Do not forget to restart the web-server and the browser 
Completed 500 Internal Server Error in 29369ms

Excon::Errors::Forbidden (Expected(200) <=> Actual(403 Forbidden)
excon.error.response
 :body => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n
<Error>
  <Code>RequestTimeTooSkewed</Code>
  <Message>The difference between the request time and the current time is too large.</Message>
  <RequestTime>20150616T122928Z</RequestTime>
  <ServerTime>2015-06-16T14:17:22Z</ServerTime>
  <MaxAllowedSkewMilliseconds>900000</MaxAllowedSkewMilliseconds>
  <RequestId>967C4BE62778ED49</RequestId>
  <HostId>amRhZI3rm1WU1M/W3lnmJKBR4evk3Bflh4UqUxRN03KijZf10t1dEaLMLLG5AyFJHM9awXDKk5I=</HostId>
</Error>"
 :headers => {
 "Connection" => "close"
 "Content-Type" => "application/xml"
 "Date" => "Tue, 16 Jun 2015 14:17:20 GMT"
 "Server" => "AmazonS3"
 "x-amz-id-2" => "amxxxxxrm1WU1M/W3lnmJxxxxx3Bflh4UqUxRN03KijZf10t1dEaLMLLG5AyFJHM9awXDKk5I="
 "x-amz-request-id" => "967C4BE62778ED49"
 }
 :local_address => "192.168.xx.xxx"
 :local_port => 55842
 :reason_phrase => "Forbidden"
 :remote_ip => "xx.231.xx.65"
 :status => 403
 :status_line => "HTTP/1.1 403 Forbidden\r\n"
):

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s