Photos fail to upload from Android client and get deleted

Hey, here’s a behavior that I’ve noticed lately. It happened a few times in the past weeks, after I’ve started to regularly use the Android client’s auto-upload feature, to back up my phone’s photos to my Nextcloud instance.

The setup:

  • I have a “sync” folder on my Android phone (Samsung Galaxy S22) where I move photos when I want them to get uploaded (typically after I sort through the huge amount that I take daily)
  • The auto-upload settings for the “sync” folder are set to move photos to the app folder after they’ve been uploaded

What happened:

  • When moving photos to the “sync” folder, upload starts as expected (when turning off data saver). The batches are quite large (200+ files, typically around 4MB each)
  • In my last upload, out of maybe 700 files, 368 uploads failed (according to the Android client auto-upload list). I don’t know why. The error reads “local file not found”
  • These photos don’t exit locally anymore indeed, since they’re supposed to be moved out of the “sync” folder and into the Nextcloud app folder after an upload
  • When searching for them on my Nextcloud, I can find many of them (all?), but they’re all marked as being 0 KB photos (i.e. they’re useless JPGs that somehow haven’t uploaded properly)
  • I had a hope that the original photos would be in the Nextcloud app folder. They’re not. The Nextcloud app folder also has 0 KB photos.
  • So basically I’ve lost 368 photos (as far as I can tell) (I’ve lost photos in this way before, but never as many, and haven’t reported it before)

My questions:

  • Is there a way the original photos could still be somewhere else, or have they been deleted?
  • Are these known issues of the type around auto-upload?
  • Are people using Nextcloud like I’m trying to, to back up their phone’s photos? Are they having the same issues? (I tried to look through these forums but couldn’t find similar topics)
  • Should I be using a different setup for auto-upload, to prevent/mitigate these issues?

Note that I don’t have access to my server at this time and I don’t want to get into server config and the like. This is a user flow and it seems like it should “just work” without server access. I don’t think I’m doing anything so special, I’m on the official Android client on a modern phone, on the latest server version, etc…

Bonus: other minor bugs I’ve noticed with auto-upload

  • I get a number of errors about a mismatch between the local and server version. These are usually confusing, e.g. it shows me the exact same file and asks which one should be kept. I’m positive the files I’m uploading didn’t exist on the server beforehand — just bugs, I guess
  • The feature to organize by YY/MM seems to be buggy. For example, in my last upload, I ended up with a bunch of photos from December in my 2024/01 folder on Nextcloud. Other photos have been uploaded to both 2023/12 and 2024/01, creating duplicates

This definitely doesn’t sound like proper behavior. Is this v3.26 or v3.27 of the Android app?

Even if it was a configuration matter (which it doesn’t sound like it is), one would expect the behavior to be consistent across all the files.

Unfortunately it can be challenging to isolate these types of problems without a clear way to reproduce and/or debug logs of the failure event(s) themselves.

If you think you can reproduce it, but want to do so without messing with your real data (understandable), you can install the Dev edition of the app in parallel with the standard edition of the app[1]. It’ll use it’s own local storage and operate as a completely separate app (with a little “Dev” string added to the app icon). The Dev edition of the app also has direct access to debug logs under Settings->Logs so if you can reproduce the behavior and provide those logs that would likely to helpful[2]. You can configure an auto-upload folder in the Dev edition for a dedicated to testing only folder like “syncTest” or whatever you prefer (just make sure it doesn’t overlap with one used by the non-Dev installation).

Is there a way the original photos could still be somewhere else, or have they been deleted?

IIRC photos get copied to tmp in the app installations data storage folder before upload, but I don’t recall how that interacts with the “move photos to app folder” option (not sure if it still happens in that case).

What is your Data storage folder set to under Settings set to out of curiosity?

[1] The easiest way to get the Dev edition is to install it via F-Droid
[2] If you do this, post report to GitHub - nextcloud/android: 📱 Nextcloud Android app