android icon indicating copy to clipboard operation
android copied to clipboard

Auto upload not triggered

Open christianlupus opened this issue 4 years ago • 23 comments

Steps to reproduce

  1. Set up the app to do auto uploads (e.g. use camera DCIM folder as suggested by default)
  2. (Optionally) Empty list of uploads to have a good view on the newly created (auto) uploads
  3. Take an image (which should trigger the upload)
  4. Wait a few minutes for the app to detect the newly created file

Expected behaviour

After some time (in the range of 5-10 min) the app should at least register an upload in the uploads section. Depending on the settings (only via WiFi for example), the upload will take place immediately, be queued, or be stalled.

Actual behaviour

The upload is never queued. It should have created anything in the list (be it stalled, queued, in progress, or done in the meantime). In fact, there is nothing logged at all.

I suspect that the detection of new files somehow fails.

Can you reproduce this problem on https://try.nextcloud.com?

As no upload is triggered, no network is involved. => Not tested

Environment data

Android version: 10

Device model: Dogee S96 Pro

Stock or customized system: Stock

Nextcloud app version: 3.18.0 RC6

Nextcloud server version: 22.2.3

Reverse proxy: Apache

Logs

Web server error log

Not network related

Nextcloud log (data/nextcloud.log)

Not network related

App logs

When making a photo and looking at the logs within the app, there is no line logged within a few minutes after the photo.

Unfortunately, the logs only go back until today morning, so older logs seem to have been rolled out. I cannot compare with a time where things were working.

NOTE: Be super sure to remove sensitive data like passwords, note that everybody can look here! You can use the Issue Template application to prefill some of the required information: https://apps.nextcloud.com/apps/issuetemplate

Additional information

This seems to be a regression, as it used to work until recently. I was on holiday and during part of it the auto uploads were still working as intended. Sometime around Nov 06th it suddenly stopped working. I am not sure about the exact point in time as my network connection was a bit hairy and I was not always able to use the NC server accordingly. So there was build a big list of outstanding uploads over these days. At some point, this list just did not get any longer.

christianlupus avatar Nov 19 '21 10:11 christianlupus

My upload queue has been empty for 3 weeks now. Neither photos nor videos are getting picked up. If I create a new custom folder, these files will be uploaded eventually, but the camera photo/video folder seems to be ignored. It used to work flawlessly until 3 weeks ago. Things I tried:

  1. Disabling energy saving mode for nextcloud
  2. Updating nextcloud app to version 3.18 RC6
  3. Renaming the target folder on the server (so that it should see all files as missing as the folder is not there)
  4. Clearing cache, restarting the phone
  5. Checking, if the upload functionality on a different account on the same server with a different phone still works. It does.

Here some (maybe) interesting logs:

2021-11-20T10:05:45.613+0100;D;UploadsStorageManager;QUERY: (status== ? OR last_result==9 OR last_result==13 OR last_result==11 OR last_result==14 ) AND last_result!= 16 ROWID: -1
2021-11-20T10:05:45.616+0100;V;UploadsStorageManager;getUploads() got 0 rows from page 0, 0 rows total so far, last ID -1
2021-11-20T10:05:45.616+0100;V;UploadsStorageManager;getUploads() returning 0 (0) rows after reading 1 pages
---
2021-11-20T10:05:45.769+0100;V;ArbitraryDataProvider;Updating arbitrary data with cloud id: global key: media_folders value: {"imageMediaFolders":[[...]"/storage/emulated/0/DCIM/Camera",[...]],"videoMediaFolders":[]}

So, for me it seems like it looks at the right place but doesn't find any new photos or videos despite there being like 40 or 50.

danielroehrig avatar Nov 20 '21 19:11 danielroehrig

I'm facing the same issue with Nextcloud client 3.18 for Android an a OnePlus Nord. I'm not sure however if the phone's make and model is of any importance here... During the client setup, I did notice something strange. When I select the folder to watch (example /storage/emulated/0/DCIM/Camera), the folder displayed as the "source" folder reads /storage/emulated/0/DCIM. So it seems as if the parent folder of the selected folder is watched?

ksmolder avatar Nov 28 '21 12:11 ksmolder

@ksmolder thanks for the tip; this might be a consequence of #8940 In the meantime try setting up the folder with the workaround there

AlvaroBrey avatar Nov 29 '21 10:11 AlvaroBrey

For me, the last uploaded file was from November 14, no photos taken later than that have been uploaded. /storage/emulated/0/DCIM/Camera is the path in settings. Pixel phone recently updated to Android 12 - but not sure if the date of Android update was November 14.

gjedeer avatar Nov 30 '21 11:11 gjedeer

Hello. Not sure if you managed to solve this, but for me denying and re-allowing the storage permissions fixed this issue.

martinmoreira avatar Dec 10 '21 21:12 martinmoreira

@martinmoreira Could you elaborate? How did you do this?

danielroehrig avatar Dec 12 '21 10:12 danielroehrig

Of course. For me it is: Android Settings / Apps & Notifications / See all Apps / Nextcloud / Permissions / Storage Then choose "Deny" And the "Allow again".

martinmoreira avatar Dec 12 '21 15:12 martinmoreira

I can't believe that actually worked! Thanks @martinmoreira

danielroehrig avatar Dec 12 '21 16:12 danielroehrig

For me, this workaround did work. So far I am not affected anymore. However, I do not know what triggered the problem and thus I am not sure if it will happen again. Also I do not know how I could get notified/aware of it happens again.

christianlupus avatar Dec 22 '21 20:12 christianlupus

It does not work for me as there is no "Storage" permission to alter between deny and allow. The only permission Nextcloud requested was Calender, Camera and Contact. I'm on Android 11, OnePlus 6, OxygenOS 11.1.2.2

rarealphacat avatar Dec 27 '21 14:12 rarealphacat

Looks like auto upload also stopped working on my android phone right after the 3.18 release (the date of the last uploaded picture coincides with the release of the version). My other android phone still running 3.15 continues to work fine. I will try to remove / reinstall / reconfigure 3.18 and see if it works again.

cfelicio avatar Dec 30 '21 03:12 cfelicio

Of course. For me it is: Android Settings / Apps & Notifications / See all Apps / Nextcloud / Permissions / Storage Then choose "Deny" And the "Allow again".

This is not possible on Android 11, OneUI 4.0, Samsung S21 Ultra.

Does anybody have any idea what is causing this?

IPlayZed avatar Feb 02 '22 20:02 IPlayZed

This is not possible on Android 11, OneUI 4.0, Samsung S21 Ultra.

I do not own a Samsung S21 Ultra but after a quick google search you should find it in Settings -> Privacy -> Permission Manager -> Storage

NicolasGoeddel avatar Feb 02 '22 20:02 NicolasGoeddel

Ok, so appareantly I took a picture with my phone and it triggered the upload sequence for every upload folder. Maybe the problem lies in it not being triggered by anything?

IPlayZed avatar Feb 02 '22 20:02 IPlayZed

This is not possible on Android 11, OneUI 4.0, Samsung S21 Ultra.

I do not own a Samsung S21 Ultra but after a quick google search you should find it in Settings -> Privacy -> Permission Manager -> Storage

Nextcloud is not there... To be more precise it seems like there is no normal storage permission for it.

However it is in Settings > Apps > Special access > All files access. For interest: I also found that on this setup you have to manually go and enable sync in system settings: Settings > Accounts and backup > Manage accounts > Nextcloud Idk if this makes a difference but shouldn't this be enabled by default?

Still, there must be some deep rooted problem with the autosync engine because it is not working on mobile internet connection, is only triggered by new items, etc.

IPlayZed avatar Feb 02 '22 21:02 IPlayZed

Is it possible this is somehow "feature" of android instead of Nextcloud problem? It looks to me as if OS decided that I haven't opened the nextcloud client for a long time, so the permission was removed, even though it's shown as allowed. Not sure if this is it or, perhaps, this is caused by OS update... My latest OS update was sometime at start of April which is also the last time my auto upload worked. Once I removed and re-applied the permission (thanks, @martinmoreira !!!) it works flawlessly again.

sanchosk avatar May 17 '22 07:05 sanchosk

@sanchosk in newer Android OSes there is a feature where app permissions, if not used, are disabled. That is a good feature actually, but I am not talking about that. Nextcloud should set these options ON by default during first launch or should periodically check against them. Also, there is the seperate question of when and how uploads are triggered.

IPlayZed avatar May 27 '22 14:05 IPlayZed

Hello. Not sure if you managed to solve this, but for me denying and re-allowing the storage permissions fixed this issue.

I can confirm this. I just discover auto upload stop working since months. When I looked at android logs, nothing was happening when a new photo was taken.

As @martinmoreira suggests, disable storage permission for nextcloud app and re-allowing it immediately make uploads start immediately

maisim avatar Jun 02 '22 10:06 maisim

On my Fairphone 2 running /e/ OS 1.0 (which is Android 10 on my phone) this workaround also worked but I had to

  1. start settings
  2. disable the storage permission
  3. leave settings
  4. wait a bit 15/20s
  5. start settings
  6. enable storage permission

This is still just a workaround not a bug fix.

I am still curious to get why this permission seems no more effective (does it come from Android or from Nextcloud).

b3 avatar Jun 25 '22 21:06 b3

I manually upload some newly taken picture files and that might trigger the whole auto upload process. Video files works but the auto upload process takes a bit longer to begin (~10mins). Maybe because phone still processing?

rarealphacat avatar Jun 27 '22 03:06 rarealphacat

I'm always having troubles with background activities of different apps when they are not using Google Play Services. Looks like everything not going through Google is a third class citizen in Android.

stefanholzapfel avatar Aug 09 '22 08:08 stefanholzapfel

Removing storage permission and then granting it again, also fixed an auto upload issue on a Huawei Mate 20 Pro with up to date system.

Also removing and regranting those permissions led to Nextcloud discovering lots of new folders for auto upload.

www-flomei-de avatar Aug 21 '22 22:08 www-flomei-de

@www-flomei-de this also worked for me on my Xiaomi Poco F1! Thanks a lot!

rcsilva83 avatar Sep 01 '22 01:09 rcsilva83

Thanks for the workaround of reallowing the storage permission, I was going mad.

I can confirm, that with very large folders, the autouploading does not start instantly but after some minutes is did.

benibr avatar Oct 08 '22 17:10 benibr

This still solution still doesn't work for me guys. I'm on Samsung s22 ultra. It was working on my old server that went kaputz. So I've rebuilt it, for my laptop sync'd again successfully, but Android still says no. Any ideas? Thanks

drumstick77 avatar Oct 18 '22 06:10 drumstick77

Still doesn't work. Could you please add some information to the page with the status? E.g. Pending permissions, Indexing, etc? This issue is so frustrating. Actually, this is the core feature, and it doesn't work.

nZeus avatar Oct 18 '22 10:10 nZeus

Uploading files manually works, but configuring it with auto upload doesn't even after trying the following:

  • set chmod read write access to data folder
  • set samsung to enable sync
  • set samsung not to let this app to sleep
  • set samsung to have full access to directories on the phone.
  • I've signed in with admin account from my phone, so given the admin access, it should just work. I can't see anything in the logs, it's very frustrating.

drumstick77 avatar Oct 18 '22 10:10 drumstick77

This is an issue with the App.

You can circumvent this by using FolderSync from the Play-Store which has Nextcloud-Support and syncs instantly without any issues.

The advantage to this is that you can also periodically sync folders with that one - not just when new files are detected - so that rules out any permission based issues and enforces a sync regulary.

thiscantbeserious avatar Oct 22 '22 20:10 thiscantbeserious

I had the same issue, with no new pictures detected by the Nextcloud App since a few weeks. Disabling and re-enabling storage permission did solve my issue.

9ycbgf0k8fpg avatar Nov 10 '22 07:11 9ycbgf0k8fpg

Hello. Not sure if you managed to solve this, but for me denying and re-allowing the storage permissions fixed this issue.

This also worked for me... it took so long to find a fix for this issue. Not that you really call this a fix, but hey...

theOryol avatar Nov 26 '22 01:11 theOryol