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

Autoupload causes Nextcloud app to freeze and not respond after crashing is fixed #7378

Open
InfamousUser opened this issue Nov 19, 2020 · 84 comments
Labels
approved bug feature: auto upload no-stale Use this to prevent staling of issues that need info but shouldn't be closed for some reason performance: general/non-specific lag, ANR, etc and rarer exceptions/errors that don't have their own labels

Comments

@InfamousUser
Copy link

InfamousUser commented Nov 19, 2020

Edit: Currently not testable as I cannot get to the point of uploads actually being queued due to a bug, this needs to be fixed first before being able to troubleshoot this further.

Steps to reproduce

  1. Have QA version of Nextcloud from Directly start foreground service #7340
  2. Have a lot of uploads set to be auto uploaded
  3. Wait

Expected behaviour

File should get uploaded normally

Actual behaviour

Files get uploaded and the app constantly gets ANR dialogues and freezes the Android system interface half the time.

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

  • Please create a test demo account and see if this still happens there.
  • If yes, please open up a bug report
  • If not, please verify server setup and ask for help on forum

Environment data

Android version: 11

Device model: Google Pixel 2

Stock or customized system: stock

Nextcloud app version: 3.15.0

Nextcloud server version: 19.0.4

Reverse proxy:

Logs

Web server error log

Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Logcat logs (I think): [Nextcloud.txt](https://github.com/nextcloud/android/files/5567880/Nextcloud.txt)

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

@tobiasKaminsky tobiasKaminsky added the needs info Waiting for info from user(s). Issues with this label will auto-stale. label Nov 20, 2020
@tobiasKaminsky
Copy link
Member

Do you see where and when it hangs? Can you give us a screenshot?

@InfamousUser
Copy link
Author

I think it hangs when it attempts to autoupload. I don't need to be in the app, I can be in another app and I get the ANR dialogue. Otherwise I simply go to uploads menu and it freezes there if it's autouploading, if it isn't autouploading, then it might work normally.

When it says "App terminated" under the uploads, if I press "Failed/pending restart", it freezes, the Android interface freezes as well for 20~ seconds and then it displays ANR.

Nothing out of ordinary to screenshot; all looks normal, but when it starts to autoupload it's as if it gets overloaded and everything freezes while it processes.

@tobiasKaminsky
Copy link
Member

When it says "App terminated" under the uploads, if I press "Failed/pending restart", it freezes, the Android interface freezes as well for 20~ seconds and then it displays ANR.

That is an important point, thanks!

@tobiasKaminsky
Copy link
Member

How many failed items do you have?

@InfamousUser
Copy link
Author

InfamousUser commented Nov 23, 2020

When it says "App terminated" under the uploads, if I press "Failed/pending restart", it freezes, the Android interface freezes as well for 20~ seconds and then it displays ANR.

That is an important point, thanks!

Oh?

How many failed items do you have?

37862

@tobiasKaminsky
Copy link
Member

Failed/pending only reloads stored items from database and displays them.
If you have >30k items this just takes too long.
So this is somehow unrelated to AutoUpload, it just occurs due to the uploading of all old images.

You could trigger this also manually, when uploading 30k images.

@InfamousUser
Copy link
Author

So this is somehow unrelated to AutoUpload, it just occurs due to the uploading of all old images.

That's what I thought, but then again I don't know much about programming so...
This happened without adding upload existing files before though, I even reported a bug a while ago because Nextcloud was never uploading my stuff, only to realize it was never designed to do so when it was added as a feature and it never said it wouldn't. So this must have existed before that.

@bardo
Copy link

bardo commented Dec 1, 2020

I had a similar issue when I enabled auto-upload on a folder with a few thousand pictures on a Pixel 3a. The app kept freezing and crashing, and after every restart it would start again from the beginning without looking for already synchronized files. I disabled power saving for the app as indicated in the manual, but it did not help, it was not able to run in the background. Power consumption was also extremely high while uploading.

As a workaround I forced the screen to stay on by enabling developer mode on Android and activating the corresponding option (you can also install Coffee for the same result), connected the phone to a USB cable, and let it synchronize with the app open. It took a long time but it worked.

Clearly, this isn't a good workaround for a non-technical user, but it can get the job done.

@InfamousUser
Copy link
Author

Right, I think I did that one time with uploads menu open, if I didn't touch the app it wouldn't crash, but as soon as I tried scrolling or moving around it would hang, trying it multiple times caused a crash or non responsiveness dialogue iirc.

@InfamousUser
Copy link
Author

Here is log for 3.14.1 freeze and crash in case it helps any. I scroll the upload menu slowly, it works for a couple of seconds, then around 15:19:40 it freezes for about 3-5 seconds, then automatically reopens with loading screen and whole Android is frozen for half a minute (system buttons on the botton don't work), then it unlocks and I get ANR dialogue.

Log_2020-12-05_15-21-30.txt

@tobiasKaminsky
Copy link
Member

Judging from logcat, thanks for that, it seems indeed that the app uses too much memory and therefore Android tries to kill it.
Maybe Pixel 2 is more restrictive…

@InfamousUser
Copy link
Author

InfamousUser commented Dec 16, 2020

If it helps, in Android memory usage it says it uses an average of 26 MB and 156 MB maximum, if that's accurate.
It should be able to use almost all RAM in foreground. I mean, I'm sure modern games take at least 1-2+ GB when running. There must be something specific that's tripping it up.
Unless there's something that causes sudden spike in memory usage that doesn't show up in system data.
It shouldn't naturally be using nearly as much as 1GB, but lack of memory shouldn't be reasonably happening.

@tobiasKaminsky
Copy link
Member

Maybe the implementation of listing those files is sup-optimal and thus creates to much memory…

@InfamousUser
Copy link
Author

InfamousUser commented Dec 18, 2020

Must be, it's been created that way. Since I've first seen it there was stuff wrong with autoupload, first it wouldn't upload, haven't been relying on it for years, or since introduction, then gave it another shot and it's been having these crashes/freezes for a year or two, at least it uploads stuff now. My previous phone failed around that time and didn't have anything backed up, lost all that was on it, the flash chip or bootloader failed for some reason.

I'd love to be able to use it reliably, as would the rest of the community I'm sure. Especially as an enterprise option. I don't understand how so many problems with one thing.

If you need any further data to get this fixed I'm available.

P.S. Not trying to flame, just being honest.

@github-actions
Copy link

This bug report did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

@github-actions github-actions bot added the stale label Feb 24, 2021
@oxc
Copy link

oxc commented Feb 24, 2021

Is there any further information required at this point?

@InfamousUser
Copy link
Author

I don't know how to stop the bot from closing this. Convensional means of saying something doesn't work.

@tobiasKaminsky
Copy link
Member

Is this only ANR (app not responding) when you want to list/refresh failed uploads?
Or also if you click on restart failed uploads and then suspend app in background?

@InfamousUser
Copy link
Author

InfamousUser commented Feb 24, 2021

Happens by itself in the background when I'm minding my own business (I assume when it autouploads), it happens if I restart failed uploads, it happens if I just open the uploads menu and look or scroll. Also perhaps important is that when I freshly open the app and go to uploads, it will upload a random small number of files successfully (lets say 3) and then it will freeze and then start not responding/stop responding (no more get uploaded after this point).

@github-actions github-actions bot removed the stale label Feb 25, 2021
@tobiasKaminsky
Copy link
Member

Do you still have those 32.000 failed uploads?

@InfamousUser
Copy link
Author

20k now.

@InfamousUser
Copy link
Author

I will try reinstalling the app, deleting the data on server and resyncing everything from scratch.

@github-actions
Copy link

This bug report did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

@hakong
Copy link

hakong commented Nov 8, 2022

Happens here too.

App is:

  • stuck in a loop
  • crashes when uploading
  • refuses to upload when not charging ("Awaiting charge") even though both folders configured in Auto Upload do NOT have "Only upload when charging" checked.

This is unacceptable experience for someone wanting to move from a service like Dropbox or Google Photos. How is this issue 2 years old and not solved? I can log into Google Photos or Dropbox on a new account with thousands of photos on the phone and it will just upload. Worry-free, comfortable user experience.

With Nextcloud, it's a constant struggle. Restarting the app, clearing the cache, re-installing the app, re-starting the upload process, enabling/disabling settings hoping that it'll complete at least one round of uploads.

This feature is broken and should at the very least be marked as BETA.



Edit: After 3 days of struggling to complete the initial upload it has:

  • uploaded 734 items + 99 sync conflicts (according to the app)
  • but there are 990 photos under InstantUpload/Camera in Nextxcloud
  • where as the app says there are 842+131=973 in the folders I selected to upload

App uploads+sync conflicts: 833
Files in nextcloud: 990
Photos+videos in selected folders: 973

None of these numbers match. That's ridiculous. I have 0 confidence in this.

@stoically
Copy link

stoically commented Nov 8, 2022

@hakong While I do understand your frustration, you should keep the following in mind: If Google (or any of its automated scans) declare your account as suspicious and close it, you're done – good luck contacting them. With self-hosted cloud you keep control, or normally have a responsive admin, if it's a small hoster.

Also, it being that problematic is a recent issue, see here: #10993

@AHermann94

This comment was marked as off-topic.

@stoically
Copy link

stoically commented Nov 8, 2022

@AHermann94 True. And Google being very thorough in terms of backups doesn't help you if your account is closed.

@AHermann94

This comment was marked as off-topic.

@stoically

This comment was marked as off-topic.

@AHermann94

This comment was marked as off-topic.

@munsuri
Copy link

munsuri commented Nov 8, 2022

@stoically said:
Also, it being that problematic is a recent issue, see here: #10993

It is not recent. I've been trying to backup all my photos and videos (around 10.000) in my Android with the Nextcloud Android app for almost a year and it's still not done as after uploading a few it just hangs and the app keeps on crashing/being automatically killed by Android for being unresponsive.

I've now started to setup the project locally so I can debug it myself....

@stoically
Copy link

@AHermann94 No reason to get rude.

@munsuri / @AHermann94 It worked for me for years. I'm sorry if it doesn't work for you at all.

@AHermann94

This comment was marked as off-topic.

@stoically
Copy link

stoically commented Nov 8, 2022

@AHermann94 No worries. The issues are related: It was an sporadic issue in the past for me, but it got worse recently. That's what I was trying to say by referencing #10993.

Btw: Maybe technical issues in source repositories are not the place to get sarcastic. Staying on topic helps generally.

@hakong
Copy link

hakong commented Nov 8, 2022

Bottom line is: if I don't have confidence in the app to properly back up / sync one of my most valuable digital posessions (photos+videos), it's completely useless.

I took the time to comment on this thread today because I gave Nextcloud another chance.
Every 2, maybe 3 years I think "I really should not be this dependent on Google, let's give Nextcloud another chance" and every time for the past 7+ (I think? I started with Owncloud) or so years I come to the same conclusion: it does not work.

If can't be confident it'll work reliably, forget it.

@InfamousUser
Copy link
Author

Repeating this for the 10th or so time. The problem with autoupload existed since it was added, it's been going on for years. Nobody is fixing it. There were finally attempts and some fixes a while ago, but this just resolved some symptoms, the feature as whole doesn't work (for some people) and is unstable.

@EvilOlaf
Copy link

EvilOlaf commented Nov 8, 2022

I "worked around" this issue by frequently killing the app once it did not respond anymore until everything was uploaded. Once that big initial chunk was done everything worked smoothly from that point. Obviously not ideal though.

@InfamousUser
Copy link
Author

InfamousUser commented Nov 8, 2022

Not only not ideal, but not a solution at all, just a workaround. Not worth commenting about, this needs to be solved, not found workarounds for by people for years.

@AHermann94
Copy link

I tried to do that but gave up after ~36h and about 1GB of data on the NAS.

@EvilOlaf
Copy link

EvilOlaf commented Nov 9, 2022

Not only not ideal, but not a solution at all, just a workaround. Not worth commenting about, this needs to be solved, not found workarounds for by people for years.

Yep, just a poor workaround. But well, what do you want to do? If an issue report does not get attention after a while people will start to tinker on their own to find solutions and "solutions" 😁

I tried to do that but gave up after ~36h and about 1GB of data on the NAS.

Hm that is quite low...guess it depends on the phone how badly it works.

@victordariovera
Copy link

I have a thing to say. Nextcloud app completely hangs in a Samsung Galaxy S52 with 6gb of RAM. BUT, I switched to a brand new Samsung Galaxy S22 Ultra with 16gb of RAM and Nextcloud app works awesome. I think its an optimization issue.

@yeupou
Copy link

yeupou commented Dec 4, 2022

I suffer this problem since about a month. It was working finely for years.

I tried many versions of the android app, assuming something changed recently. I also tested by reducing the amount of files on the phone. It still hangs when configuring a simple 7 pictures folder.

The lack of autoupload really decrease the usability and usefullness of the app.

And the issue handling is a mess: app unresponsive, using CPU and eating battery. As if there was a loop or something. Is there any plan regarding this opened 2 years ago?

@stoically
Copy link

@yeupou My workaround is pinning to an older version: Deinstall Nextcloud App fully. Now install version 3.22.2 via apk (https://github.com/nextcloud/android/releases/tag/stable-3.22.2), disable auto updating of the app (play store -> manage apps -> open nextcloud app infos -> three dots top right -> untick "enable auto-update" checkbox) and now log into the app and configure auto-uploading accordingly.

@Regis-Frollo
Copy link

Same here:

Cause of error

Exception in thread "Thread-8" java.lang.OutOfMemoryError: Failed to allocate a 160 byte allocation with 1001976 free bytes and 978KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC.
    at com.android.org.conscrypt.NativeCrypto.X509_get_subject_name(Native Method)
    at com.android.org.conscrypt.OpenSSLX509Certificate.getSubjectX500Principal(OpenSSLX509Certificate.java:501)
    at okhttp3.internal.tls.BasicTrustRootIndex.<init>(BasicTrustRootIndex.kt:28)
    at okhttp3.internal.platform.Platform.buildTrustRootIndex(Platform.kt:163)
    at okhttp3.internal.platform.Platform.buildCertificateChainCleaner(Platform.kt:160)
    at okhttp3.internal.platform.Android10Platform.buildCertificateChainCleaner(Android10Platform.kt:82)
    at okhttp3.internal.tls.CertificateChainCleaner$Companion.get(CertificateChainCleaner.kt:42)
    at okhttp3.OkHttpClient$Builder.sslSocketFactory(OkHttpClient.kt:870)
    at com.nextcloud.common.PlainClient$Companion.createDefaultClient(PlainClient.kt:62)
    at com.nextcloud.common.PlainClient$Companion.access$createDefaultClient(PlainClient.kt:47)
    at com.nextcloud.common.PlainClient.<init>(PlainClient.kt:45)
    at com.nextcloud.client.network.ClientFactoryImpl.createPlainClient(ClientFactoryImpl.java:94)
    at com.nextcloud.client.network.ConnectivityServiceImpl.isInternetWalled(ConnectivityServiceImpl.java:79)
    at com.owncloud.android.files.services.FileUploader.retryFailedUploads(FileUploader.java:1067)
    at com.owncloud.android.utils.FilesSyncHelper.lambda$restartJobsIfNeeded$0(FilesSyncHelper.java:240)
    at com.owncloud.android.utils.FilesSyncHelper$$ExternalSyntheticLambda0.run(Unknown Source:10)
    at java.lang.Thread.run(Thread.java:920)

App information

  • ID: com.nextcloud.client
  • Version: 30220290
  • Build flavor: generic

Device information

  • Brand: samsung
  • Device: beyond2
  • Model: SM-G975F
  • Id: SP1A.210812.016
  • Product: beyond2lteeea

Firmware

  • SDK: 31
  • Release: 12
  • Incremental: G975FXXUGHVJ5

@chris246
Copy link

chris246 commented Dec 7, 2022

For me the app is just completely unusable and often hangs directly after opening it when it is showing the files list.
Auto Upload is enabled, a few files are queued for upload but the phone is not plugged in.

After plugging in the phone, the app hangs for ~10 s longer and then magically works.

As mentioned before, killing the app multiple times via Android Settings usually resolves it, but this is not how it should work.

@victordariovera
Copy link

victordariovera commented Dec 7, 2022 via email

@joshtrichards joshtrichards added feature: auto upload performance: general/non-specific lag, ANR, etc and rarer exceptions/errors that don't have their own labels and removed feature: auto upload labels Aug 22, 2023
@GownerCode
Copy link

It is now May 2024, the original issue is almost 4 years old and the issue persists still. Phones with limited RAM like my Pixel 4a are still not able to handle uploading more than a few hundred pictures at once with auto-upload. I have 2600 pictures in the whatsapp folder. If I add it to auto-upload, it will queue up up to 2000 of them. Then they all instantly fail with the message "App terminated", it instantly starts collecting them all again until it reaches that mark, they all fail and so on. With each go, you're lucky to upload 3-4 pictures.

I can definitely understand some people's frustration here. Why is this issue still open after 4 years?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved bug feature: auto upload no-stale Use this to prevent staling of issues that need info but shouldn't be closed for some reason performance: general/non-specific lag, ANR, etc and rarer exceptions/errors that don't have their own labels
Projects
None yet
Development

No branches or pull requests