Skip to content

Put to a non-existent bucket -> HTTP 500 error #436

Closed
kuenishi wants to merge 2 commits into
masterfrom
gh436-fix-bucket-notfound-case
Closed

Put to a non-existent bucket -> HTTP 500 error #436
kuenishi wants to merge 2 commits into
masterfrom
gh436-fix-bucket-notfound-case

Conversation

@kuenishi

Copy link
Copy Markdown
Contributor

s3cmd put ~/foo s3://testbotoXX/foo where the S3 bucket testbotoXX does not exist:

15:12:21.878 [error] webmachine error: path="/buckets/testbotoXX/objects/foo"
{error,{case_clause,{error,notfound}},[{riak_cs_wm_utils,translate_bucket_policy,3,[{file,"src/riak_cs_wm_utils.erl"},{line,596}]},{riak_cs_wm_utils,object_access_authorize_helper,4,[{file,"src/riak_cs_wm_utils.erl"},{line,520}]},{riak_cs_wm_common,authorize,2,[{file,"src/riak_cs_wm_common.erl"},{line,309}]},{riak_cs_wm_common,forbidden,2,[{file,"src/riak_cs_wm_common.erl"},{line,147}]},{webmachine_resource,resource_call,3,[{file,"src/webmachine_resource.erl"},{line,183}]},{webmachine_resource,do,3,[{file,"src/webmachine_resource.erl"},{line,141}]},{webmachine_decision_core,resource_call,1,[{file,"src/webmachine_decision_core.erl"},{line,48}]},{webmachine_decision_core,decision,1,[{file,"src/webmachine_decision_core.erl"},{line,212}]}]}

@reiddraper

Copy link
Copy Markdown
Contributor

Just confirmed this should return 404:

s3cmd --debug -c ~/.s3cfg.real-s3-personal-account put rebar.config s3://nowaythisisrealyodognono

shows:

ERROR: S3 error: 404 (NoSuchBucket): The specified bucket does not exist

@ghost ghost assigned kuenishi Feb 27, 2013
@reiddraper

Copy link
Copy Markdown
Contributor

I still get this error:

(riak-cs@127.0.0.1)1> 13:35:46.891 [error] webmachine error: path="/buckets/noway/objects/rebar.config"
{error,{case_clause,{error,no_such_bucket}},[{riak_cs_wm_utils,translate_bucket_policy,3,[{file,"src/riak_cs_wm_utils.erl"},{line,596}]},{riak_cs_wm_utils,object_access_authorize_helper,4,[{file,"src/riak_cs_wm_utils.erl"},{line,520}]},{riak_cs_wm_common,authorize,2,[{file,"src/riak_cs_wm_common.erl"},{line,309}]},{riak_cs_wm_common,forbidden,2,[{file,"src/riak_cs_wm_common.erl"},{line,147}]},{webmachine_resource,resource_call,3,[{file,"src/webmachine_resource.erl"},{line,183}]},{webmachine_resource,do,3,[{file,"src/webmachine_resource.erl"},{line,141}]},{webmachine_decision_core,resource_call,1,[{file,"src/webmachine_decision_core.erl"},{line,48}]},{webmachine_decision_core,decision,1,[{file,"src/webmachine_decision_core.erl"},{line,212}]}]}
[{riak_cs_wm_utils,translate_bucket_policy,3,[{file,"src/riak_cs_wm_utils.erl"},{line,596}]},{riak_cs_wm_utils,object_access_authorize_helper,4,[{file,"src/riak_cs_wm_utils.erl"},{line,520}]},{riak_cs_wm_common,authorize,2,[{file,"src/riak_cs_wm_common.erl"},{line,309}]},{riak_cs_wm_common,forbidden,2,[{file,"src/riak_cs_wm_common.erl"},{line,147}]},{webmachine_resource,resource_call,3,[{file,"src/webmachine_resource.erl"},{line,183}]},{webmachine_resource,do,3,[{file,"src/webmachine_resource.erl"},{line,141}]},{webmachine_decision_core,resource_call,1,[{file,"src/webmachine_decision_core.erl"},{line,48}]},{webmachine_decision_core,decision,1,[{file,"src/webmachine_decision_core.erl"},{line,212}]}]

@reiddraper

Copy link
Copy Markdown
Contributor

We should add a regression test for this as well.

@kuenishi

Copy link
Copy Markdown
Contributor

Sorry, I thought I had fixed it and I had tested it :(
Is riak_test the best place to add regression? I'm still failing running it, so I'll try it tomorrow.

kellymclaughlin added a commit that referenced this pull request Feb 28, 2013
Fixes #436

Fix issue where attempting to put an object to a non-existent bucket
results in a 500 instead of the expected 404.  This is a regression
introduced by some recent refactoring. Also included is a riak_test
regression test for this issue.
@kellymclaughlin

Copy link
Copy Markdown
Contributor

I know @kota is very busy and I had a few minutes so I went ahead and made a new pull request with a fix and a regression suite that is targeted against the release/1.3 branch.

@kuenishi

kuenishi commented Mar 1, 2013

Copy link
Copy Markdown
Contributor

@kellymclaughlin ok, closing this issue to avoid duplication

@kuenishi kuenishi closed this Mar 1, 2013
kellymclaughlin added a commit that referenced this pull request Mar 20, 2013
Fixes #436

Fix issue where attempting to put an object to a non-existent bucket
results in a 500 instead of the expected 404.  This is a regression
introduced by some recent refactoring. Also included is a riak_test
regression test for this issue.
@kuenishi kuenishi deleted the gh436-fix-bucket-notfound-case branch June 15, 2014 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants