Repository navigation
Description
⚠️ 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
- Configure auto-upload
- 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
alperozturk96 commentedon Feb 6, 2026
@osovitskiy Hey,
I tried to reproduce the issue, but in my testing everything worked as expected. Here’s exactly what I did:
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?
delbonis commentedon Feb 8, 2026
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:
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
UploadFileOperationthat'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.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:
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.PHP Request Startup: POST Content-Length of 9869477 bytes exceeds the limit of 8388608 bytes at Unknown#0Computed md5 hash is incorrect.Request used more than 300 MB of RAM: 506.4 MBI 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?
brentobi commentedon Feb 8, 2026
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)
alperozturk96 commentedon Feb 9, 2026
@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.
Oriann commentedon Feb 10, 2026
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.
hoshinolina commentedon Feb 10, 2026
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
touchon 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:
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 codeSYNC_CONFLICTand not removed from the uploads list / considered completed.This is the same file, after I ran
touchon the phone to update the mtime:Note that it's
status:UPLOAD_FAILED/result:SYNC_CONFLICTnow, the overall result code isSYNC_CONFLICT, and a notification is created.Now if I actually go through and resolve the conflict:
Now the result is
status:UPLOAD_SUCCEEDED/result:UPLOADEDand this is resolved to result codeOK.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_CONFLICTcase), 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".hoshinolina commentedon Feb 10, 2026
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:
I don't understand how this is possible.
updateUploadInternal()prints the first message:And then it calls
updateUpload()which prints the second message:And that sets
ProviderTableMeta.UPLOADS_STATUS. But somehow it ends up asUPLOAD_FAILEDin the DB.hoshinolina commentedon Feb 10, 2026
OK, I have a lead.
FileUploadWorker.upload()has the call that triggers theSAME_FILE_CONFLICTspecial case (updateDatabaseUploadResult()):But it is itself called from
uploadFiles()here:And UploadStorageManagerExtensions.kt has:
So it first marks the upload as
UPLOAD_SUCCEEDEDandSAME_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 ofUPLOAD_FAILED+SAME_FILE_CONFLICT.hoshinolina commentedon Feb 10, 2026
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.hoshinolina commentedon Feb 10, 2026
Those lines were added a few months ago in 6de9b48 with a commit message of
fix: git conflictsby @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.alperozturk96 commentedon Feb 11, 2026
@hoshinolina
Thank you for the detailed review.
updateDatabaseUploadResultshould be the only function responsible for updating the upload status. To clarify,FileUploadWorkeris not used for auto uploads; bothAutoUploadWorkerandFileUploadWorkerrely onUploadFileOperation.Therefore, we can ensure that the database update occurs only once within that shared operation. I will update the PR accordingly.
hoshinolina commentedon Feb 11, 2026
My understanding was that
FileUploadWorkeris 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 fromAutoUploadWorker. But I guessAutoUploadWorkeris 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 touploadsStorageManager.updateStatus()though.updateDatabaseUploadResult()is called directly byFileUploadWorkerbut the equivalent code inAutoUploadWorker(that creates and executes theUploadFileOperation) does not callupdateDatabaseUploadResult(). The only other call I see to that function is inUploadTaskwhich seems to be yet another thing...?Mickael-Martin commentedon Feb 17, 2026
same issue here, do you need more logs ?
daufinsyd commentedon Nov 16, 2026
similar issue here :(
alperozturk96 commentedon Nov 17, 2026
@Mickael-Martin @daufinsyd Hey,
Could you please try with this QA APK #18049 and share the logs ?
daufinsyd commentedon Nov 19, 2026
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
Mickael-Martin commentedon Nov 19, 2026
No reproduced for many weeks.
Maybe already fixed...