Can somebody explain me how data from android is synchronized to my owncloud server? How it works?

Can somebody explain me how data from android is synchronized to my owncloud server? How it works? Are files temporary moved from DCIM/camera to other folders? Are they temporary renamed, and if something goes wrong I can lost them?

A few days before I lost all (all from last weeks) my pictures and videos from my phone.
It looks like my synchronization stuck several weeks before, and I missed that. On Sunday I noticed that, and pressed “Retry” button, and forgot about the thing for some time. The very next day, I’ve noticed that all my camera content from several weeks gone. That was disaster for me. Tried to find it in different albums, then with file manager. Maybe in recycle bin? Nothing. All was vanished without any sight of existence.
I’ve tried to see what was backed up on my owncloud server – but here there was only message that my software is to old and I need to upgrade . So I did it immediately, but there were no my lost files on the server.
Then I pressed (I don’t know why) button “Retry” on my mobile. And it started synchronizing those non existing files to the server. After some time I had valid copies on the server, but nothing on my mobile. Can somebody explain to me what has happened? Why vanished files were able to be transferred to my server? Why they disappeared – from the very beginning I’ve marked option to not touch original files.
How to avoid it in the future?

Hello @Krzysiolek, thanks for reaching us!

Let me know some more details about it. Which app version are u using, v3.0.X?

I can explain a little bit about the camera uploads flow on the latest release:

  1. Check if there are new photos/videos to upload since the last camera uploads sync.
  2. If there are new photos/videos, we enqueue a new upload.
  3. Save the current timestamp to not upload again the same photos/videos.

This is repeated every 15 minutes (could be more depending on the device and energy settings…)

For each upload (additional steps can be done, this is a simple approach):

  1. Check if still have access to the original file (permissions could be removed)
  2. Copy the file to the internal cache (so we don’t lose access to the original file in case it is removed or permissions expired)
  3. If the user chose the default behavior (“original file will be kept in original folder”), original file will be kept in the original folder. If the user chose the “original file will be moved to app folder”, the original file will be removed.
  4. File is uploaded
  5. File is removed from the internal cache

So, taking this into account, I have just realized that the label of step 3 is not well defined. It should be something like “Original file will be removed from original folder” to be more accurate.

from the very beginning I’ve marked option to not touch original files.

With that info, if you set “original file will be kept in original folder”, this is a bug. Original files should not be removed. We were not able to reproduce it, but we will recheck.

Let us know the android version and app version.

Thanks in advance!

2 Likes

Thanks a lot @abelgardep,
now I understand the magic of how owncloud client app could send non-existent images. I hope the bug will be found soon because I almost had a heart attack when I realized I lost all my newborn baby photos (that was the reason I installed owncloud - to do unlimited backups).

My app version is 3.0.2 (61113a8f8), installed on SG-S22 Android v.13 with kernel 5.10.66-…blablabla

BTW: I see something like “localBehaviour=MOVE” in the log, do you think it could mean that the app misread the settings and decided that the file should be removed from the camera folder? There was also one strange behavior - the app was uploading mp4 while the phone was in my pocket, despite having the checkbox checked to only send videos when the phone is charged

Thanks a lot for your help

Hey @Krzysiolek

It should be something like localBehaviour=COPY

When we configure the picture uploads, a log like this one is written.

Picture uploads configuration updated. New configuration: FolderBackUpConfiguration(accountName=user@server, behavior=COPY, sourcePath=content://com.android.externalstorage.documents/tree/primary%3Atest, uploadPath=/CameraUpload, wifiOnly=false, chargingOnly=true, lastSyncTimestamp=1676477466587, name=Picture uploads)

Could you enable the logs, move to the picture uploads settings, and select the option to keep the original files again? Please, verify that a log like that one is there with the behavior=COPY

About the other one with video uploads, the video was actually uploading or the state was enqueued in the uploads section?

Conditions do not prevent from enqueuing the upload, but it will be enqueued till the condition is met, then the upload will be actually executed. If the upload fails for whatever reason and we retry it, it will be uploaded without taking care of the original conditions. There is an open issue on GitHub: [BUG] Upload when charging enabled: pictures uploaded without charging · Issue #3599 · owncloud/android · GitHub

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.