On Sep 7, 10:34 am, Mitchell Garnaat <
mi...@garnaat.com> wrote:
> If the request is a HEAD, there shouldn't be anything in the buffer. What
> data do you see in there when the connection is used the next time?
I agree, but it looks like something is there. Following is a dump of
my debugging logs. I've got debugging turned on and print statements
all over the place chasing this down. I've stuck print statements in
the following files:
/usr/lib/python2.6/httplib.py <-- read() function
/usr/lib/python2.5/site-packages/boto/s3/bucket.py <-- get_key()
function
/usr/lib/python2.5/site-packages/boto/s3/key.py <-- sender() function
The filename I'm using is "aaa2f45f0c07acbdc7484d2e7402c56855deec84"
and the script is the one I included in my original message. All the
XXX: prefixed lines are my debug output stating function and the
variable names or area around where I'm looking at. Thanks for looking
at this with me!
Here we go:
$ ./s3upload.py
getting bucket...
send: 'GET /services/Walrus/upload-test/?&max-keys=0 HTTP/1.1\r\nHost:
192.168.69.44:8773\r\nAccept-Encoding: identity\r\nDate: Wed, 07 Sep
2011 15:06:13 GMT\r\nContent-Length: 0\r\nAuthorization: AWS
WKy3rMzOWPouVOxK1p3Ar1C2uRBwa2FBXnCw:slrFN9sEvMlr1dJV6HzxKnjQJec=\r
\nUser-Agent: Boto/2.0 (linux2)\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Length: 269
header: Content-Type: application/xml
XXX: HTTPResponse.read() method = GET
XXX: HTTPResponse.read() length = 269
XXX: HTTPResponse.read() content-length = 269
XXX: HTTPResponse.read() chunked = 0
XXX: HTTPResponse.read() amt = None
XXX: HTTPResponse.read() amd is None
XXX: HTTPResponse.read() self.length is NOT None
XXX: _safe_read()
XXX: HTTPResponse.read() self.close()
XXX: HTTPResponse.read() s = <ListBucketResponse xmlns="http://
s3.amazonaws.com/doc/2006-03-01/" xmlns:xsi="
http://www.w3.org/2001/
XMLSchema-instance"><ListBucketResponse><Name>upload-test</
Name><Prefix/><MaxKeys>0</MaxKeys><IsTruncated>false</IsTruncated></
ListBucketResponse></ListBucketResponse>
getting key...
send: 'HEAD /services/Walrus/upload-test/
aaa2f45f0c07acbdc7484d2e7402c56855deec84 HTTP/1.1\r\nHost:
192.168.69.44:8773\r\nAccept-Encoding: identity\r\nDate: Wed, 07 Sep
2011 15:06:13 GMT\r\nContent-Length: 0\r\nAuthorization: AWS
WKy3rMzOWPouVOxK1p3Ar1C2uRBwa2FBXnCw:+jlJpml8wKWUK7rfSP8gfkAZFlg=\r
\nUser-Agent: Boto/2.0 (linux2)\r\n\r\n'
reply: 'HTTP/1.1 404 Not Found\r\n'
header: Content-Length: 315
header: Content-Type: application/xml
XXX get_key(): 404 response._method = HEAD
XXX get_key(): 404 response._method = NOTHEAD
XXX: HTTPResponse.read() method = NOTHEAD
XXX: HTTPResponse.read() length = 0
XXX: HTTPResponse.read() content-length = 315
XXX: HTTPResponse.read() chunked = 0
XXX: HTTPResponse.read() amt = None
XXX: HTTPResponse.read() amd is None
XXX: HTTPResponse.read() self.length is NOT None
XXX: _safe_read()
XXX: HTTPResponse.read() self.close()
XXX: HTTPResponse.read() s =
XXX get_key(): 404 response.read() =
did not get s3key, setting key to
aaa2f45f0c07acbdc7484d2e7402c56855deec84
setting contents...
send: 'PUT /services/Walrus/upload-test/
aaa2f45f0c07acbdc7484d2e7402c56855deec84 HTTP/1.1\r\nHost:
192.168.69.44:8773\r\nAccept-Encoding: identity\r\nContent-Length: 20\r
\nContent-MD5: L+acLlvxvF93SnrCrmEz5Q==\r\nExpect: 100-Continue\r
\nDate: Wed, 07 Sep 2011 15:06:13 GMT\r\nUser-Agent: Boto/2.0
(linux2)\r\nContent-Type: application/octet-stream\r\nAuthorization:
AWS WKy3rMzOWPouVOxK1p3Ar1C2uRBwa2FBXnCw:8acJbV4lC94qU0DPrw9bOObpZKc=\r
\n\r\n'
XXX: HTTPResponse.read() method = PUT
XXX: HTTPResponse.read() length = None
XXX: HTTPResponse.read() content-length = None
XXX: HTTPResponse.read() chunked = 0
XXX: HTTPResponse.read() amt = None
XXX: HTTPResponse.read() amd is None
XXX: HTTPResponse.read() self.length is None
--- 30 second wait here at the self.fd.read() call ---
XXX: HTTPResponse.read() self.close()
XXX: HTTPResponse.read() s = <Error xmlns="
http://s3.amazonaws.com/doc/
2006-03-01/" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-
instance"><Code>NoSuchEntity</Code><Message>The specified entity was
not found</Message><Resource>aaa2f45f0c07acbdc7484d2e7402c56855deec84</
Resource><RequestId>37c84ee1-8e3a-4ee6-99e4-beea96f07243</RequestId></
Error>HTTP/1.1 200 OK
Content-Length: 293
Content-Type: application/xml
ETag: "2fe69c2e5bf1bc5f774a7ac2ae6133e5"
Last-Modified: 2011-09-07T15:06:01.000Z
<PutObjectResponse xmlns="
http://s3.amazonaws.com/doc/2006-03-01/"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-
instance"><PutObjectResponse><ETag>2fe69c2e5bf1bc5f774a7ac2ae6133e5</
ETag><LastModified>2011-09-07T15:06:01.000Z</LastModified><Size>20</
Size></PutObjectResponse></PutObjectResponse>HTTP/1.1 408 Request
Timeout
Content-Type: text/plain; charset=UTF-8
Failure: 408 Request Timeout
XXX: sender() body = <Error xmlns="
http://s3.amazonaws.com/doc/
2006-03-01/" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-
instance"><Code>NoSuchEntity</Code><Message>The specified entity was
not found</Message><Resource>aaa2f45f0c07acbdc7484d2e7402c56855deec84</
Resource><RequestId>37c84ee1-8e3a-4ee6-99e4-beea96f07243</RequestId></
Error>HTTP/1.1 200 OK
Content-Length: 293
Content-Type: application/xml
ETag: "2fe69c2e5bf1bc5f774a7ac2ae6133e5"
Last-Modified: 2011-09-07T15:06:01.000Z
<PutObjectResponse xmlns="
http://s3.amazonaws.com/doc/2006-03-01/"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-
instance"><PutObjectResponse><ETag>2fe69c2e5bf1bc5f774a7ac2ae6133e5</
ETag><LastModified>2011-09-07T15:06:01.000Z</LastModified><Size>20</
Size></PutObjectResponse></PutObjectResponse>HTTP/1.1 408 Request
Timeout
Content-Type: text/plain; charset=UTF-8
Failure: 408 Request Timeout
Traceback (most recent call last):
File "./s3upload.py", line 45, in <module>
s3key.set_contents_from_string('This is a test of S3')
File "/usr/lib/python2.6/dist-packages/boto/s3/key.py", line 886, in
set_contents_from_string
policy, md5, reduced_redundancy)
File "/usr/lib/python2.6/dist-packages/boto/s3/key.py", line 766, in
set_contents_from_file
self.send_file(fp, headers, cb, num_cb, query_args)
File "/usr/lib/python2.6/dist-packages/boto/s3/key.py", line 567, in
send_file
query_args=query_args)
File "/usr/lib/python2.6/dist-packages/boto/s3/connection.py", line
423, in make_request
override_num_retries=override_num_retries)
File "/usr/lib/python2.6/dist-packages/boto/connection.py", line
783, in make_request
return self._mexe(http_request, sender, override_num_retries)
File "/usr/lib/python2.6/dist-packages/boto/connection.py", line
703, in _mexe
request.body, request.headers)
File "/usr/lib/python2.6/dist-packages/boto/s3/key.py", line 534, in
sender
'ETag from S3 did not match computed MD5: %s != %s' % ( self.etag,
self.md5 ) )
boto.exception.S3DataError: BotoClientError: ETag from S3 did not
match computed MD5: None != 2fe69c2e5bf1bc5f774a7ac2ae6133e5