408 Timeout with Eucalyptus 1.6.2 and current Boto

47 views
Skip to first unread message

Tony

unread,
Sep 6, 2011, 5:21:43 PM9/6/11
to boto-dev
Hello list,

I'm running UEC on Lucid (Eucalyptus v1.6.2) and am using the current
git version of boto. When I try to upload a file to Walrus and if the
key doesn't already exist, I get a 30 second timeout and an "ETag from
S3 did not match computed MD5" error which is reported with an HTTP
408 timeout.

When I turn on boto debugging and print out the output from the
response.read() in the sender() function I see what appears to be two
separate responses in the body. One is a 200 response containing an
API Error about the specified entity being not found and the second is
a 408 response containing a PutObjectResponse message with a correct
ETag. There are what look like valid Content-Length and ETag headers
included in the body for the messages. If I had to guess, I'd say the
body is still present from the previous HEAD request. However, the
code in connection.py looks to be doing a response.read() to toss the
contents and clear the buffer.

If the specified key already exists in Walrus, the upload script works
as expected; it returns almost instantly and correctly updates the
contents as requested. Other functions to list and delete content all
work as expected as well.

According to the Eucalyptus logs, the PUT completed almost instantly
and it never reports anything else related to the Walrus connection.
I've been tracing my code all afternoon and can't seem to see what I'm
doing wrong.

I've attached my test script just in case someone sees something I'm
missing.

Tony

---

#!/usr/bin/python

import boto
from boto.s3.key import Key

ACCESS = 'key goes here'
SECRET = 'secret goes here'
FILENAME = 'file.txt'

# Turn on debugging
if not boto.config.has_section('Boto'):
boto.config.add_section('Boto')
boto.config.set('Boto', 'debug', '2')

print "connecting to walrus..."
walrus = boto.connect_walrus( '192.168.69.44',
aws_access_key_id=ACCESS,
aws_secret_access_key=SECRET,
port=8773,
path='/services/Walrus',
is_secure=False,
)

print "getting bucket..."
bucket = walrus.get_bucket('upload-test')

print "getting key..."
s3key = bucket.get_key( FILENAME )

if s3key:
print "found existing s3key: %s" % ( s3key.name )
print "setting contents..."
#s3key.set_contents_from_filename( FILENAME )
s3key.set_contents_from_string('This is a test of S3')
print "setting acl..."
s3key.set_acl('public-read')
print "done!"

else:
print "did not find s3key, setting key to %s" % ( FILENAME )
s3key = Key(bucket)
s3key.key = FILENAME
print "setting contents..."
#s3key.set_contents_from_filename( FILENAME )
s3key.set_contents_from_string('This is a test of S3')
print "setting acl..."
s3key.set_acl('public-read')
print "done!"

# End

Tony

unread,
Sep 7, 2011, 10:26:06 AM9/7/11
to boto-dev
Got more info... looks like HTTPResponse sets the length to zero if
the method is HEAD, but the content-length header is still set to 315
in my case. Unfortunately, when it zeros the length out it doesn't
actually clear the connection buffer. Since the connection pooling
stuff is reusing the connection, the data is still there on the next
read.

I'm looking at the put_http_connection function to see if it is
possible to throw away the buffer there, but I don't want to step on
any magic in there that I don't understand. Could someone help me
verify this issue?

Tony

Mitchell Garnaat

unread,
Sep 7, 2011, 10:34:50 AM9/7/11
to boto...@googlegroups.com
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?

Tony

unread,
Sep 7, 2011, 12:28:42 PM9/7/11
to boto-dev
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

Tony

unread,
Sep 7, 2011, 12:31:59 PM9/7/11
to boto-dev
FYI, changing the request._method to NOTHEAD was to try force a read()
in HTTPRequest. It had no affect one way or the other.

Mitchell Garnaat

unread,
Sep 7, 2011, 12:35:35 PM9/7/11
to boto...@googlegroups.com
I'm wondering if this is an issue with Walrus in 1.6.2.  I'm checking on that now.  Have you tried the same thing against S3?

Mitch

Mitchell Garnaat

unread,
Sep 7, 2011, 12:42:57 PM9/7/11
to boto...@googlegroups.com
Yes, it is indeed a bug in Walrus.  Now, to try to come up with a workaround.  BTW, in case you were wondering, this kind of stuff is one of the reasons boto/connection.py is so ugly 8^)

Mitch

Tony

unread,
Sep 7, 2011, 12:45:45 PM9/7/11
to boto-dev
On Sep 7, 12:35 pm, Mitchell Garnaat <mi...@garnaat.com> wrote:
> I'm wondering if this is an issue with Walrus in 1.6.2.  I'm checking on
> that now.  Have you tried the same thing against S3?

No, I don't have an S3 account, but I can create one if you think it
is worth trying.

FYI, I've verified that the HEAD request is getting content returned
using the network protocol analyzer tshark:


HEAD REQUEST:

Transmission Control Protocol, Src Port: 35373 (35373), Dst Port: 8773
(8773), Seq: 285, Ack: 341, Len: 313
Source port: 35373 (35373)
Destination port: 8773 (8773)
[Stream index: 0]
Sequence number: 285 (relative sequence number)
[Next sequence number: 598 (relative sequence number)]
Acknowledgement number: 341 (relative ack number)
Header length: 32 bytes
Flags: 0x18 (PSH, ACK)
0... .... = Congestion Window Reduced (CWR): Not set
.0.. .... = ECN-Echo: Not set
..0. .... = Urgent: Not set
...1 .... = Acknowledgement: Set
.... 1... = Push: Set
.... .0.. = Reset: Not set
.... ..0. = Syn: Not set
.... ...0 = Fin: Not set
Window size: 6912 (scaled)
Checksum: 0x270a [validation disabled]
[Good Checksum: False]
[Bad Checksum: False]
Options: (12 bytes)
NOP
NOP
Timestamps: TSval 24562642, TSecr 50690120
[SEQ/ACK analysis]
[Number of bytes in flight: 313]
Data (313 bytes)


0000 48 45 41 44 20 2f 73 65 72 76 69 63 65 73 2f 57 HEAD /services/
W
0010 61 6c 72 75 73 2f 75 70 6c 6f 61 64 2d 74 65 73 alrus/upload-
tes
0020 74 2f 61 61 61 32 66 34 35 66 30 63 30 37 61 63 t/
aaa2f45f0c07ac
0030 62 64 63 37 34 38 34 64 32 65 37 34 30 32 63 35
bdc7484d2e7402c5
0040 36 38 35 35 64 65 65 63 38 34 20 48 54 54 50 2f 6855deec84
HTTP/
0050 31 2e 31 0d 0a 48 6f 73 74 3a 20 31 39 32 2e 31 1.1..Host:
192.1
0060 36 38 2e 36 39 2e 34 34 3a 38 37 37 33 0d 0a 41
68.69.44:8773..A
0070 63 63 65 70 74 2d 45 6e 63 6f 64 69 6e 67 3a 20 ccept-
Encoding:
0080 69 64 65 6e 74 69 74 79 0d 0a 44 61 74 65 3a 20
identity..Date:
0090 57 65 64 2c 20 30 37 20 53 65 70 20 32 30 31 31 Wed, 07 Sep
2011
00a0 20 31 36 3a 34 30 3a 35 36 20 47 4d 54 0d 0a 43 16:40:56
GMT..C
00b0 6f 6e 74 65 6e 74 2d 4c 65 6e 67 74 68 3a 20 30 ontent-Length:
0
00c0 0d 0a 41 75 74 68 6f 72 69 7a 61 74 69 6f 6e
3a ..Authorization:
00d0 20 41 57 53 20 57 4b 79 33 72 4d 7a 4f 57 50 6f AWS
WKy3rMzOWPo
00e0 75 56 4f 78 4b 31 70 33 41 72 31 43 32 75 52 42
uVOxK1p3Ar1C2uRB
00f0 77 61 32 46 42 58 6e 43 77 3a 6f 70 68 53 69 4c
wa2FBXnCw:ophSiL
0100 34 45 37 2f 56 42 2b 69 31 75 69 2b 47 4c 4d 2b 4E7/VB+i1ui+GLM
+
0110 43 2b 54 6d 45 3d 0d 0a 55 73 65 72 2d 41 67 65 C+TmE=..User-
Age
0120 6e 74 3a 20 42 6f 74 6f 2f 32 2e 30 20 28 6c 69 nt: Boto/2.0
(li
0130 6e 75 78 32 29 0d 0a 0d 0a nux2)....
Data: 48454144202F73657276696365732F57616C7275732F7570...
[Length: 313]



HEAD RESPONSE:



Transmission Control Protocol, Src Port: 8773 (8773), Dst Port: 35373
(35373), Seq: 341, Ack: 598, Len: 393
Source port: 8773 (8773)
Destination port: 35373 (35373)
[Stream index: 0]
Sequence number: 341 (relative sequence number)
[Next sequence number: 734 (relative sequence number)]
Acknowledgement number: 598 (relative ack number)
Header length: 32 bytes
Flags: 0x18 (PSH, ACK)
0... .... = Congestion Window Reduced (CWR): Not set
.0.. .... = ECN-Echo: Not set
..0. .... = Urgent: Not set
...1 .... = Acknowledgement: Set
.... 1... = Push: Set
.... .0.. = Reset: Not set
.... ..0. = Syn: Not set
.... ...0 = Fin: Not set
Window size: 7936 (scaled)
Checksum: 0x40cb [validation disabled]
[Good Checksum: False]
[Bad Checksum: False]
Options: (12 bytes)
NOP
NOP
Timestamps: TSval 50690124, TSecr 24562642
[SEQ/ACK analysis]
[Number of bytes in flight: 393]

Data (393 bytes)

0000 48 54 54 50 2f 31 2e 31 20 34 30 34 20 4e 6f 74 HTTP/1.1 404
Not
0010 20 46 6f 75 6e 64 0d 0a 43 6f 6e 74 65 6e 74 2d
Found..Content-
0020 4c 65 6e 67 74 68 3a 20 33 31 35 0d 0a 43 6f 6e Length:
315..Con
0030 74 65 6e 74 2d 54 79 70 65 3a 20 61 70 70 6c 69 tent-Type:
appli
0040 63 61 74 69 6f 6e 2f 78 6d 6c 0d 0a 0d 0a 3c 45 cation/
xml....<E
0050 72 72 6f 72 20 78 6d 6c 6e 73 3d 22 68 74 74 70 rror
xmlns="http
0060 3a 2f 2f 73 33 2e 61 6d 61 7a 6f 6e 61 77 73 2e ://
s3.amazonaws.
0070 63 6f 6d 2f 64 6f 63 2f 32 30 30 36 2d 30 33 2d com/doc/
2006-03-
0080 30 31 2f 22 20 78 6d 6c 6e 73 3a 78 73 69 3d 22 01/"
xmlns:xsi="
0090 68 74 74 70 3a 2f 2f 77 77 77 2e 77 33 2e 6f 72 http://www.w3.or
00a0 67 2f 32 30 30 31 2f 58 4d 4c 53 63 68 65 6d 61 g/2001/
XMLSchema
00b0 2d 69 6e 73 74 61 6e 63 65 22 3e 3c 43 6f 64 65 -
instance"><Code
00c0 3e 4e 6f 53 75 63 68 45 6e 74 69 74 79 3c 2f 43 >NoSuchEntity</
C
00d0 6f 64 65 3e 3c 4d 65 73 73 61 67 65 3e 54 68 65
ode><Message>The
00e0 20 73 70 65 63 69 66 69 65 64 20 65 6e 74 69 74 specified
entit
00f0 79 20 77 61 73 20 6e 6f 74 20 66 6f 75 6e 64 3c y was not
found<
0100 2f 4d 65 73 73 61 67 65 3e 3c 52 65 73 6f 75 72 /
Message><Resour
0110 63 65 3e 61 61 61 32 66 34 35 66 30 63 30 37 61
ce>aaa2f45f0c07a
0120 63 62 64 63 37 34 38 34 64 32 65 37 34 30 32 63
cbdc7484d2e7402c
0130 35 36 38 35 35 64 65 65 63 38 34 3c 2f 52 65 73 56855deec84</
Res
0140 6f 75 72 63 65 3e 3c 52 65 71 75 65 73 74 49 64
ource><RequestId
0150 3e 31 65 36 62 39 61 37 32 2d 66 34 39 63 2d 34 >1e6b9a72-
f49c-4
0160 32 64 31 2d 38 63 32 65 2d 35 36 63 39 65 30 38
2d1-8c2e-56c9e08
0170 66 38 31 37 37 3c 2f 52 65 71 75 65 73 74 49 64 f8177</
RequestId
0180 3e 3c 2f 45 72 72 6f 72 3e ></Error>
Data: 485454502F312E3120343034204E6F7420466F756E640D0A...
[Length: 393]

Mitchell Garnaat

unread,
Sep 7, 2011, 12:52:26 PM9/7/11
to boto...@googlegroups.com
On Wed, Sep 7, 2011 at 12:45 PM, Tony <dago...@gmail.com> wrote:
On Sep 7, 12:35 pm, Mitchell Garnaat <mi...@garnaat.com> wrote:
> I'm wondering if this is an issue with Walrus in 1.6.2.  I'm checking on
> that now.  Have you tried the same thing against S3?

No, I don't have an S3 account, but I can create one if you think it
is worth trying.

No, I'll check it out right now.

Mitchell Garnaat

unread,
Sep 7, 2011, 12:57:35 PM9/7/11
to boto...@googlegroups.com
Works fine on S3.  I did a lookup on a non-existant key (HEAD request) immediately followed by a PUT to that key:

>>> import boto
>>> boto.set_stream_logger('foo')
>>> c = boto.connect_s3(debug=2)
>>> b = c.lookup('garnaat_pub')
2011-09-07 12:54:16,376 foo [DEBUG]:path=/
2011-09-07 12:54:16,378 foo [DEBUG]:auth_path=/garnaat_pub/
2011-09-07 12:54:16,385 foo [DEBUG]:path=/?&max-keys=0
2011-09-07 12:54:16,385 foo [DEBUG]:auth_path=/garnaat_pub/?&max-keys=0
2011-09-07 12:54:16,386 foo [DEBUG]:Method: GET
2011-09-07 12:54:16,386 foo [DEBUG]:Path: /?&max-keys=0
2011-09-07 12:54:16,386 foo [DEBUG]:Data: 
2011-09-07 12:54:16,386 foo [DEBUG]:Headers: {}
2011-09-07 12:54:16,386 foo [DEBUG]:Host: garnaat_pub.s3.amazonaws.com
2011-09-07 12:54:16,386 foo [DEBUG]:establishing HTTPS connection: host=garnaat_pub.s3.amazonaws.com, kwargs={}
2011-09-07 12:54:16,387 foo [DEBUG]:Canonical: GET


Wed, 07 Sep 2011 16:54:16 GMT
/garnaat_pub/
send: 'GET /?&max-keys=0 HTTP/1.1\r\nHost: garnaat_pub.s3.amazonaws.com\r\nAccept-Encoding: identity\r\nDate: Wed, 07 Sep 2011 16:54:16 GMT\r\nContent-Length: 0\r\nAuthorization: AWS <removed>\r\nUser-Agent: Boto/2.0 (darwin)\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: x-amz-id-2: n4q3sk05Dyu1S+Q8a0delvzQ5mYobC5HBaKDOJQe7SRHP22nWkHbGwpmA5uWAyRl
header: x-amz-request-id: 981BE656335C0E31
header: Date: Wed, 07 Sep 2011 16:54:18 GMT
header: Content-Type: application/xml
header: Transfer-Encoding: chunked
header: Server: AmazonS3
2011-09-07 12:54:17,701 foo [DEBUG]:<?xml version="1.0" encoding="UTF-8"?>
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>garnaat_pub</Name><Prefix></Prefix><Marker></Marker><MaxKeys>0</MaxKeys><IsTruncated>false</IsTruncated></ListBucketResult>
>>> k = b.lookup('fsdafasfkjafksajfafj;dslafja')
2011-09-07 12:54:33,181 foo [DEBUG]:path=/fsdafasfkjafksajfafj%3Bdslafja
2011-09-07 12:54:33,181 foo [DEBUG]:auth_path=/garnaat_pub/fsdafasfkjafksajfafj%3Bdslafja
2011-09-07 12:54:33,182 foo [DEBUG]:Method: HEAD
2011-09-07 12:54:33,182 foo [DEBUG]:Path: /fsdafasfkjafksajfafj%3Bdslafja
2011-09-07 12:54:33,182 foo [DEBUG]:Data: 
2011-09-07 12:54:33,182 foo [DEBUG]:Headers: {}
2011-09-07 12:54:33,183 foo [DEBUG]:Host: garnaat_pub.s3.amazonaws.com
2011-09-07 12:54:33,183 foo [DEBUG]:Canonical: HEAD


Wed, 07 Sep 2011 16:54:33 GMT
/garnaat_pub/fsdafasfkjafksajfafj%3Bdslafja
send: 'HEAD /fsdafasfkjafksajfafj%3Bdslafja HTTP/1.1\r\nHost: garnaat_pub.s3.amazonaws.com\r\nAccept-Encoding: identity\r\nDate: Wed, 07 Sep 2011 16:54:33 GMT\r\nContent-Length: 0\r\nAuthorization: AWS <removed>\r\nUser-Agent: Boto/2.0 (darwin)\r\n\r\n'
reply: 'HTTP/1.1 404 Not Found\r\n'
header: x-amz-request-id: 3273EB3E075C36DD
header: x-amz-id-2: 8iN/INfxRXLjUtwC6Vr8Y8xElA467t9ozquX8iO3Z61BsP73NfK6l9DmLYqXmD/h
header: Content-Type: application/xml
header: Transfer-Encoding: chunked
header: Date: Wed, 07 Sep 2011 16:54:32 GMT
header: Server: AmazonS3
>>> k = b.new_key('fsdafasfkjafksajfafj;dslafja')
>>> k.set_contents_from_string('this is a test.')
2011-09-07 12:55:00,319 foo [DEBUG]:path=/fsdafasfkjafksajfafj%3Bdslafja
2011-09-07 12:55:00,319 foo [DEBUG]:auth_path=/garnaat_pub/fsdafasfkjafksajfafj%3Bdslafja
2011-09-07 12:55:00,327 foo [DEBUG]:Method: PUT
2011-09-07 12:55:00,327 foo [DEBUG]:Path: /fsdafasfkjafksajfafj%3Bdslafja
2011-09-07 12:55:00,327 foo [DEBUG]:Data: 
2011-09-07 12:55:00,328 foo [DEBUG]:Headers: {'Content-Length': '15', 'Content-MD5': 'Ccugkd9pavkVSd4nuOfQ9g==', 'Content-Type': 'application/octet-stream', 'Expect': '100-Continue', 'User-Agent': 'Boto/2.0 (darwin)'}
2011-09-07 12:55:00,328 foo [DEBUG]:Host: garnaat_pub.s3.amazonaws.com
2011-09-07 12:55:00,328 foo [DEBUG]:Canonical: PUT
Ccugkd9pavkVSd4nuOfQ9g==
application/octet-stream
Wed, 07 Sep 2011 16:55:00 GMT
/garnaat_pub/fsdafasfkjafksajfafj%3Bdslafja
send: 'PUT /fsdafasfkjafksajfafj%3Bdslafja HTTP/1.1\r\nHost: garnaat_pub.s3.amazonaws.com\r\nAccept-Encoding: identity\r\nContent-Length: 15\r\nContent-MD5: Ccugkd9pavkVSd4nuOfQ9g==\r\nExpect: 100-Continue\r\nDate: Wed, 07 Sep 2011 16:55:00 GMT\r\nUser-Agent: Boto/2.0 (darwin)\r\nContent-Type: application/octet-stream\r\nAuthorization: AWS <removed>\r\n\r\n'

Tony

unread,
Sep 7, 2011, 1:25:13 PM9/7/11
to boto-dev
On Sep 7, 12:42 pm, Mitchell Garnaat <mi...@garnaat.com> wrote:
> Yes, it is indeed a bug in Walrus.  Now, to try to come up with a
> workaround.  BTW, in case you were wondering, this kind of stuff is one of
> the reasons boto/connection.py is so ugly 8^)

Thanks! I really appreciate the help. I'll be happy to try any patch
you create.

Tony

Tony

unread,
Sep 7, 2011, 2:14:11 PM9/7/11
to boto-dev
On Sep 7, 12:42 pm, Mitchell Garnaat <mi...@garnaat.com> wrote:
> Yes, it is indeed a bug in Walrus.  Now, to try to come up with a
> workaround.  BTW, in case you were wondering, this kind of stuff is one of
> the reasons boto/connection.py is so ugly 8^)

FYI, I've opened a bug report upstream:

https://bugs.launchpad.net/eucalyptus/+bug/844139

Tony

Tony

unread,
Sep 7, 2011, 3:52:18 PM9/7/11
to boto-dev
On Sep 7, 12:42 pm, Mitchell Garnaat <mi...@garnaat.com> wrote:
> Yes, it is indeed a bug in Walrus.  Now, to try to come up with a
> workaround.  BTW, in case you were wondering, this kind of stuff is one of
> the reasons boto/connection.py is so ugly 8^)

Is this too dumb to use? It seems to work for me and doesn't appear to
break anything else...

--- a/boto/s3/bucket.py
+++ b/boto/s3/bucket.py
@@ -191,7 +191,8 @@ class Bucket(object):
return k
else:
if response.status == 404:
- response.read()
+ if response.getheader('content-length'):
+ response.fp.read( int(response.getheader('content-
length')) )
return None
else:
raise
self.connection.provider.storage_response_error(

Reply all
Reply to author
Forward
0 new messages