jubos / fake-s3

A lightweight server clone of Amazon S3 that simulates most of the commands supported by S3 with minimal dependencies
2.94k stars 355 forks source link

Error in multipart PUT + undefined method `Error' #127

Open OrangeDog opened 9 years ago

OrangeDog commented 9 years ago
[2015-11-02 14:28:37] INFO  WEBrick 1.3.1
[2015-11-02 14:28:37] INFO  ruby 1.9.3 (2011-10-30) [x86_64-linux]
[2015-11-02 14:28:37] INFO  WEBrick::HTTPServer#start: pid=4052 port=8000
localhost - - [02/Nov/2015:14:28:39 GMT] "GET https://bucket.s3.amazonaws.com/ HTTP/1.1" 200 216
- -> https://bucket.s3.amazonaws.com/
localhost - - [02/Nov/2015:14:30:41 GMT] "POST https://bucket.s3.amazonaws.com//c8/1d/c81d0f329dc6478490b16f0533005e9c/1-4d0fd97653fe92f9a4534b4b24134dcf/image.png?uploads HTTP/1.1" 200 250
- -> https://bucket.s3.amazonaws.com//c8/1d/c81d0f329dc6478490b16f0533005e9c/1-4d0fd97653fe92f9a4534b4b24134dcf/image.png?uploads
localhost - - [02/Nov/2015:14:30:41 GMT] "PUT https://bucket.s3.amazonaws.com//c8/1d/c81d0f329dc6478490b16f0533005e9c/1-4d0fd97653fe92f9a4534b4b24134dcf/image.png?partNumber=1&uploadId=725234f1ca27e411fa18fb22ee32820f HTTP/1.1" 200 0
- -> https://bucket.s3.amazonaws.com//c8/1d/c81d0f329dc6478490b16f0533005e9c/1-4d0fd97653fe92f9a4534b4b24134dcf/image.png?partNumber=1&uploadId=725234f1ca27e411fa18fb22ee32820f
[2015-11-02 14:30:41] ERROR NoMethodError: undefined method `Error' for #<FakeS3::FileStore:0x00000002b77760>
    /var/lib/gems/1.9.1/gems/fakes3-0.2.1/lib/fakes3/file_store.rb:231:in `block in combine_object_parts'
    /var/lib/gems/1.9.1/gems/fakes3-0.2.1/lib/fakes3/file_store.rb:224:in `each'
    /var/lib/gems/1.9.1/gems/fakes3-0.2.1/lib/fakes3/file_store.rb:224:in `combine_object_parts'
    /var/lib/gems/1.9.1/gems/fakes3-0.2.1/lib/fakes3/server.rb:250:in `do_POST'
    /usr/lib/ruby/1.9.1/webrick/httpservlet/abstract.rb:106:in `service'
    /usr/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
    /usr/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
    /usr/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'

Client was Node.JS pkgcloud, which uses aws-sdk.

OrangeDog commented 9 years ago

And the client's error: XMLParserError: Unexpected close tag\nLine: 11\nColumn: 9\nChar: >\n at error (node_modules/pkgcloud/node_modules/aws-sdk/node_modules/xml2js/node_modules/sax/lib/sax.js:352:8)

I fixed the extra leading / at my end, but fakes3 still gives the same error.

OrangeDog commented 9 years ago

That close was accidental. Damn GitHub UI.

sachinkaria commented 7 years ago

Did you manage to resolve the XMLParserError? I am experiencing the same error our my TEST environment when using s3 multipart upload and fakes3.

hongkongkiwi commented 5 years ago

I am experiencing the same issue when using copyObject command in aws sdk v2

ndench commented 1 year ago

Has anyone had any luck with workarounds for this? I'm getting this when trying to store large files (> 20MB), but smaller files work fine.