android
android copied to clipboard
AutoUpload not working since 3.28.1
⚠️ Before posting ⚠️
- [X] This is a bug, not a question or an enhancement.
- [X] I've searched for similar issues and didn't find a duplicate.
- [X] I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
- [X] I agree to follow Nextcloud's Code of Conduct.
Steps to reproduce
- Setup autoupload on a folder under 3.27
- Upgrade to 3.28.2
Expected behaviour
Auto upload should continue to work, I've not had anything uploaded from my phone since upgrading to 3.28.2 (about 10 days now)
Actual behaviour
Autouploads don't occur, they don't queue or anything. There is nothing obvious to indicate that the app is attempting uploads.
Android version
14
Device brand and model
Xiaomi Poco F1
Stock or custom OS?
Custom (explain in "additional information")
Nextcloud android app version
3.28.2
Nextcloud server version
28.0.4
Using a reverse proxy?
No
Android logs
Logcat was started, a picture was taken, gallery was opened, nextcloud was then opened and the uploads page viewed, then logcat ended.
Server error logs
None that I could find
Additional information
Looking through the logcat; this stands out to me:
04-15 09:27:00.905 26428 26449 E WM-WorkerWrapper: Work [ id=55ad9385-afec-429c-bc71-608b8392f808, tags={ com.nextcloud.client.jobs.FilesSyncWork, *, name:periodic_files_sync, timestamp:1713129827653, class:FilesSyncWork } ] failed because it threw an exception/error
04-15 09:27:00.905 26428 26449 E WM-WorkerWrapper: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Attempt to get length of null array
04-15 09:27:00.905 26428 26449 E WM-WorkerWrapper: at androidx.work.impl.utils.futures.AbstractFuture.getDoneValue(AbstractFuture.java:516)
04-15 09:27:00.905 26428 26449 E WM-WorkerWrapper: at androidx.work.impl.utils.futures.AbstractFuture.get(AbstractFuture.java:475)
04-15 09:27:00.905 26428 26449 E WM-WorkerWrapper: at androidx.work.impl.WorkerWrapper$2.run(WorkerWrapper.java:317)
04-15 09:27:00.905 26428 26449 E WM-WorkerWrapper: at androidx.work.impl.utils.SerialExecutorImpl$Task.run(SerialExecutorImpl.java:96)
04-15 09:27:00.905 26428 26449 E WM-WorkerWrapper: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
04-15 09:27:00.905 26428 26449 E WM-WorkerWrapper: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
04-15 09:27:00.905 26428 26449 E WM-WorkerWrapper: at java.lang.Thread.run(Thread.java:1012)
04-15 09:27:00.905 26428 26449 E WM-WorkerWrapper: Caused by: java.lang.NullPointerException: Attempt to get length of null array
04-15 09:27:00.905 26428 26449 E WM-WorkerWrapper: at org.lukhnos.nnio.file.Files.walkFileTree(Files.java:342)
04-15 09:27:00.905 26428 26449 E WM-WorkerWrapper: at com.owncloud.android.utils.FilesSyncHelper.insertAllDBEntriesForSyncedFolder(FilesSyncHelper.java:97)
04-15 09:27:00.905 26428 26449 E WM-WorkerWrapper: at com.owncloud.android.utils.FilesSyncHelper.insertAllDBEntries(FilesSyncHelper.java:125)
04-15 09:27:00.905 26428 26449 E WM-WorkerWrapper: at com.nextcloud.client.jobs.FilesSyncWork.collectChangedFiles(FilesSyncWork.kt:174)
04-15 09:27:00.905 26428 26449 E WM-WorkerWrapper: at com.nextcloud.client.jobs.FilesSyncWork.doWork(FilesSyncWork.kt:130)
04-15 09:27:00.905 26428 26449 E WM-WorkerWrapper: at androidx.work.Worker$1.run(Worker.java:82)
04-15 09:27:00.905 26428 26449 E WM-WorkerWrapper: ... 3 more
04-15 09:27:00.905 26428 26449 I WM-WorkerWrapper: Worker result FAILURE for Work [ id=55ad9385-afec-429c-bc71-608b8392f808, tags={ com.nextcloud.client.jobs.FilesSyncWork, *, name:periodic_files_sync, timestamp:1713129827653, class:FilesSyncWork } ]
A very quick glance at the code and I think the problem is possibly here: https://github.com/nextcloud/android/blob/master/app/src/main/java/com/owncloud/android/utils/FilesSyncHelper.java#L101 I think that should maybe FileVisitResult.SKIP_SUBTREE
same problem here. nextcloud is sooo unreliable, auto upload not working, duplicate files, 0 byte files... switching to immich for media at least now
Hmm I can't reproduce here, could one of you check if this issue still exists with the new 3.29 RC1 and if yes check if it already existed in 3.28.0.
It's kind of odd, the error message points to a closing curly brace in the Files.java:342...
@mintsoft I don't think this will make a difference. According to docs it acts like CONTINUE if it is not returned in "preVisitDirectory"... Additionally, in my dev environment, this option does not exist. Not sure if the android app uses a different version of Files?
It's kind of odd, the error message points to a closing curly brace in the Files.java:342...
Only in master, if you look at the tagged version it points to Files.walkTreePath: https://github.com/nextcloud/android/blob/stable-3.28.2/app/src/main/java/com/owncloud/android/utils/FilesSyncHelper.java#L97 @JonasMayerDev
I don't think this will make a difference. According to docs it acts like CONTINUE if it is not returned in "preVisitDirectory"... Additionally, in my dev environment, this option does not exist. Not sure if the android app uses a different version of Files?
I think the code has changed since I made that suggestions, when I looked before I think it was return null; which is why I was thinking it's likely that's the problem. Now it doesn't look like it is
I've just tested under 3.28.0 and it seems to be working there, at least I have the "preparing auto upload" notification that's appeared.
Edit: confirmed it's working fine under 3.28.0
@mintsoft yes on master a lot has changed there. That's why it would be interesting if this issue exists on 3.29 RC1 too.
@mintsoft yes on master a lot has changed there. That's why it would be interesting if this issue exists on 3.29 RC1 too.
Yeah, it's not quite as straight forward for me to upgrade as downgrade as I've installed through F-Droid, so ideally I need an FDroid APK to upgrade to, but I'll see what I can do.
I've just upgraded from 3.28.0 -> 3.28.1 and it's stopped working again, so I can confirm that the problem is introduced between those versions at least.
Hmm, so I can't easily switch to the RC version; however I have installed "Nextcloud Dev" from FDroid (https://f-droid.org/en/packages/com.nextcloud.android.beta/) and the version 20240414 does seem to be working. I'm not sure how that relates to the RC version, but I guess it might indicate that it is already fixed in master?
Aha, RC1 has found its way to Fdroid now, I'll try that this evening and see if it has the same behaviour
Just upgraded to RC1 and it seems to still be broken under that, downgrading to 3.28.0 restored the functionality; although the autoupload settings between RC1 and 3.28 seem to reset so you have to reconfigure the folders
Just noticed 3.29 is out, it's fixed in that version so I'll close this issue now.
I find that Auto Upload on 3.29 is flakey -- works sometimes, but not most of the time. I have gone in on my Samsung Galxy S23 and re-saved the configuration options for the folders, to no effect.
@amessina if you can reproduce it, I'd see if you can adb logcat out to a file when its being weird and open another issue, I'll keep an eye out also for weird things
@amessina if you can reproduce it, I'd see if you can
adb logcatout to a file when its being weird and open another issue, I'll keep an eye out also for weird things
It's reproduceable, though I don't have a setup available to do that kind of debug logging (unless it can be activated from within the app)
@amessina then maybe describe how you are able to reproduce? Maybe we can reproduce and check if it still is this issue?
@JonasMayerDev I have uninstalled and reinstalled the Nextcloud app on my Samsung Galaxy S23, which enabled me to go throught the permissions notices again. I was then able to re-add my auto upload folders and things seem to work now.
I do get the warning about battery settings when updating an auto-update folder configuration, but I've confirmed I don't have this app restricted.
It is confusing to have options like "Cancel" and "Disable" -- disable the battery settings? The auto-upload for the folder?
I'll keep an eye and see if it comes up again.