AWS S3 REST API "RequestTimeTooSkewed" Error

Viewed 222

I am attempting to initiate a multipart upload to an s3 bucket directly from the browser by following the corresponding AWS Docs. However, I'm receiving the following response error:

<Error>
   <Code>RequestTimeTooSkewed</Code>
   <Message>The difference between the request time and the current time is too large.</Message>
   <RequestTime>20210105T044520315Z</RequestTime>
   <ServerTime>2021-01-05T04:45:21Z</ServerTime>
   <MaxAllowedSkewMilliseconds>900000</MaxAllowedSkewMilliseconds>
   <RequestId>1CB4A7412B51D</RequestId>
   <HostId>Hb2KatQA+Liv8lfWLW73dRyPUyCjJez/qwelRyV52r8cd2qXR5dBSpPY=</HostId>
</Error>

Am I mistaken or are these times in fact within the 9000 millisecond skew cap in which AWS deems a request time valid?

After console logging the times for better analysis - I can in-fact confirm the discrepancy between client and server times are less than 9000 milliseconds.

**AWS server time** 2021-01-05T04:45:21.000Z

**Client server time** 2021-01-05T04:45:20.544Z

Am I missing something trivial?

1 Answers

Based on the comments.

The issue was due to RequestTime not being in ISO 8601 format, since the format does not use miliseconds. The aws docs also write:

Do not include milliseconds in the time stamp.

Related