Jorge B.
Jorge B.

Reputation: 1213

Upload to AWS S3 limits

I'm working with the Amazon S3 and the AWS SDK for PHP. Is there a file size limit to upload files? Is there a simultaneous files upload limit?

It has given me a lot of these errors when I try to send 20 files with 200MB at a time for my bucket:

RequestTimeTooSkewedException: AWS Error Code: RequestTimeTooSkewed, Status Code: 403, AWS Request ID: 0CE24AEDE4162AC9, AWS Error Type: client, AWS Error Message: The difference between the request time and the current time is too large.

RequestTimeoutException: AWS Error Code: RequestTimeout, Status Code: 400, AWS Request ID: 913367E51F2BC5AD, AWS Error Type: client, AWS Error Message: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.

Or the problem is in my code or PHP?

Upvotes: 0

Views: 2926

Answers (3)

jatinkumar patel
jatinkumar patel

Reputation: 2990

It is giving this error?

<Error><Code>RequestTimeTooSkewed</Code><Message>The difference between the requ
est time and the current time is too large.</Message><RequestTime>Wed, 08 Apr 20
15 11:50:58 GMT</RequestTime><ServerTime>2015-04-07T11:51:03Z</ServerTime><MaxAl
lowedSkewMilliseconds>900000</MaxAllowedSkewMilliseconds><RequestId>255BFB2CF336
1F0D</RequestId><HostId>DlpwnpVVH9aQku8qD8sAaO6tFCBlrfr9P2Sl3jbBd7FKXbzsJ1SJAwqR
OsNf+2qdSSKElK3mbus=</HostId></Error>

In error you can see requesttime and servier time is different, It must be same. So please check your local pc time and date.

Upvotes: 0

Jeremy Lindblom
Jeremy Lindblom

Reputation: 6517

It seems like your network connection may not fast enough to upload a file that size in one shot. RequestTimeTooSkewedException errors can happen due to out of sync clocks as helloV mentioned. However, if the upload takes too long, the time that the request is signed and the time that the request is completed may be more than 15 minutes apart, which would also cause this error. I suspect this may be happening, because the second error, RequestTimeoutException, is most likely happening because your connection to S3 is too slow.

You either need a better connection or you should consider using the multipart upload API. There are helpers for this: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/service-s3.html#uploading-large-files-using-multipart-uploads

Upvotes: 2

helloV
helloV

Reputation: 52375

As of now the size limit is 5 TB and your 200MB is well within the max size.

The problem is your local box's system clock is out of sync. Sync up with an NTP server or set it manually and the problem will go away.

For the second error, it is possible you are specifying the file size that is greater than the actual size. If your file size is 200MB, it is possible you are passing a value greater than 200MB in the API.

Upvotes: 1

Related Questions