Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Bugfix: Preserve upload bin when synchronous Finalize fails

When a synchronous upload finalization (e.g. storage-system with NFS blobstore) called
Finalize and WriteBlob failed, Cleanup was invoked with cleanBin=true unconditionally.
This permanently deleted the bin file from uploads/ even though the blob never reached
blobs/, making it unrecoverable — including via the move-stuck-upload-blobs CLI.

Fix: only clean the bin file when Finalize succeeds (err == nil), so a failed upload
bin is preserved for manual recovery.

https://github.com/owncloud/reva/pull/577
2 changes: 1 addition & 1 deletion pkg/storage/utils/decomposedfs/upload/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func (session *OcisSession) FinishUploadDecomposed(ctx context.Context) error {
if !session.store.async || session.info.Size == 0 {
// handle postprocessing synchronously
err = session.Finalize(ctx)
session.Cleanup(err != nil, true, true, true)
session.Cleanup(err != nil, err == nil, true, true)
if err != nil {
log.Error().Err(err).Msg("failed to upload")
return err
Expand Down
Loading