Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon S3 Getting 501 Error on PUT

In testing a new app one tester always has his uploads to S3 fail. We're sending a PUT request of a ~1.2mb file to S3 and setting it's ACL perms. For him, he always gets a 501 - Not Implemented error.

Here are his headers on the request:

"Accept-Encoding" = gzip; 
Authorization = "AWS ###:###";
"Content-Encoding" = gzip;
"Content-Length" = 1420267;
"Content-Type" = "application/octet-stream";
Date = "Thu, 6 Oct 2011 02:59:47 +0000";
"User-Agent" = "MyApp 1.0 (iPhone; iPhone OS 4.3.1; en_US)";
"x-amz-acl" = "public-read-write";

Here are the response headers:

Connection = close;
"Content-Length" = 321;
"Content-Type" = "application/xml";
Date = "Thu, 06 Oct 2011 03:00:14 GMT";
Server = AmazonS3;

Any thoughts are welcome!

Response comes back with status code 501 and string - "A header you provided implies functionality that is not implemented"

like image 750
Brent Avatar asked Oct 06 '11 03:10

Brent


People also ask

How do I fix 501 not implemented?

To fix the 501 not implemented error, you need to disable proxy settings. With Google Chrome, go to the settings, search proxy, and click on Open your computer's proxy settings. Computer proxy settings will open and disable the Automatic and Manual proxy setup. Save the settings and try to re-access your site.

What causes a 501 error?

The HyperText Transfer Protocol (HTTP) 501 Not Implemented server error response code means that the server does not support the functionality required to fulfill the request. This status can also send a Retry-After header, telling the requester when to check back to see if the functionality is supported by then.

What is the largest size file you can transfer to S3 using a put operation?

Individual Amazon S3 objects can range in size from a minimum of 0 bytes to a maximum of 5 TB. The largest object that can be uploaded in a single PUT is 5 GB.

What is put operation in S3?

Adds an object to a bucket. You must have WRITE permissions on a bucket to add an object to it. Amazon S3 never adds partial objects; if you receive a success response, Amazon S3 added the entire object to the bucket.


1 Answers

501 response code from Amazon may be sent if no Content-Length is supplied.

Since you are saying that you do, I suggest running the request through a proxy ( Charles for Mac or Fiddler for Windows) and making sure that the request that's being sent actually includes the Content-Length header

like image 124
Alon Burg Avatar answered Oct 14 '22 09:10

Alon Burg