Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic Upload is prepared #12596

Closed
4 tasks done
LunaticTazz opened this issue Feb 24, 2024 · 52 comments
Closed
4 tasks done

Automatic Upload is prepared #12596

LunaticTazz opened this issue Feb 24, 2024 · 52 comments
Assignees
Labels
bug feature: auto upload feature: data usage Network (mobile / wifi) data usage management feature: power management Power / battery matters stable-3.28

Comments

@LunaticTazz
Copy link

⚠️ 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

Set up Automatic Upload for in total four folders.
From time to time a notification is present on Android, that the automatic upload is prepared (German version "Automatisches Hochladen wird vorbereitet"). A progress bar is at min, the message disappears after a while and is retriggered from time to time. According to Android it pops up about 80 times a day.
Mobile background data is allowed, but uploads are only allowed on a WiFi network.
In addition to this, mobile data is consumed, but no files seem to be uploading. There's no files in the upload queue, there is nothing arriving on the server.
It is unknown to me, which files caused this behavior, but it's also present with only the photo folder being on automated upload (the other three have been deactivated).

Expected behaviour

Wait for WiFi to upload the files and be quiet if there is nothing to upload. No usage of mobile data.

Actual behaviour

Constant notifications, decreased battery life and mobile data consumption.

Android version

Android 11

Device brand and model

moto G 5G

Stock or custom OS?

Stock

Nextcloud android app version

3.28.0

Nextcloud server version

26.0.10

Using a reverse proxy?

No

Android logs

No response

Server error logs

No response

Additional information

No response

@joshtrichards joshtrichards added feature: auto upload feature: power management Power / battery matters feature: data usage Network (mobile / wifi) data usage management stable-3.28 labels Feb 24, 2024
@davidcrds
Copy link

I have the same issue on Android 14 (S22+). Auto Upload still works fine, but it keeps trying to do something which drains battery.

Running Nextcloud AIO currently on Version 27.1.5 on the Server.

@kadrim
Copy link

kadrim commented Feb 25, 2024

I have the same issue. It appeared a few days ago, most probably due to an update of the android app

  • samsung note 9
  • android 10
  • nextcloud server 28.0.2

@steel-moose
Copy link

Same issue here.

  • android 9
  • nokia 8 (HMD TA-1004)
  • version 3.28.0
  • nextcloud snap 27.1.6

Seems to be draining the battery much faster.

@regs01
Copy link

regs01 commented Feb 25, 2024

Also stuck for almost a day now.
firefox_2024-02-25_19-36-18

The problem with permanent scanning draining the battery has been there for very long. They just made a visible notification, so now those having the problem can see there is a problem.

@davidcrds
Copy link

Also stuck for almost a day now.
firefox_2024-02-25_19-36-18

The problem with permanent scanning draining the battery has been there for very long. They just made a visible notification, so now those having the problem can see there is a problem.

Removing bigger folders from Auto Upload shortens the notification considerably. So you are probably right.

@regs01
Copy link

regs01 commented Feb 26, 2024

And past the 17 hours it's still there in same position.

@kadrim
Copy link

kadrim commented Feb 26, 2024

Also stuck for almost a day now. firefox_2024-02-25_19-36-18

The problem with permanent scanning draining the battery has been there for very long. They just made a visible notification, so now those having the problem can see there is a problem.

you are right, that there are/were problems with this all along, but for me this was considerable better with the previous app-versions. this is not just about an indicator, but also the battery consumption is much worse right now.

@JustACasual
Copy link

I am also having this exact behaviour "Automatisches Hochladen wird vorbereitet" which appears from time to time.
App Version 3.28.0 from F-Droid
Android 13
Pixel 4a

@LunaticTazz
Copy link
Author

Also stuck for almost a day now.
firefox_2024-02-25_19-36-18
The problem with permanent scanning draining the battery has been there for very long. They just made a visible notification, so now those having the problem can see there is a problem.

Removing bigger folders from Auto Upload shortens the notification considerably. So you are probably right.

I have removed all folders from auto upload, I have disabled background data for the app, it's still scanning. Maybe it's something I have downloaded or synced with my nextcloud.
I haven't noticed it permanently scanning with big issues with battery life in the past, and I didn't notice the mobile data usage either, until my provider told me this month, that 80% of my quota is used, which is when I looked into it.
My feeling is, sorry for this poor proof, that it came with the latest update.

It's also present on my wife's phone, moto g30 on Android 12.

@regs01
Copy link

regs01 commented Feb 26, 2024

I have removed all folders from auto upload, I have disabled background data for the app, it's still scanning.

It stuck in some loop. Reboot the phone to have it restarted.

@vanMacG
Copy link

vanMacG commented Feb 27, 2024

Since 3.28.0 I also see the "Prepare automatic update" notification several times a day, although I don't have any folders configured for automatic upload.
There was no notifiaction in previous versions.

@LunaticTazz
Copy link
Author

I have removed all folders from auto upload, I have disabled background data for the app, it's still scanning.

It stuck in some loop. Reboot the phone to have it restarted.

I have cancelled all my Auto uploads, I have restarted the phone, the notification still pops up.

@el-kute
Copy link

el-kute commented Feb 28, 2024

I have the same issue

  • Samsung Galaxy SIII neo and Google Nexus 7 (2013)
  • both on Lineage 18.1 / Android 11

The problem stopped when reverting the Nextcloud app version back to 3.27.0 (using adb install -d nextcloud-3.27.0.apk from f-droid)

@marcdw1289
Copy link

marcdw1289 commented Feb 29, 2024

In the app under Settings -> More subsection -> Auto Upload is all the directories with images.

They are all toggled off but I guess the app does a check and hence the 'preparing' notifications (I think).

However, on my Android 8 and 9 ROMs I do no get these notifications. Only on A11. Don't have A12+ but assume this is an A11+ thing maybe. My A10 ROM doesn't have Nextcloud so haven't checked yet.

EDIT: Oh wait, someone said it happens on their Android 9. Hmm. Haven't noticed on my Havoc OS Pie. Will monitor.

@supern64
Copy link

supern64 commented Mar 1, 2024

same issue here, Galaxy A53, Android 14, Nextcloud AIO 27.1.5

@iGaneshKumar
Copy link

Nextcloud Auto Upload Notification

Same here, I should say I started using recently and from the very beginning I've been experiencing this issue.

Nextcloud Server Version: 28.0.2
Device Brand and Model: Samsung S9 Plus
Android Version: 10
Nextcloud Android App Version: 3.28.0

@symetryczny
Copy link

Same here, the notification started popping up a few days ago. Possibly when I updated the nextcloud app to the newest version but I cannot confidently confirm that.

Samsung S22FE
Android 14
Nextcloud app 3.28.0 downloaded from f-droid

@pglpm
Copy link

pglpm commented Mar 4, 2024

Same issue here, on Android, with Nextcloud 3.28.0 from F-droid. Most important is that no folders are chosen for autoupload in the settings; yet I see this recurring message. Uninstalling Nextcloud app until this problem is fixed.

@vabene1111
Copy link

vabene1111 commented Mar 4, 2024

Same issue on android 14 one plus 10.

Also, something is wrong with power consumption, 1 hour off the cable, 10% battery used and 6% went to nextcloud without any sync that could even happen.

@bobbolous
Copy link

bobbolous commented Mar 4, 2024

Same issue on:
SM-G781W (S20FE)
Android 13
NC App 3.28.0

@LunaticTazz
Copy link
Author

I don't know if it's related, but on my Tab "On the device" ("Auf dem Gerät") there are no files shown. Like a fresh install with nothing downloaded. I know for a fact that I have downloaded (or even chosen synchronize) to download a bunch of files and folders, which are still there. It even shows the green round bubble icon when I browse my Nextcloud under "All files".
Is this the sync that got lost and it's not even the auto upload folder? Just an idea.

@antoineguichard
Copy link

I have the same issue (Notification "Preparing auto upload" appearing most of the time).
On three phones of the same model and running the same software versions.
From what I can figure out, it appeared right after NC app upgrading to 3.28.0.

Honor 10 lite (HRY-LX1)
Android 10
NC app 3.28.0
Screenshot_20240305_091432_com nextcloud client_preparing-auto-upload

@meonkeys
Copy link

meonkeys commented Mar 6, 2024

I'm able to get rid of the "Preparing auto upload" notification temporarily if I disable Battery Saver and force kill the app.

I recall I'm supposed to leave the Nextcloud app battery usage set to "Unrestricted" but I noticed it draining my battery a few weeks ago so for now it is "Restricted".

Hmm, perhaps using anything other than "Unrestricted" actually causes the app to use more battery?

@JonasMayerDev
Copy link
Collaborator

Hi all, thanks for the report.

Analysis

Yes, this behavior of showing a notification when ever sync work is done (so also checking if files need to be uploaded) was introduced in #12337. The idea behind it was to make the autoupload more reliable and a lot faster because there were cases where the background worker was killed by android and the sync didn't work because of this. In theory, as some already said, the notification should only visualize what was already happening in the versions before. I would say there are 3 issues with this implementation currently:

  1. Worker runs without auto upload activated when auto upload was activated before (issue probably existed before but was never visible).
  2. I think the sync worker runs too often (I would guess that is the reason you see the notification all the time, I guess that the sync worker just executes again and again and is always showing the notification)
  3. The new foreground worker consumes too much energy (This is also just a guess, but I think changing the sync worker to a foreground worker results in higher batterie usage because the worker is not randomly killed by the android system. This is on one side good for reliability of the sync but bad for the batterie consumption)
    I actually have not looked into it deeply yet, so those are just some guesses that need to be confirmed.

Question

It would help if you could answer some questions to confirm / fix those issues more quickly:

  1. For those that see the notification without autoupload activated, did you all have it activated at some point in the past or do you even see the notification on a clean installation for example?
  2. How large are the folders for which auto upload is activated (rough folder size and file count)?
  3. Was autoupload before this update unreliable for you?
  4. For those that have a notification that sticks for longer than 5 min, is it stuck from the first time appearing or is it first behaving normally (so appearing for short times and disappearing again) and then at some point it is stuck? Do you have a way to reproduce the issue of a stuck notification?

@ezelbanaan
Copy link

ezelbanaan commented Mar 18, 2024

  1. For those that see the notification without autoupload activated, did you all have it activated at some point in the past or do you even see the notification on a clean installation for example?

N/A

  1. How large are the folders for which auto upload is activated (rough folder size and file count)?

23 GB; 5000 files

  1. Was autoupload before this update unreliable for you?

I never had any issues with it. It seemed to upload fine most times I checked it

  1. For those that have a notification that sticks for longer than 5 min, is it stuck from the first time appearing or is it first behaving normally (so appearing for short times and disappearing again) and then at some point it is stuck? Do you have a way to reproduce the issue of a stuck notification?

N/A

Info
Samsung Galaxy S23 Ultra
Android 14
App version 3.28.0
No failed or error'ed uploads

I did notice a significant increase in battery usage though. It uses about 10% of my battery a day now, while it didn't use nearly as much before.

@JustACasual
Copy link

For me also auto upload is doing fine, I just find the notification every few minutes annoying. Not so bad though.
It stays for a few seconds on my device. Then it goes away.

@JonasMayerDev
Copy link
Collaborator

JonasMayerDev commented Mar 21, 2024

Hi, do you all use custom folders (create new custom folder from the 3 dot menu) for auto upload or did you just activate auto upload for the automatically detected media folders? In general, do you just backup images and videos or do you also auto upload other file types like documents?

@Pr0mises
Copy link

S22+ Android 14
NC Android: 3.28.0
NC AIO: Nextcloud Hub 6 (27.1.7)

Hi, do you all use custom folders (create new custom folder from the 3 dot menu) for auto upload or did you just activate auto upload for the automatically detected media folders?

Due to way too many media folders, I created 2 crustom folders:

  1. /Android/DCMI/
  2. /Android/media/

In general, do you just backup images and videos or do you also auto upload other file types like documents?

I'm also uploading backups from whatsapp/signal and other documents

As I had some bugs with it a while ago(duplicated files spam, not sure if it's fixed by now), therefore I've the following settings:

  • Upload only if free Wifi is available
  • Only while charging
  • Upload existing files
  • Keep original file
  • Overwrite the server version

@vanMacG
Copy link

vanMacG commented Mar 21, 2024

  1. For those that see the notification without autoupload activated, did you all have it activated at some point in the past or do you even see the notification on a clean installation for example?

I can't remember having it activated in the past... nevertheless I just deinstalled the app and did a fresh installation. The notification didn't show up in the last minutes, so this seems to "fix" the issue.

@ezelbanaan
Copy link

Hi, do you all use custom folders (create new custom folder from the 3 dot menu) for auto upload or did you just activate auto upload for the automatically detected media folders? In general, do you just backup images and videos or do you also auto upload other file types like documents?

I just use the default folders, but I did change the remote folder.

@jazztickets
Copy link

I still get the notifications on a fresh app install. Disabling 'File Sync' notifications fixes it though.

@vanMacG
Copy link

vanMacG commented Mar 21, 2024

  1. For those that see the notification without autoupload activated, did you all have it activated at some point in the past or do you even see the notification on a clean installation for example?

I can't remember having it activated in the past... nevertheless I just deinstalled the app and did a fresh installation. The notification didn't show up in the last minutes, so this seems to "fix" the issue.

And there it is again... So no, notification also on a fresh installation without autoupload activated even once.

@beardhatcode
Copy link

I also see this issue on A Samsung Galaxy S10+ (Android 12)

@GanterFengDavid
Copy link

Same issue here with Xiaomi 14, HyperOS 1.0.31.0, Android 14

@reox
Copy link

reox commented Apr 4, 2024

I have not seen the message yet with 3.28.1 (I had it like every hour or so before and it would not go away on a Pixel 7 / Android 14) but instead some photos are upload much later than before. They are not even scheduled to upload right away. So far, it looks like all of them were uploaded eventually, thus no photo is lost, but it takes much longer than before.

@reox
Copy link

reox commented Apr 24, 2024

I saw the message not once in 3 weeks and now it's back with 3.29.0

@ghaberek
Copy link

I saw the message not once in 3 weeks and now it's back with 3.29.0

Can confirm this issue was gone while on 3.28.1 and has since returned with 3.29.0. I am on Android 12 on OnePlus Nord N20.

@ezelbanaan
Copy link

I saw the message not once in 3 weeks and now it's back with 3.29.0

Same here

@markthebro
Copy link

Couple of days ago I did an update to V3.29.0.
My friends and family as well.
Before we were using V3.28.2 - no issues at all.

Since V3.29.0 every ~ 30min a notification appears that an auto-upload is in preparation even though there is nothing to upload.
Issue is on several different phones.

  • Samsung Galaxy S23 (Android 14)
  • Samsung Galaxy A51 (Android 14)
  • OnePlus Nord (Android 11)

I think no more details need to be added - if so, please do not hesitate to ask for more infos, like logfiles, configuration etc.

@JonasMayerDev
Copy link
Collaborator

Hi, yes, we are aware of this. The "fix" in V3.28.2 was a bug that reduced reliability (to the point it was before 3.28), because it removed the foreground worker (basically a prioritized worker that needs to show a notification to run). We are trying to get rid of the foreground worker (#12954) but it is not that easy while maintaining and guaranteeing reliability.

Just FYI the notification has nothing to do with upload, it shows when the file system is scanned for changes. Maybe the text was not well-chosen.

@paulchen
Copy link

paulchen commented May 1, 2024

Just FYI the notification has nothing to do with upload, it shows when the file system is scanned for changes. Maybe the text was not well-chosen.

But why does the app scan the file system at all if "Auto Upload" is disabled? Or has that behaviour already been changed?

@reox
Copy link

reox commented May 1, 2024

At least I noticed that with the new version, the notifications are visible much less often and typically also disappear on their own. Before 3.28.1 they would be persistent for me.

@vabene1111
Copy link

Not sure if its relevant but on 3.29.0 even tough the phone is not charging and I have automatic upload set to run only when charging the notifcation is popping up every few hours. Its also still the case that nextcloud is responsible for the majority (1/4 of total usage, usually highest app consumption) of my battery usage (no change between automatic upload with or without charging).

I have two folders synced, one with just a few hundred, one with several thousand images.

@JonasMayerDev
Copy link
Collaborator

@reox That's wonderful to hear. We did a lot of optimization for auto upload to make the issue less annoying, and it's nice to hear that it at least helped a little bit.

@vabene1111 @paulchen good point, I included fixes for that in this PR: #12372 With it, it should only scan the file system if charging when "only when charging" is activated :)

@billie80
Copy link

billie80 commented May 5, 2024

@vabene1111 @paulchen good point, I included fixes for that in this PR: #12372 With it, it should only scan the file system if charging when "only when charging" is activated :)

If I did not get this wrong this fixes would only apply if (custom) auto upload folders are defined. If no folders are defined it should not scan at all I guess?

Under "More - Auto upload" I did not define any folders and "Show media scan notifications" is disabled so media folders aren't scanned and thus also not shown as auto upload folders.

Still with this settings from time to time the "Prepare automatic update" notification appears. This is with the Nextcloud App Version 3.29.0.

@JonasMayerDev
Copy link
Collaborator

@billie80 it should with this fix also not do anything if no auto upload folder is enabled.

@JonasMayerDev
Copy link
Collaborator

With #13015 we removed the foreground worker and with it the notification "Preparing auto upload" 🥳

There is the risk that with the change the auto upload is a little bit more unreliable since android background restrictions could act harder on our background jobs. As they did before introducing background worker and the according notification -> So if it was without that notification reliable then it still should be.

I would consider this issue closed since the notification is gone in the next releases. Thanks for reporting this. If there should be other issues with auto upload and / or significant reduction in reliability, please open another issue about it and feel free to connect it to this issue or the PR.

@billie80
Copy link

billie80 commented Jul 2, 2024

Still happens with 3.29.1!
Edit: I see the fix it targeted for 3.30.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug feature: auto upload feature: data usage Network (mobile / wifi) data usage management feature: power management Power / battery matters stable-3.28
Projects
Archived in project
Development

No branches or pull requests