Bugs: Browse | Submit New | Admin

[#12136] S3Object stored with string key value containing only digits can be stored on S3 or deleted, but cannot be found without errors

Date:
2007-07-10 06:02
Priority:
3
Submitted By:
Glenn Rempe (grempe)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
S3Object stored with string key value containing only digits can be stored on S3 or deleted, but cannot be found without errors

Detailed description
Create a bucket called 'S3Record'

Store an object with a number value in a string as the key (variations: can be '1' or "1000" or "234567",
all get saved but cannot be found.  However '10f' works fine and can be found.):
>> S3Object.store('1', "hello", 'S3Record')
=> #<AWS::S3::S3Object::Response:0x10235330 200 OK>



Try to find this object (FAILS):
>> S3Object.find('1', 'S3Record')
AWS::S3::NoSuchKey: No such key `1'
        from /usr/local/lib/ruby/gems/1.8/gems/aws-s3-0.4.0/bin/../lib/aws/s3/object.rb:177:in `find'
        from (irb):26



Try to find the contents of the bucket (FAILS):
>> S3Bucket.find('S3Record')
TypeError: can't convert Fixnum into String
        from /usr/local/lib/ruby/gems/1.8/gems/aws-s3-0.4.0/bin/../lib/aws/s3/object.rb:298:in `join'
        from /usr/local/lib/ruby/gems/1.8/gems/aws-s3-0.4.0/bin/../lib/aws/s3/object.rb:298:in `path!'
        from /usr/local/lib/ruby/gems/1.8/gems/aws-s3-0.4.0/bin/../lib/aws/s3/object.rb:589:in `path'
        from /usr/local/lib/ruby/gems/1.8/gems/aws-s3-0.4.0/bin/../lib/aws/s3/object.rb:597:in `inspect'
        from /usr/local/lib/ruby/1.8/irb.rb:298:in `output_value'
        from /usr/local/lib/ruby/1.8/irb.rb:151:in `eval_input'
        from /usr/local/lib/ruby/1.8/irb.rb:259:in `signal_status'
        from /usr/local/lib/ruby/1.8/irb.rb:147:in `eval_input'
        from /usr/local/lib/ruby/1.8/irb.rb:146:in `eval_input'
        from /usr/local/lib/ruby/1.8/irb.rb:70:in `start'
        from /usr/local/lib/ruby/1.8/irb.rb:69:in `catch'
        from /usr/local/lib/ruby/1.8/irb.rb:69:in `start'
        from /usr/local/bin/irb:13
>> 



Delete the object you just created:
>> S3Object.delete('1', 'S3Record')
=> true


Now that its deleted the bucket find works again:
>> S3Bucket.find('S3Record')
=> #<S3Bucket:0x10bec84 @object_cache=[#<AWS::S3::S3Object:0x8758450 '/S3Record/f10'>,
#<AWS::S3::S3Object:0x8758280 '/S3Record/f2'>], @attributes={"prefix"=>nil,
"name"=>"S3Record", "marker"=>nil, "max_keys"=>1000,
"is_truncated"=>false, "xmlns"=>"http://s3.amazonaws.com/doc/2006-03-01/"}>
>> 


Thanks,

Glenn

Add A Comment: Notepad

Please login


Followup

Message
Date: 2007-07-10 22:45
Sender: Glenn Rempe

Sorry, crazy rubyforge...  Patch should be visible in the
patch record now...  Let me know if you don't see it.  Thanks!
Date: 2007-07-10 22:25
Sender: Marcel Molina Jr.

Thanks for submitting a patch but I can't manage to find any
attached file either on this ticket or on the link
you provided...
Date: 2007-07-10 22:22
Sender: Glenn Rempe

Added two line patch which should resolve this pretty major
issue.  See link:

http://rubyforge.org/tracker/index.php?func=detail&aid=12172&
amp;group_id=2409&atid=9358

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item