Conversation
Immich can close the multipart request body early when the x-immich-checksum header identifies an existing asset. PR simulot#854 intended to tolerate the resulting io.ErrClosedPipe, but uploadAsset checked the stale error from the earlier file Stat call before receiving the request and multipart-writer errors. Repeated or resumed uploads therefore aborted when they encountered assets already present on the server. Collect the request and multipart-writer errors before evaluating them. Suppress io.ErrClosedPipe only when Immich returned duplicate status, while preserving unrelated errors and closed-pipe failures for non-duplicate responses. Add regression coverage for direct and wrapped request errors, writer errors, mixed errors, and non-duplicate uploads. Fixes: simulot#1271 Signed-off-by: Evan Baker <2940321+rbtr@users.noreply.github.com>
|
Could you include a quick negative test case demonstrating closed-pipe writer error dedupe behavior under retry conditions? |
|
just wanted to chime in and say that building from this branch fixed an issue for me where this command (ish): ./immich-go upload from-google-photos --log-level WARN \
--include-unmatched --exclude-extensions .mp4,.mov \
-k redacted \
-s https://url \
takeout___.zipwould result in the import job crashing with a bunch of |
Author
|
Just ran into this bug myself and almost put up my own pr before finding this one! Would be great to get this one merged. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Immich can close the multipart request body early when the x-immich-checksum header identifies an existing asset. PR #854 intended to tolerate the resulting io.ErrClosedPipe, but uploadAsset checked the stale error from the earlier file Stat call before receiving the request and multipart-writer errors. Repeated or resumed uploads therefore aborted when they encountered assets already present on the server.
Collect the request and multipart-writer errors before evaluating them. Suppress io.ErrClosedPipe only when Immich returned duplicate status, while preserving unrelated errors and closed-pipe failures for non-duplicate responses. Add regression coverage for direct and wrapped request errors, writer errors, mixed errors, and non-duplicate uploads.
Fixes: #1271