Skip to content

fix: create parent dirs on CompleteMultipartUpload - #8

Merged
kilyanni merged 1 commit into
masterfrom
fix/multipart-complete-missing-parent-dir
Jul 13, 2026
Merged

fix: create parent dirs on CompleteMultipartUpload#8
kilyanni merged 1 commit into
masterfrom
fix/multipart-complete-missing-parent-dir

Conversation

@kilyanni

Copy link
Copy Markdown

complete_multipart_upload assembled the object with File::create but, unlike put_object, never created the key's parent directories. Any key with a prefix (e.g. simple/pkg/x.whl) therefore failed with NotFound and the request returned 500 InternalError after the parts were already uploaded.

Mirror put_object: create_dir_all the object's parent before writing.

Verified against real rclone: a 6 MiB multipart upload to a prefixed key returns 500 before this change and succeeds after, with part temp files cleaned up.

@kilyanni
kilyanni requested a review from theduke July 10, 2026 13:55
@kilyanni
kilyanni merged commit b71966f into master Jul 13, 2026
3 checks passed
Comment thread src/storages/fs.rs
};

let object_path = trace_try!(self.get_object_path(&bucket, &key));
// Create the key's parent dirs first, as put_object does; otherwise a

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe there are tests, please add a test for this.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, sorry, I was a bit too fast on the merge there ^^'

Gonna add one

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants