We've been using the PHP s3 SDK to upload files to s3 for over year now and things have been working swimmingly. Yesterday we started getting 400s intermittently while uploading files. We retry 3 times and pause 5 seconds between tries.
In many cases the retries work, but not always. The 400 we receive from S3 (it's a US standard bucket) have an empty body, so I have no idea where to being in fixing the problem.
We've tried syncing the clock on the machine, as that sometimes causes issues if the clock drifts, but that didn't help either.
Here is a dump of a CFResponse we got back for an error:
S3CFResponse::__set_state(array(
'header' =>
array (
'date' => 'Sun, 24 Nov 2013 21:44:09 GMT',
'server' => 'AmazonS3',
'connection' => 'keep-alive',
'transfer-encoding' => 'chunked',
'_info' =>
array (
'url' => 'https://REDACTED',
'content_type' => NULL,
'http_code' => 400,
'header_size' => 135,
'request_size' => 874,
'filetime' => -1,
'ssl_verify_result' => 0,
'redirect_count' => 0,
'total_time' => 0.350825,
'namelookup_time' => 3.0E-5,
'connect_time' => 0.086817,
'pretransfer_time' => 0.263472,
'size_upload' => 0,
'size_download' => 0,
'speed_download' => 0,
'speed_upload' => 0,
'download_content_length' => -1,
'upload_content_length' => 1959,
'starttransfer_time' => 0.350749,
'redirect_time' => 0,
'certinfo' =>
array (
),
'method' => 'PUT',
),
'x-aws-request-url' => 'REDACTED',
'x-aws-redirects' => 0,
'x-aws-stringtosign' => 'PUT
image/jpeg
Sun, 24 Nov 2013 21:44:09 GMT
x-amz-acl:private
REDACTED',
'x-aws-requestheaders' =>
array (
'Content-Length' => '1959',
'Content-Type' => 'image/jpeg',
'Date' => 'Sun, 24 Nov 2013 21:44:09 GMT',
'Expect' => '100-continue',
'x-amz-acl' => 'private',
'Authorization' => 'AWS REDACTED',
),
),
'body' => false,
'status' => 400,
))).