Skip to content

Infinite retry for conflicting auto-uploads #16446

Open

Description

@osovitskiy

⚠️ Before posting ⚠️

  • This is a bug, not a question or an enhancement.
  • I've searched for similar issues and didn't find a duplicate.
  • I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
  • I agree to follow Nextcloud's Code of Conduct.

Steps to reproduce

  1. Configure auto-upload
  2. Take some photos

Expected behaviour

If the uploaded succeeded, it should be marked as succeeded on the client side.
Even if the original attempt did fail on the client for any reason (e.g. network timeout), on retry the client should detect conflict with the existing server-side file and offer to resolve it instead of infinite retry cycle.

Actual behaviour

Files are being uploaded to the server successfully. However, they aren't marked as such on the client side and Android client tries to upload them again. Instead of detecting conflict and offering to resolve, it fails the upload due to "Unknown reason" and attempts to upload again, indefinitely.

Android version

16

Device brand and model

Samsung S22

Stock or custom OS?

Stock

Nextcloud android app version

3.35.2

Nextcloud server version

31.0.10

Using a reverse proxy?

Yes

Android logs

N/A

Server error logs

[HIDDEN] [05/Feb/2026:01:32:35 +0000] "HEAD /remote.php/dav/files/[HIDDEN]/20260201_163312.jpg HTTP/1.1" 200 802 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.35.2"
[HIDDEN] [05/Feb/2026:01:32:36 +0000] "PROPFIND /remote.php/dav/files/[HIDDEN]/20260201_163312.jpg HTTP/1.1" 207 1479 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.35.2"
[HIDDEN] [05/Feb/2026:01:32:36 +0000] "PROPFIND /remote.php/dav/files/[HIDDEN]/20260201_163312.jpg HTTP/1.1" 207 1479 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.35.2"
[HIDDEN] [05/Feb/2026:01:32:37 +0000] "HEAD /remote.php/dav/files/[HIDDEN]/20260201_182117.jpg HTTP/1.1" 200 802 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.35.2"
[HIDDEN] [05/Feb/2026:01:32:38 +0000] "PROPFIND /remote.php/dav/files/[HIDDEN]/20260201_182117.jpg HTTP/1.1" 207 1481 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.35.2"
[HIDDEN] [05/Feb/2026:01:32:38 +0000] "PROPFIND /remote.php/dav/files/[HIDDEN]/20260201_182117.jpg HTTP/1.1" 207 1481 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.35.2"

Additional information

I have NextCloud client installed and configured identically on multiple Android devices (same server). The only install that is affected by the bug is on a Samsung S22 phone. This phone has NextCloud client installed since ages, and the bug appeared just recently, so it looks like 3.35 client regression.
I won't have access to a PC with ADB in near future, so cannot provide client logs for now.

Activity

  1. alperozturk96 commented on Feb 6, 2026

    @alperozturk96
    Collaborator

    @osovitskiy Hey,

    I tried to reproduce the issue, but in my testing everything worked as expected. Here’s exactly what I did:

    1. Configured a custom local folder (the Pictures directory) for auto-upload
    2. Verified that photos were uploaded successfully
    3. Manually created a sync conflict
    4. Took some new pictures
    5. The app uploaded all files and prompted me to resolve the sync conflict for the conflicted file
    6. I did not resolve the sync conflict
    7. Continued taking photos, all new photos were uploaded successfully
    8. Restarted the app; it prompted me about the sync conflict again, and I canceled that upload from the Upload list (drawer menu -> Uploads)
    9. Continued taking photos, again, all new photos were uploaded, and I did not receive another sync-conflict notification

    From the code side: if the last upload result is a sync conflict, we mark that file as handled. This means the same file is not picked up again on subsequent runs, so we don’t keep retrying the same upload.

    I tested this scenario on both an emulator and a real device and couldn’t reproduce any unexpected behavior or infinite retries.

    I’m unable to reproduce the scenario you’re describing, so I suspect something else might be involved. Could you please share more details about the configured folder (path, type, any special setup), and anything else that might be relevant?

  2. self-assigned this
    on Feb 6, 2026
  3. delbonis commented on Feb 8, 2026

    @delbonis

    I believe I might be experiencing the same issue.

    Android version: 15 (CalyxOS 6.10.20, I know I know)
    App version: 3.35.2
    Server version: 31.0.13

    Here's a few interesting logs retrieved from logcat for one of the files that is giving me the "Unknown error" in the uploads list:

    $ sudo adb logcat | grep 'PXL_20260205_092406741'
    02-08 15:05:49.005  4308  4530 D AutoRename: Before - /Pictures/Phone/Camera/2026/02/PXL_20260205_092406741.jpg
    02-08 15:05:49.005  4308  4530 D AutoRename: After - /Pictures/Phone/Camera/2026/02/PXL_20260205_092406741.jpg
    02-08 15:08:46.477  4308  4530 D AutoRename: Before - /Pictures/Phone/Camera/2026/02/PXL_20260205_092406741.jpg
    02-08 15:08:46.477  4308  4530 D AutoRename: After - /Pictures/Phone/Camera/2026/02/PXL_20260205_092406741.jpg
    02-08 15:08:46.477  4308  4530 V UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/PXL_20260205_092406741.jpg with status=UPLOAD_IN_PROGRESS
    02-08 15:08:46.479  4308  4530 D AutoRename: Before - /Pictures/Phone/Camera/2026/02/PXL_20260205_092406741.jpg
    02-08 15:08:46.480  4308  4530 D AutoRename: After - /Pictures/Phone/Camera/2026/02/PXL_20260205_092406741.jpg
    02-08 15:08:46.482  4308  4530 D UploadsStorageManager: updateUpload returns with: 1 for file: /storage/emulated/0/DCIM/Camera/PXL_20260205_092406741.jpg
    02-08 15:08:46.504  4308  4530 D OwnCloudClient #0: REQUEST HEAD /remote.php/dav/files/trey/Pictures/Phone/Camera/2026/02/PXL_20260205_092406741.jpg
    02-08 15:08:46.908  4308  4530 D ExistenceCheckRemoteOperation: Existence check for https://nextcloud.tr3y.io/remote.php/dav/files/trey/Pictures/Phone/Camera/2026/02/PXL_20260205_092406741.jpg targeting for  existence finished with HTTP status 200
    02-08 15:08:46.908  4308  4530 E UploadFileOperation: Upload of /storage/emulated/0/DCIM/Camera/PXL_20260205_092406741.jpg to /Pictures/Phone/Camera/2026/02/PXL_20260205_092406741.jpg: Synchronization conflict
    02-08 15:08:46.913  4308  4530 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/trey/Pictures/Phone/Camera/2026/02/PXL_20260205_092406741.jpg
    02-08 15:08:47.438  4308  4530 D AutoRename: Before - /Pictures/Phone/Camera/2026/02/PXL_20260205_092406741.jpg
    02-08 15:08:47.438  4308  4530 D AutoRename: After - /Pictures/Phone/Camera/2026/02/PXL_20260205_092406741.jpg
    02-08 15:08:47.438  4308  4530 V UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/PXL_20260205_092406741.jpg with status:UPLOAD_SUCCEEDED and result:SAME_FILE_CONFLICT (old:/storage/emulated/0/DCIM/Camera/PXL_20260205_092406741.jpg status:UPLOAD_IN_PROGRESS result:-1)
    02-08 15:08:47.438  4308  4530 V UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/PXL_20260205_092406741.jpg with status=UPLOAD_SUCCEEDED
    02-08 15:08:47.443  4308  4530 D AutoRename: Before - /Pictures/Phone/Camera/2026/02/PXL_20260205_092406741.jpg
    02-08 15:08:47.443  4308  4530 D AutoRename: After - /Pictures/Phone/Camera/2026/02/PXL_20260205_092406741.jpg
    02-08 15:08:47.452  4308  4530 D UploadsStorageManager: updateUpload returns with: 1 for file: /storage/emulated/0/DCIM/Camera/PXL_20260205_092406741.jpg
    02-08 15:08:47.456  4308  4530 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/trey/Pictures/Phone/Camera/2026/02/PXL_20260205_092406741.jpg
    02-08 15:08:54.944  4308 10286 D AutoRename: Before - /Pictures/Phone/Camera/2026/02/PXL_20260205_092406741.jpg
    02-08 15:08:54.945  4308 10286 D AutoRename: After - /Pictures/Phone/Camera/2026/02/PXL_20260205_092406741.jpg
    

    I can confirm that this file was in fact uploaded when I look for it in the Nextcloud browser file explorer. I don't have logcat from when it was originally uploaded since I've restarted my phone while trying to troubleshoot. I do occasionally get notifications with "Upload failed": "Locked", but it doesn't mention the filename.

    Maybe I can try to reproduce the full logs with a new picture.


    This isn't it, but I did notice this when grepping for UploadFileOperation that's being emitted on each upload attempt. It says it's prompting me to disambiguate the conflict, but no prompt to pick the version is ever generated.

    02-08 15:25:50.130 11658 11679 D UploadFileOperation: creating upload file operation, user: trey@nextcloud.tr3y.io upload account name trey@nextcloud.tr3y.io
    02-08 15:25:50.130 11658 11679 W UploadFileOperation: UploadFileOperation file is null, obtaining from upload
    02-08 15:25:50.223 11658 11679 D UploadFileOperation: normal upload
    02-08 15:25:50.227 11658 11679 D UploadFileOperation: Checking name collision in server
    02-08 15:25:50.690 11658 11679 D UploadFileOperation: Name collision; asking the user what to do
    02-08 15:25:50.690 11658 11679 E UploadFileOperation: Upload of /storage/emulated/0/DCIM/Camera/PXL_20260204_112534536.MP.jpg to /Pictures/Phone/Camera/2026/02/PXL_20260204_112534536.MP.jpg: Synchronization conflict
    02-08 15:25:50.690 11658 11679 D UploadsStorageManager: updateDatabaseUploadResult uploadResult: RemoteOperationResult{mSuccess=false, mHttpCode=-1, mHttpPhrase='null', mException=null, mCode=SYNC_CONFLICT, message='null', getLogMessage='Synchronization conflict'} upload: com.owncloud.android.operations.UploadFileOperation@36b48aa
    

    I did notice that occasionally a few times in the last couple weeks when this started happening that I was being prompted to pick between the two apparently-identical versions of the file. But sometimes (not always), when I'd tap on the notification it wouldn't actually bring me to any dialog to pick.

    I do see in logcat occasionally logs like:

    02-08 15:54:04.361 11658 12365 E UploadFileOperation: Upload of /storage/emulated/0/DCIM/Camera/PXL_20260208_074504189.jpg to /Pictures/Phone/Camera/2026/02/PXL_20260208_074504189.jpg: File is currently locked by another user or process
    02-08 15:54:04.375 11658 12365 E 🔄📤AutoUpload: ❌ upload failed /storage/emulated/0/DCIM/Camera/PXL_20260208_074504189.jpg (trey@nextcloud.tr3y.io): File is currently locked by another user or process
    

    I have seen in the Nextcloud server logs messages like this intermittently:

    • Expected filesize of 27883115 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 26296320 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.
    • these were coupled in pairs, looking at timestamps
      • PHP Request Startup: POST Content-Length of 9869477 bytes exceeds the limit of 8388608 bytes at Unknown#0
      • Computed md5 hash is incorrect.
    • probably related to log rotation: Request used more than 300 MB of RAM: 506.4 MB

    I increased some limits relating to memory and post request sizes, in case I was stumbling into these.

    (fwiw, I don't see any disk errors or smart warnings on the disks backing the storage, so I don't think it's a storage problem)

    After some attempts at reproducing it, I can't make it occur. When I take a picture I see in logcat all the logs that seem to suggest the upload working fine and not resulting in this weird behavior, although maybe it'll crop up later?

  4. brentobi commented on Feb 8, 2026

    @brentobi

    Some additional description (incl. log snippet for one full file upload attempt): #16126 (comment).

    I also observed that sometimes a single file is correctly (?) resolved when pausing uploads during retry loop. (also described + logs in linked comment)

  5. alperozturk96 commented on Feb 9, 2026

    @alperozturk96
    Collaborator

    @brentobi @osovitskiy @delbonis @Oriann

    Hello

    I have checked the file-locking and incorrect sync conflict issues and created a PR to address them.

    You can download the generated QA APK from the provided PR link and extract the logs. That would be very helpful.

    In the meantime, I will continue reviewing the shared logs to see if any other issues exist.

    Thank you for the feedback.

  6. Oriann commented on Feb 10, 2026

    @Oriann

    @brentobi @osovitskiy @delbonis @Oriann

    Hello

    I have checked the file-locking and incorrect sync conflict issues and created a PR to address them.

    You can download the generated QA APK from the provided PR link and extract the logs. That would be very helpful.

    In the meantime, I will continue reviewing the shared logs to see if any other issues exist.

    Thank you for the feedback.

    Hello

    so far so good after 11 hours of usage.
    Steps taken:
    1.Installed new QA version on top of old one (upgrade).
    2.Photos started uploading automatically when I taken first photo (also with the old ones that did not upload in previous version)
    3.After taking 10 new shots I got uploaded only 7 other 3 were locked (maybe by Camera app), waited 15 minutes, photos did not uploaded. Waiting 1,5 hours, photos uploaded (maybe time was shorted I did not checked every 10 mins)
    4.Taken another 8 photos during day, all got uploaded but one. Last one uploaded after approx.45 minutes

    Result:
    App now trying to upload locked files and will success in about hour or 2. So currently its working for me. Maybe is there a way to shorten the time or this is completely out of hands of Nextcloud app ?

    Logs:

    logs_AutoUpload.txt
    logs_Failed.txt
    logs_Lock.txt
    logs_Retry.txt
    logs_Upload.txt

    For thought:
    I think photos are not holded for more than 10 seconds after taking the shot. I have also found out that locked photos are always the first 4 photos, the others will upload fine, maybe a little time offset until app start uploading should help ? I have feeling that for example my Galaxy S25 is tuning photos right after I take the shots and our app could wait a little more before starting upload so it can afterwards upload taken photos all at once when camera app stops tuning or scaling.

  7. hoshinolina commented on Feb 10, 2026

    @hoshinolina

    I checked and every single file I'm hitting this with was correctly uploaded (same SHA-1 hash as on-device). So there is no conflict.

    I suspect this simply happens when an upload succeeds, but the client never acknowledges that (consider: an upload succeeded but the connection was interrupted before the success reply can reach the client). It could also be that for whatever reason the client crashes or fails to record uploads as successful.

    The real issue is simply that the "the file is the same" case is just never handled properly. I tested this by just running touch on one of the problematic files on the phone, and retrying the upload. The client then does prompt for conflict resolution and it does whatever action I choose.

    This is a problem file being uploaded:

    02-10 19:38:16.400  4496 30889 E UploadFileOperation: Upload of /storage/emulated/0/DCIM/Camera/PXL_20260210_051928383.jpg to /InstantUpload/DCIM/2026/02/Camera/PXL_20260210_051928383.jpg: Synchronization conflict
    02-10 19:38:16.400  4496 30889 D UploadsStorageManager: updateDatabaseUploadResult uploadResult: RemoteOperationResult{mSuccess=false, mHttpCode=-1, mHttpPhrase='null', mException=null, mCode=SYNC_CONFLICT, message='null', getLogMessage='Synchronization conflict'} upload: com.owncloud.android.operations.UploadFileOperation@cd18f71
    02-10 19:38:16.712  4496 30889 V UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/PXL_20260210_051928383.jpg with status:UPLOAD_SUCCEEDED and result:SAME_FILE_CONFLICT (old:/storage/emulated/0/DCIM/Camera/PXL_20260210_051928383.jpg status:UPLOAD_IN_PROGRESS result:-1)
    02-10 19:38:16.712  4496 30889 V UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/PXL_20260210_051928383.jpg with status=UPLOAD_SUCCEEDED
    02-10 19:38:16.714  4496 30889 D UploadsStorageManager: Retrieve job com.owncloud.android.db.OCUpload@11eb1ad for id 8808
    02-10 19:38:16.717  4496 30889 D UploadsStorageManager: updateUpload returns with: 1 for file: /storage/emulated/0/DCIM/Camera/PXL_20260210_051928383.jpg
    02-10 19:38:16.717  4496 30889 D UploadsStorageManager: notifyObserversNow
    02-10 19:38:16.719  4496 30889 D UploadErrorNotificationManager: handle upload result with result code: SYNC_CONFLICT
    02-10 19:38:16.721  4496 30889 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/lina/InstantUpload/DCIM/2026/02/Camera/PXL_20260210_051928383.jpg
    02-10 19:38:16.914  4496 30889 W UploadErrorNotificationManager: exact same file already exists on remote, error notification skipped
    

    The result is status:UPLOAD_SUCCEEDED / result:SAME_FILE_CONFLICT, and there is no notification because the file is already uploaded, but the overall upload is considered as having the result code SYNC_CONFLICT and not removed from the uploads list / considered completed.

    This is the same file, after I ran touch on the phone to update the mtime:

    02-10 19:38:45.889  4496 31751 E UploadFileOperation: Upload of /storage/emulated/0/DCIM/Camera/PXL_20260210_051928383.jpg to /InstantUpload/DCIM/2026/02/Camera/PXL_20260210_051928383.jpg: Synchronization conflict
    02-10 19:38:45.889  4496 31751 D UploadsStorageManager: updateDatabaseUploadResult uploadResult: RemoteOperationResult{mSuccess=false, mHttpCode=-1, mHttpPhrase='null', mException=null, mCode=SYNC_CONFLICT, message='null', getLogMessage='Synchronization conflict'} upload: com.owncloud.android.operations.UploadFileOperation@ae3f47b
    02-10 19:38:46.210  4496 31751 V UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/PXL_20260210_051928383.jpg with status:UPLOAD_FAILED and result:SYNC_CONFLICT (old:/storage/emulated/0/DCIM/Camera/PXL_20260210_051928383.jpg status:UPLOAD_IN_PROGRESS result:-1)
    02-10 19:38:46.210  4496 31751 V UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/PXL_20260210_051928383.jpg with status=UPLOAD_FAILED
    02-10 19:38:46.215  4496 31751 D UploadsStorageManager: Retrieve job com.owncloud.android.db.OCUpload@ab35d57 for id 8808
    02-10 19:38:46.221  4496 31751 D UploadsStorageManager: updateUpload returns with: 1 for file: /storage/emulated/0/DCIM/Camera/PXL_20260210_051928383.jpg
    02-10 19:38:46.221  4496 31751 D UploadsStorageManager: notifyObserversNow
    02-10 19:38:46.223  4496 31751 D UploadErrorNotificationManager: handle upload result with result code: SYNC_CONFLICT
    02-10 19:38:46.226  4496 31751 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/lina/InstantUpload/DCIM/2026/02/Camera/PXL_20260210_051928383.jpg
    02-10 19:38:46.516  4496 31751 D UploadErrorNotificationManager: 🔔notification created
    

    Note that it's status:UPLOAD_FAILED / result:SYNC_CONFLICT now, the overall result code is SYNC_CONFLICT, and a notification is created.

    Now if I actually go through and resolve the conflict:

    02-10 19:38:57.881  4496 31060 I UploadFileOperation: Upload of /storage/emulated/0/DCIM/Camera/PXL_20260210_051928383.jpg to /InstantUpload/DCIM/2026/02/Camera/PXL_20260210_051928383.jpg: Operation finished with HTTP status code 204 (success)
    02-10 19:38:57.884  4496 31060 D UploadFileOperation: handling local behaviour for: PXL_20260210_051928383.jpg behaviour: 2
    [...]
    02-10 19:38:58.294  4496 31060 D UploadsStorageManager: updateDatabaseUploadResult uploadResult: RemoteOperationResult{mSuccess=true, mHttpCode=204, mHttpPhrase='No Content', mException=null, mCode=OK, message='null', getLogMessage='Operation finished with HTTP status code 204 (success)'} upload: com.owncloud.android.operations.UploadFileOperation@534957f
    02-10 19:38:58.296  4496 31060 V UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/PXL_20260210_051928383.jpg with status:UPLOAD_SUCCEEDED and result:UPLOADED (old:/storage/emulated/0/DCIM/Camera/PXL_20260210_051928383.jpg status:UPLOAD_IN_PROGRESS result:-1)
    02-10 19:38:58.296  4496 31060 V UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/PXL_20260210_051928383.jpg with status=UPLOAD_SUCCEEDED
    02-10 19:38:58.297  4496 31060 D UploadsStorageManager: Retrieve job com.owncloud.android.db.OCUpload@c2a894c for id 8810
    02-10 19:38:58.298  4496 31060 D UploadsStorageManager: updateUpload returns with: 1 for file: /storage/emulated/0/DCIM/Camera/PXL_20260210_051928383.jpg
    02-10 19:38:58.298  4496 31060 D UploadsStorageManager: notifyObserversNow
    02-10 19:38:58.299  4496 31060 D UploadErrorNotificationManager: handle upload result with result code: OK
    02-10 19:38:58.299  4496 31060 D UploadErrorNotificationManager: operation is successful, cancelled or lack of storage permission, notification skipped
    

    Now the result is status:UPLOAD_SUCCEEDED / result:UPLOADED and this is resolved to result code OK.

    I think this is a regression caused by a partial bugfix. In the past, I think when this situation happened, you'd get a conflict popup anyway (even for the same exact file). I think the upload logic was probably changed to detect this (the SAME_FILE_CONFLICT case), but then the higher level logic was not changed to handle this properly. So it went from "uploads that succeed but aren't marked as such are treated as false conflicts and the user is prompted", to "uploads that succeed but aren't marked as such become an unknown error".

  8. hoshinolina commented on Feb 10, 2026

    @hoshinolina

    I checked and in my DB the problem uploads are listed as:

    status=1(UPLOAD_FAILED), last_result=23(SAME_FILE_CONFLICT)

    But the log claims:

    02-10 20:25:36.721  4496 31751 E UploadFileOperation: Upload of /storage/emulated/0/DCIM/Camera/PXL_20260210_051927246.jpg to /InstantUpload/DCIM/2026/02/Camera/PXL_20260210_051927246.jpg: Synchronization conflict
    02-10 20:25:36.721  4496 31751 D UploadsStorageManager: updateDatabaseUploadResult uploadResult: RemoteOperationResult{mSuccess=false, mHttpCode=-1, mHttpPhrase='null', mException=null, mCode=SYNC_CONFLICT, message='null', getLogMessage='Synchronization conflict'} upload: com.owncloud.android.operations.UploadFileOperation@913e491
    02-10 20:25:37.050  4496 31751 V UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/PXL_20260210_051927246.jpg with status:UPLOAD_SUCCEEDED and result:SAME_FILE_CONFLICT (old:/storage/emulated/0/DCIM/Camera/PXL_20260210_051927246.jpg status:UPLOAD_IN_PROGRESS result:-1)
    02-10 20:25:37.050  4496 31751 V UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/PXL_20260210_051927246.jpg with status=UPLOAD_SUCCEEDED
    02-10 20:25:37.055  4496 31751 D UploadsStorageManager: Retrieve job com.owncloud.android.db.OCUpload@88138cd for id 8807
    02-10 20:25:37.061  4496 31751 D UploadsStorageManager: updateUpload returns with: 1 for file: /storage/emulated/0/DCIM/Camera/PXL_20260210_051927246.jpg
    

    I don't understand how this is possible. updateUploadInternal() prints the first message:

    Updating /storage/emulated/0/DCIM/Camera/PXL_20260210_051927246.jpg with status:UPLOAD_SUCCEEDED and result:SAME_FILE_CONFLICT
    

    And then it calls updateUpload() which prints the second message:

    Updating /storage/emulated/0/DCIM/Camera/PXL_20260210_051927246.jpg with status=UPLOAD_SUCCEEDED
    

    And that sets ProviderTableMeta.UPLOADS_STATUS. But somehow it ends up as UPLOAD_FAILED in the DB.

  9. hoshinolina commented on Feb 10, 2026

    @hoshinolina

    OK, I have a lead. FileUploadWorker.upload() has the call that triggers the SAME_FILE_CONFLICT special case (updateDatabaseUploadResult()):

                    uploadsStorageManager.updateDatabaseUploadResult(result, operation)
                    UploadErrorNotificationManager.handleResult(
    

    But it is itself called from uploadFiles() here:

                val result = withContext(Dispatchers.IO) {
                    upload(operation, user, client)
                }
                val entity = uploadsStorageManager.uploadDao.getUploadById(upload.uploadId, accountName)
                uploadsStorageManager.updateStatus(entity, result.isSuccess)
    

    And UploadStorageManagerExtensions.kt has:

    fun UploadsStorageManager.updateStatus(entity: UploadEntity?, success: Boolean) {
        entity ?: return
        val newStatus = if (success) {
            UploadsStorageManager.UploadStatus.UPLOAD_SUCCEEDED
        } else {
            UploadsStorageManager.UploadStatus.UPLOAD_FAILED
        }
        uploadDao.insertOrReplace(entity.withStatus(newStatus))
    }
    

    So it first marks the upload as UPLOAD_SUCCEEDED and SAME_FILE_CONFLICT, but then later up the call stack, because the actual upload is considered failed, it marks it as failed (without touching the other fields), and that's how you end up with the inconsistent database state of UPLOAD_FAILED + SAME_FILE_CONFLICT.

  10. hoshinolina commented on Feb 10, 2026

    @hoshinolina

    I think the fix is to simply remove this line (and the previous line, which is now dead code). upload() should already update the database state correctly, there's no need for a higher-level update at this point.

  11. hoshinolina commented on Feb 10, 2026

    @hoshinolina

    Those lines were added a few months ago in 6de9b48 with a commit message of fix: git conflicts by @alperozturk96. That was part of #15759 but the lines are part of the overall merge. I'm not sure how those lines ended up in the commit, since they don't seem to be related to a git conflict.

  12. alperozturk96 commented on Feb 11, 2026

    @alperozturk96
    Collaborator

    @hoshinolina

    Thank you for the detailed review. updateDatabaseUploadResult should be the only function responsible for updating the upload status. To clarify, FileUploadWorker is not used for auto uploads; both AutoUploadWorker and FileUploadWorker rely on UploadFileOperation.

    Therefore, we can ensure that the database update occurs only once within that shared operation. I will update the PR accordingly.

  13. hoshinolina commented on Feb 11, 2026

    @hoshinolina

    My understanding was that FileUploadWorker is used at least when you manually click on an upload in the uploads list to retry it (which is what I was doing to test this issue), since I didn't see any logs from AutoUploadWorker. But I guess AutoUploadWorker is used for background uploading of new files?

    I'm actually not sure how the latter is supposed to reach updateDatabaseUploadResult() at all. It does have the call to uploadsStorageManager.updateStatus() though. updateDatabaseUploadResult() is called directly by FileUploadWorker but the equivalent code in AutoUploadWorker (that creates and executes the UploadFileOperation) does not call updateDatabaseUploadResult(). The only other call I see to that function is in UploadTask which seems to be yet another thing...?

  14. Mickael-Martin commented on Feb 17, 2026

    @Mickael-Martin

    same issue here, do you need more logs ?

  15. daufinsyd commented on Nov 16, 2026

    @daufinsyd

    similar issue here :(

  16. alperozturk96 commented on Nov 17, 2026

    @alperozturk96
    Collaborator

    @Mickael-Martin @daufinsyd Hey,

    Could you please try with this QA APK #18049 and share the logs ?

  17. daufinsyd commented on Nov 19, 2026

    @daufinsyd

    Hi @alperozturk96,

    I tried to reproduce the bug with the latest 35.1.0 it seems to work but I also changed the two-way sync to Auto-Upload only.
    I'll try to reproduce with 2-way sync.

    Btw the 35.1 way snappier! Thank you <3

  18. Mickael-Martin commented on Nov 19, 2026

    @Mickael-Martin

    No reproduced for many weeks.
    Maybe already fixed...

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

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions