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

Multiple delete fails to delete objects with key containing 2+ subsequent space characters [JIRA: RCS-191] #1129

Closed
shino opened this issue Apr 24, 2015 · 1 comment

Comments

@shino
Copy link
Contributor

shino commented Apr 24, 2015

2015-04-28 Update: Changed subject to indicate the bug of list objects API. Multiple delete API itself does no bad. Some tools like s3cmd issues list objects before multiple delete to grab keys, so such tools are affected.

Confirmed at version 2.0.0, probably 1.5.x are affected too.

Steps:

% s3cmd -c .s3cfg.15018.alice mb s3://test3
Bucket 's3://test3/' created
% s3cmd -c .s3cfg.15018.alice put tools.mk s3://test3/'three   spaces'
tools.mk -> s3://test3/three   spaces  [1 of 1]
 5751 of 5751   100% in    0s   418.06 kB/s  done
% s3cmd -c .s3cfg.15018.alice ls s3://test3/
2015-04-24 02:57      5751   s3://test3/three   spaces
% s3cmd -c .s3cfg.15018.alice del -r -f s3://test3/
File s3://test3/three   spaces deleted
% s3cmd -c .s3cfg.15018.alice ls s3://test3/
2015-04-24 02:57      5751   s3://test3/three   spaces

Expected output from the final step (s3cmd ls) is empty, but
there was one.

From the output of console debug log from multiple detele path,
sebsequnt spaces became corrupted to single space:

11:57:36.407 [debug] deleting keys at <<"test3">>: [<<"three spaces">>]

zd://10707

@shino shino added the Bug label Apr 24, 2015
@Basho-JIRA Basho-JIRA changed the title Multiple delete fails to delete objects with key containing 2+ subsequent space characters Multiple delete fails to delete objects with key containing 2+ subsequent space characters [JIRA: RCS-191] Apr 24, 2015
@shino
Copy link
Contributor Author

shino commented Apr 24, 2015

Spaces are trimmed at XML parsing [1], which was introduced by [2] fixing other bug.

The function is called by:

./riak_cs_wm_user.erl:143:    case riak_cs_xml:scan(Body) of
./riak_cs_wm_user.erl:160:    case riak_cs_xml:scan(Body) of
./riak_cs_wm_object_upload_part.erl:212:        {ok, ParsedData} = riak_cs_xml:scan(Body),
./riak_cs_s3_response.erl:335:    {ok, ParsedData} = riak_cs_xml:scan(Xml),
./riak_cs_wm_bucket_delete.erl:161:    case riak_cs_xml:scan(Body) of
./riak_cs_acl_utils.erl:305:    case riak_cs_xml:scan(Xml) of

[1] https://github.com/basho/riak_cs/blob/develop/src/riak_cs_xml.erl#L69
[2] #795

@shino shino changed the title Multiple delete fails to delete objects with key containing 2+ subsequent space characters [JIRA: RCS-191] List objects corrupse 2+ subsequent space characters to only single space [JIRA: RCS-191] Apr 28, 2015
@shino shino changed the title List objects corrupse 2+ subsequent space characters to only single space [JIRA: RCS-191] List objects response corrupses 2+ subsequent space characters to only single space [JIRA: RCS-191] Apr 28, 2015
@shino shino changed the title List objects response corrupses 2+ subsequent space characters to only single space [JIRA: RCS-191] List objects response corrupses 2+ subsequent space characters to just single space [JIRA: RCS-191] Apr 28, 2015
@shino shino changed the title List objects response corrupses 2+ subsequent space characters to just single space [JIRA: RCS-191] Multiple delete fails to delete objects with key containing 2+ subsequent space characters [JIRA: RCS-191] Apr 28, 2015
@kuenishi kuenishi added this to the 2.0.1 milestone Apr 28, 2015
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

3 participants