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

[BUG] rgw/sfs: crash when calling CompleteMultipartUpload with a non-existent uploadId #762

Open
giubacc opened this issue Oct 17, 2023 · 2 comments
Labels
area/rgw-sfs RGW & SFS related kind/bug Something isn't working triage/next-candidate This could be moved to the next milestone

Comments

@giubacc
Copy link

giubacc commented Oct 17, 2023

Describe the bug A clear and concise description of what the bug is.

Putting an non existing uploadId in the final CompleteMultipartUpload call guarantees a crash due to the ceph_assert(mp.has_value()); in the get_meta_obj() function in multipart.cc.

To Reproduce Steps to reproduce the behavior:

Just call CompleteMultipartUpload with a non-existing UploadId.

@github-project-automation github-project-automation bot moved this to Backlog in S3GW Oct 17, 2023
@github-actions github-actions bot added the triage/waiting Waiting for triage label Oct 17, 2023
@giubacc giubacc added area/rgw-sfs RGW & SFS related kind/bug Something isn't working labels Oct 17, 2023
@jecluis
Copy link
Contributor

jecluis commented Oct 19, 2023

This might be a bug in rgw itself, as that assert was expected to be a sanity check.

@0xavi0 and @irq0 do you have opinions on where this should be fixed?

@0xavi0
Copy link
Contributor

0xavi0 commented Oct 19, 2023

This needs further investigation (to confirm if it's an rgw bug or in sfs)

Code in rgw_op.cc looks like this:

  upload = s->bucket->get_multipart_upload(s->object->get_name(), upload_id);

  RGWCompressionInfo cs_info;
  bool compressed = false;
  uint64_t accounted_size = 0;

  list<rgw_obj_index_key> remove_objs; /* objects to be removed from index listing */

  meta_obj = upload->get_meta_obj();
  meta_obj->set_in_extra_data(true);
  meta_obj->set_hash_source(s->object->get_name());

Looks like it follows an optimistic approach (it doesn't check if the upload is valid or not and just uses it)
Crash happens when calling meta_obj = upload->get_meta_obj();

According to Amazon docs it should return a 404 error when upload id is not valid.

Error code: NoSuchUpload

Description: The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed.

404 Not Found

@jecluis jecluis added triage/next-candidate This could be moved to the next milestone and removed triage/waiting Waiting for triage labels Mar 20, 2024
@jecluis jecluis added this to s3gw Mar 20, 2024
@jecluis jecluis moved this to Backlog in s3gw Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rgw-sfs RGW & SFS related kind/bug Something isn't working triage/next-candidate This could be moved to the next milestone
Projects
Status: Backlog
Development

No branches or pull requests

3 participants