Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling a request has no Content-Length on Upload Part - Copy [JIRA: RCS-187] #939

Closed
ksauzz opened this issue Aug 5, 2014 · 7 comments

Comments

@ksauzz
Copy link
Contributor

ksauzz commented Aug 5, 2014

CS responds 413 Request Entity Too Large if client send no Content-Length on Upload Part - Copy. CS should ignore Content-Length, or treat it as 0 if it's not included.

note: use my fork of s3curl for sending 'x-amz-copy-source-range header' instead of the original that can't deal with 'x-amz-copy-source-range'.

% s3curl.pl --id user --copySrc /kaz/mp-test --copySrcRange 0-10485759 -- -x localhost:8080 'http://kaz.s3.amazonaws.com/mp-test-dst?uploadId=spsCsxzfQdSf_Ug3ni43Nw==&partNumber=1' -s -v
s3curl: Found the url: host=kaz.s3.amazonaws.com; port=; uri=/mp-test-dst; query=uploadId=spsCsxzfQdSf_Ug3ni43Nw==&partNumber=1;
s3curl: vanity endpoint signing case
s3curl: StringToSign='PUT\n\n\nTue, 05 Aug 2014 07:40:42 GMT\nx-amz-copy-source:/kaz/mp-test\nx-amz-copy-source-range:bytes=0-10485759\n/kaz/mp-test-dst?partNumber=1&uploadId=spsCsxzfQdSf_Ug3ni43Nw=='
s3curl: signature='LS9PJAO4rxedtwiAWpoi57JrLNM='
s3curl: exec curl -H Date: Tue, 05 Aug 2014 07:40:42 GMT -H Authorization: AWS VU_HIOQ9XELDC6F-815R:LS9PJAO4rxedtwiAWpoi57JrLNM= -L -X PUT -H x-amz-copy-source: /kaz/mp-test -H x-amz-copy-source-range:bytes=0-10485759 -x localhost:8080 http://kaz.s3.amazonaws.com/mp-test-dst?uploadId=spsCsxzfQdSf_Ug3ni43Nw==&partNumber=1 -s -v
* About to connect() to proxy localhost port 8080 (#0)
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> PUT http://kaz.s3.amazonaws.com/mp-test-dst?uploadId=spsCsxzfQdSf_Ug3ni43Nw==&partNumber=1 HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.15.3 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: kaz.s3.amazonaws.com
> Accept: */*
> Proxy-Connection: Keep-Alive
> Date: Tue, 05 Aug 2014 07:40:42 GMT
> Authorization: AWS VU_HIOQ9XELDC6F-815R:LS9PJAO4rxedtwiAWpoi57JrLNM=
> x-amz-copy-source: /kaz/mp-test
> x-amz-copy-source-range:bytes=0-10485759
>
< HTTP/1.1 413 Request Entity Too Large
< Server: Riak CS
< Date: Tue, 05 Aug 2014 07:40:43 GMT
< Content-Length: 0
<
* Connection #0 to host localhost left intact
* Closing connection #0
@ksauzz ksauzz changed the title handling a request has no Content-Type on Upload Part - Copy. handling a request has no Content-Length on Upload Part - Copy. Aug 5, 2014
@Basho-JIRA Basho-JIRA changed the title handling a request has no Content-Length on Upload Part - Copy. Handling a request has no Content-Length on Upload Part - Copy [JIRA: RCS-187] Apr 7, 2015
@JoarJ
Copy link

JoarJ commented Apr 8, 2015

For what it's worth in any future diagnosis, regarding s3tools/s3cmd#510 , this bug does not get triggered with s3cmd 1.0.1

@ksauzz
Copy link
Contributor Author

ksauzz commented Apr 8, 2015

@JoarJ Thank you. Yes, you are right. If I recall correctly, old s3cmd always sent a Content-Length header but the behavior has been changed ,unfortunately. If you want to use the latest s3cmd with Riak CS, you can use copy API with --add-header=Content-Length:0 as workaround.

e.g.

s3cmd -c user.cfg cp s3://test/1 s3://test/2 --add-header=Content-Length:0

@Basho-JIRA
Copy link

Zendesk Issue

https://basho.zendesk.com/agent/tickets/10598

_[posted via JIRA by Bryan Hunt]_

@JoarJ
Copy link

JoarJ commented Apr 8, 2015

@ksauzz thnks for the tip.

@Basho-JIRA
Copy link

PR #1200

_[posted via JIRA by Shunichi Shinohara]_

@Basho-JIRA
Copy link

For release note:

Fix bug of Content-Length header handling in two copy APIs, PUT Copy and Upload Part Copy.
Before this fix, Riak CS responds with error 413 Request Entity Too Large for the requests with no Content-Length
headers. By this fix, Riak CS allows requests without Content-Length for copy APIs.

_[posted via JIRA by Shunichi Shinohara]_

@shino shino added this to the 2.1.0 milestone Jul 30, 2015
@shino
Copy link
Contributor

shino commented Jul 30, 2015

Addressed by #1200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants