Android: Auto upload on 1.4.2 and Android 7.1.2 still broken

Created on 14 Apr 2017  Â·  32Comments  Â·  Source: nextcloud/android

Actual behaviour

-Tell us what happens
Auto upload doesn't work-
If an image or video is added to a watched folder while not connected to wifi, it will never upload when reconnected.
If the upload fails due to a connection issue, it will never retry.
Photos taken with the camera don't even show up in the uploads list.
The app drains my battery

Expected behaviour

-Tell us what should happen
Auto upload should work-
If the connection fails, it should retry at a later time
If its waiting for wifi, it should at some point in the future check for a wifi connection rather than waiting indefinitely
All photos taken with the camera should show up in the uploads list (interestingly, thumbnails show on the "Auto upload" page)

Steps to reproduce

  1. Take a photo or video while not connected to wifi
  2. Some photos are never detected for upload, it almost seems random which ones.
  3. Sometimes app will cause rapid battery drain
    -or-
  4. Take a photo or video while on wifi, turn wifi off mid transfer to simulate a connection error
  5. Upload never retries.
  6. Sometimes app will cause rapid battery drain

Environment data

Android version: 7.1.2

Device model: Nexus 5x

Stock or customized system: Stock

Nextcloud app version: 1.4.2

Nextcloud server version: Owncloud 9.1.4 RC2 (cannot migrate to NextCloud due to outstanding issues with the NC server)

Logs

Web server error log

Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Insert your Nextcloud log here

I understand the devs are working hard on this app, and its free, however, its been incredibly frustrating. I'm not an Android developer, but I'll do what I can try to troubleshoot this issue. I'd really like for it to work reliably.

bug AutoUpload stale

Most helpful comment

I also have a Nexus 5x with Android 7.1.2 and the AutoUpload doesn't work correct.

Looks like the same behavior as described: Recorded fotos or videos are only randomly put to the upload-queue

All 32 comments

Hi,

would you be available for a TeamViewer session? I'd need Android studio with all SDKs, TeamViewer, and Vysor (and your phone connected to the computer).

Cheers.

I can try. My times available are pretty limited, but I could do late evening (~21:00-22:00 EDT), maybe earlier if on a Saturday or Sunday.

I also have a Nexus 5x with Android 7.1.2 and the AutoUpload doesn't work correct.

Looks like the same behavior as described: Recorded fotos or videos are only randomly put to the upload-queue

I'm on a OnePlus X with Cyanogenmod 14 and I'm facing the same issues.

Also broken here on

Samsung i9305
LineageOS 14.1 20170503
microG stack

but working on

Samsung GT-I8160
Custom Android 4.4.4
microG stack

both phones running client v1.4.1 from F-Droid.

Let me know if I can be of any help, @mario

I'll add a +1 here - my trusty old Samsung Galaxy S2 (i9100) was uploading newly-taken photos justfine on CyanogenMod 13 (Android 6) but after upgrading to LineageOS 14 (Android 7) last night, auto-upload seems to do nothing.

There's no entries in the "Uploads" page at all, not even failed ones. I can see it's detecting new photos (the photo preview in the auto-upload configuration page goes from +89 to +90) but nothing else happens.

EDIT: tried the NC-dev app from F-Droid (20170430), same results.

Another one:

OnePlus 3
OxigenOS 4.1.1 (Android 7.1.1), stock
GAPPS
Nextcloud client, stable from Play Store

Stopped auto-uploading around 1-2 months ago, but the owner didn't notice.

Can also confirm it's not working on:
Samsung S4 (I9505 / jfltexx) and Lineage 14.1 (Android 7.1.2)

Confirm the issue with Galaxy S7 Edge with Android 7.0. Battery drain and only part of the newly taken photos are uploaded. No old photos are ever uploaded.

Same issue for me, One plus 3.

@mario can set up a teamviewer session with you this week if you are available. CEST timezone.

@propyless appreciate the offer. We're working on a redesigned auto upload, so can I catch you about this offer in a few weeks if it's not an issue? We should be the same timezone :)

@mario sure thats no problem. Just remember to ping me :).
Also the issue is not just for auto uploading of files. It fails to upload files selected manually as well..

That is a whole other issue...

Nc12? Got logs?
On Sun, 4 Jun 2017 at 17:18, Takeshi notifications@github.com wrote:

@mario https://github.com/mario sure thats no problem. Just remember to
ping me :).
Also the issue is not just for auto uploading of files. It fails to upload
files selected manually as well..

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/nextcloud/android/issues/833#issuecomment-306046470,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAWsl0Mq5dbG0LBYrCPH0vxpU9Rot4Yks5sAsq-gaJpZM4M9Tuh
.

@mario https://github.com/nextcloud/android/issues/287#issuecomment-306043457
last comment, error logs from nginx

Same issue on Galaxy S6 Edge with Android 7.

Dear users,

thank you for your patience. After lots of work, we’re super excited to be able to give you a test version with new auto upload implementation. Keep in mind we will only accept bugs related to Auto Upload in this APK, as other things might be broken.

https://cloud.nextcloud.com/s/ftZraTruRQjTe0R

This is a dev APK so it will not overwrite your existing play store/f-droid APK unless you’re already running dev version. Also, you might need to remove your existing dev version before installing this one.

Explanation of the current functionality:

  • added support for custom folders
  • separated image and video folders
  • checks for new files happens every 15-20 minutes
  • automatic retry every 15-20 minutes or when you force close/open the app
  • automatic pause once network is changed (untested!)
  • significantly less battery usage

All and any testing is more than appreciated, especially with large and ever-going files like Videos. (like, try to record a 30 min video).

Let me know if you’ve got any questions.

Cheers,
Mario

Tried it and it worked with some files (cannot say if reliable or not yet), but now on opening auto upload it gives me an NPE:

07-29 16:24:58.850 16910 16910 D AndroidRuntime: Shutting down VM
07-29 16:24:58.851 16910 16910 E AndroidRuntime: FATAL EXCEPTION: main
07-29 16:24:58.851 16910 16910 E AndroidRuntime: Process: com.nextcloud.client, PID: 16910
07-29 16:24:58.851 16910 16910 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nextcloud.client/com.owncloud.android.ui.activity.SyncedFoldersActivity}: java.lang.NullPointerException: Attempt to get length of null array
07-29 16:24:58.851 16910 16910 E AndroidRuntime:        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2684)
07-29 16:24:58.851 16910 16910 E AndroidRuntime:        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2751)
07-29 16:24:58.851 16910 16910 E AndroidRuntime:        at android.app.ActivityThread.-wrap12(ActivityThread.java)
07-29 16:24:58.851 16910 16910 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1496)
07-29 16:24:58.851 16910 16910 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:102)
07-29 16:24:58.851 16910 16910 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:154)
07-29 16:24:58.851 16910 16910 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:6186)
07-29 16:24:58.851 16910 16910 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
07-29 16:24:58.851 16910 16910 E AndroidRuntime:        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
07-29 16:24:58.851 16910 16910 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
07-29 16:24:58.851 16910 16910 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to get length of null array
07-29 16:24:58.851 16910 16910 E AndroidRuntime:        at java.util.Arrays.sort(Arrays.java:1450)
07-29 16:24:58.851 16910 16910 E AndroidRuntime:        at com.owncloud.android.ui.activity.SyncedFoldersActivity.getFileList(SyncedFoldersActivity.java:362)
07-29 16:24:58.851 16910 16910 E AndroidRuntime:        at com.owncloud.android.ui.activity.SyncedFoldersActivity.createSyncedFolderWithoutMediaFolder(SyncedFoldersActivity.java:287)
07-29 16:24:58.851 16910 16910 E AndroidRuntime:        at com.owncloud.android.ui.activity.SyncedFoldersActivity.mergeFolderData(SyncedFoldersActivity.java:236)
07-29 16:24:58.851 16910 16910 E AndroidRuntime:        at com.owncloud.android.ui.activity.SyncedFoldersActivity.load(SyncedFoldersActivity.java:200)
07-29 16:24:58.851 16910 16910 E AndroidRuntime:        at com.owncloud.android.ui.activity.SyncedFoldersActivity.setupContent(SyncedFoldersActivity.java:173)
07-29 16:24:58.851 16910 16910 E AndroidRuntime:        at com.owncloud.android.ui.activity.SyncedFoldersActivity.onCreate(SyncedFoldersActivity.java:126)
07-29 16:24:58.851 16910 16910 E AndroidRuntime:        at android.app.Activity.performCreate(Activity.java:6684)
07-29 16:24:58.851 16910 16910 E AndroidRuntime:        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
07-29 16:24:58.851 16910 16910 E AndroidRuntime:        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2637)
07-29 16:24:58.851 16910 16910 E AndroidRuntime:        ... 9 more
07-29 16:24:58.852  4231  6413 W ActivityManager:   Force finishing activity com.nextcloud.client/com.owncloud.android.ui.activity.SyncedFoldersActivity
07-29 16:24:58.855  4231  6413 W ActivityManager:   Force finishing activity com.nextcloud.client/com.owncloud.android.ui.activity.FileDisplayActivity

Doesn't seem related to Auto Upload changes but afaik this should be fixed in master, right @tobiasKaminsky ?

getFileList(SyncedFoldersActivity.java:362)

only exists in https://github.com/nextcloud/android/pull/797 so this can only be fixed there.
Seems as if files array is null

@mario is there some new version I can install on top of https://cloud.nextcloud.com/s/ftZraTruRQjTe0R? Or is this still the latest one for the new upload?

@doits https://cloud.nextcloud.com/s/pAbCOxR71TEhGgR - try this one :)

@mario thanks, but it says it conflicts with an existing package with the same name? Guess I cannot install it on top of your previous build?

@doits strange. Do try to uninstall it, but it shouldn't be like this o.O

Client requested permission to access storage, which was granted. It lists dirs correctly, but seems unable to generate thumbnails from local files. Files are queued for upload but it fails

08-01 10:08:21.346 13626 13626 V ConnectivityActionReceiver: component: ComponentInfo{com.nextcloud.client/com.owncloud.android.files.services.ConnectivityActionReceiver}
08-01 10:08:21.346 13626 13626 V ConnectivityActionReceiver: no extras
08-01 10:08:21.351 13082 13082 D FileUploader: Starting command with id 2
08-01 10:08:21.357  2988  3031 V ActivityManager: Attempted to start a foreground service (ComponentInfo{com.nextcloud.android.beta/com.owncloud.android.files.services.FileUploader}) with a broken notification (no icon: Notification(pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x40 color=0x00000000 vis=PRIVATE))
08-01 10:08:21.366 13082 13082 V UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/IMG_20170801_100734.jpg with status=UPLOAD_IN_PROGRESS
08-01 10:08:21.404 13082 13082 D UploadsStorageManager: updateUpload returns with: 1 for file: /storage/emulated/0/DCIM/Camera/IMG_20170801_100734.jpg
08-01 10:08:21.406 13082 13082 D UploadsStorageManager: notifyObserversNow
08-01 10:08:21.410 13082 13082 D ExpandableUploadListAdapter: refreshView
08-01 10:08:21.412 13082 13082 D ExpandableUploadListAdapter: loadUploadItemsFromDb
08-01 10:08:21.427 13082 13831 V UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/IMG_20170801_100734.jpg with status:UPLOAD_IN_PROGRESS and result:UNKNOWN (old:/storage/emulated/0/DCIM/Camera/IMG_20170801_100734.jpg status:UPLOAD_IN_PROGRESS result:-1)
08-01 10:08:21.435 13082 13831 V UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/IMG_20170801_100734.jpg with status=UPLOAD_IN_PROGRESS
08-01 10:08:21.461 13082 13831 D UploadsStorageManager: updateUpload returns with: 1 for file: /storage/emulated/0/DCIM/Camera/IMG_20170801_100734.jpg
08-01 10:08:21.463 13082 13831 D UploadsStorageManager: notifyObserversNow
08-01 10:08:21.492 13082 13082 V ExpandableUploadListAdapter: Executing task to generate a new thumbnail
08-01 10:08:21.500 13082 13871 E BitmapFactory: Unable to decode stream: java.io.FileNotFoundException: /storage/emulated/0/DCIM/Camera/IMG_20170801_100734.jpg (Permission denied)
08-01 10:08:21.501 13082 13082 D ExpandableUploadListAdapter: refreshView
08-01 10:08:21.501 13082 13871 E BitmapFactory: Unable to decode stream: java.io.FileNotFoundException: /storage/emulated/0/DCIM/Camera/IMG_20170801_100734.jpg (Permission denied)
08-01 10:08:21.503 13082 13082 D ExpandableUploadListAdapter: loadUploadItemsFromDb
08-01 10:08:21.504 13082 13831 D OwnCloudClient #7: REQUEST HEAD /remote.php/webdav/InstantUpload/Camera/
08-01 10:08:21.558 13082 13082 V ExpandableUploadListAdapter: Executing task to generate a new thumbnail
08-01 10:08:21.564 13082 13873 E BitmapFactory: Unable to decode stream: java.io.FileNotFoundException: /storage/emulated/0/DCIM/Camera/IMG_20170801_100734.jpg (Permission denied)
08-01 10:08:21.565 13082 13873 E BitmapFactory: Unable to decode stream: java.io.FileNotFoundException: /storage/emulated/0/DCIM/Camera/IMG_20170801_100734.jpg (Permission denied)
08-01 10:08:21.798 13082 13831 D ExistenceCheckRemoteOperation: Existence check for https://my.nextcloud.url/remote.php/webdav/InstantUpload/Camera/ targeting for  existence finished with HTTP status 200
08-01 10:08:21.851 13082 13831 D UploadFileOperation: Checking name collision in server
08-01 10:08:21.859 13082 13831 D UploadFileOperation: Copying local file
08-01 10:08:21.862 13082 13831 D UploadFileOperation: Creating temporal folder
08-01 10:08:21.873 13082 13831 E UploadFileOperation: Upload of /storage/emulated/0/DCIM/Camera/IMG_20170801_100734.jpg to /InstantUpload/Camera/IMG_20170801_100734.jpg: Unrecovered transport exception
08-01 10:08:21.873 13082 13831 E UploadFileOperation: java.io.IOException: Unexpected error: parent directory could not be created
08-01 10:08:21.873 13082 13831 E UploadFileOperation:   at com.owncloud.android.operations.UploadFileOperation.copy(UploadFileOperation.java:736)
08-01 10:08:21.873 13082 13831 E UploadFileOperation:   at com.owncloud.android.operations.UploadFileOperation.run(UploadFileOperation.java:429)
08-01 10:08:21.873 13082 13831 E UploadFileOperation:   at com.owncloud.android.lib.common.operations.RemoteOperation.execute(RemoteOperation.java:136)
08-01 10:08:21.873 13082 13831 E UploadFileOperation:   at com.owncloud.android.operations.common.SyncOperation.execute(SyncOperation.java:93)
08-01 10:08:21.873 13082 13831 E UploadFileOperation:   at com.owncloud.android.files.services.FileUploader.uploadFile(FileUploader.java:1047)
08-01 10:08:21.873 13082 13831 E UploadFileOperation:   at com.owncloud.android.files.services.FileUploader$ServiceHandler.handleMessage(FileUploader.java:990)
08-01 10:08:21.873 13082 13831 E UploadFileOperation:   at android.os.Handler.dispatchMessage(Handler.java:102)
08-01 10:08:21.873 13082 13831 E UploadFileOperation:   at android.os.Looper.loop(Looper.java:154)
08-01 10:08:21.873 13082 13831 E UploadFileOperation:   at android.os.HandlerThread.run(HandlerThread.java:61)
08-01 10:08:21.876 13082 13831 D UploadsStorageManager: updateDataseUploadResult uploadResult: com.owncloud.android.lib.common.operations.RemoteOperationResult@84d50e1 upload: com.owncloud.android.operations.UploadFileOperation@6962e06
08-01 10:08:21.882 13082 13831 V UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/IMG_20170801_100734.jpg with status:UPLOAD_FAILED and result:UNKNOWN (old:/storage/emulated/0/DCIM/Camera/IMG_20170801_100734.jpg status:UPLOAD_IN_PROGRESS result:-1)
08-01 10:08:21.884 13082 13831 V UploadsStorageManager: Updating /storage/emulated/0/DCIM/Camera/IMG_20170801_100734.jpg with status=UPLOAD_FAILED
08-01 10:08:21.904 13082 13831 D UploadsStorageManager: updateUpload returns with: 1 for file: /storage/emulated/0/DCIM/Camera/IMG_20170801_100734.jpg
08-01 10:08:21.906 13082 13831 D UploadsStorageManager: notifyObserversNow
08-01 10:08:21.909 13082 13831 D FileUploader: NotifyUploadResult with resultCode: UNKNOWN_ERROR
08-01 10:08:21.920 13082 13082 D ExpandableUploadListAdapter: refreshView
08-01 10:08:21.922 13082 13082 D ExpandableUploadListAdapter: loadUploadItemsFromDb
08-01 10:08:21.945 13082 13831 D FileUploader: Stopping command after id 2
08-01 10:08:21.962 13082 13870 E BitmapFactory: Unable to decode stream: java.io.FileNotFoundException: /storage/emulated/0/DCIM/Camera/IMG_20170801_100734.jpg (Permission denied)
08-01 10:08:21.962 13082 13870 E BitmapFactory: Unable to decode stream: java.io.FileNotFoundException: /storage/emulated/0/DCIM/Camera/IMG_20170801_100734.jpg (Permission denied)
08-01 10:08:21.995 13082 13082 V ExpandableUploadListAdapter: Executing task to generate a new thumbnail
08-01 10:08:22.003 13082 13871 E BitmapFactory: Unable to decode stream: java.io.FileNotFoundException: /storage/emulated/0/DCIM/Camera/IMG_20170801_100734.jpg (Permission denied)
08-01 10:08:22.005 13082 13871 E BitmapFactory: Unable to decode stream: java.io.FileNotFoundException: /storage/emulated/0/DCIM/Camera/IMG_20170801_100734.jpg (Permission denied)

When I went to the autoupload config, "Camera" was not in the list, because my DCIM/Camera dir had no pictures in it. Since that's the default location for photos, I'd expect it to be in the autoupload config list even if it's empty, just to activate it.

When I activate a dir for autoupload, I'd expect existing files to be synced too.

My setup is rather unconventional (https://github.com/nextcloud/android/issues/833#issuecomment-300624030), let me know if you need more details.

I guess there 1.4.3 is still got the problem here
I use the docker-compose from nextcloud/docker/docker-compose and own my DNS.

when I in the app and check domain name logs below:

web_1 | 172.19.0.7 - - [13/Sep/2017:08:35:19 +0000] "GET /status.php HTTP/1.1" 200 157 "-" "Mozilla/5.0 (Android) ownCloud-android/1.4.3"
web_1 | 172.19.0.7 - - [13/Sep/2017:08:35:19 +0000] "HEAD /remote.php/webdav/ HTTP/1.1" 401 0 "-" "Mozilla/5.0 (Android) ownCloud-android/1.4.3"

but trying to login

proxy_1 | nginx.1 | my.domain.name domain.name.ip - myname [13/Sep/2017:09:51:39 +0000] "HEAD /remote.php/webdav/ HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Android) ownCloud-android/1.4.3"
web_1 | this.is.my.ip - myname [13/Sep/2017:09:51:39 +0000] "HEAD /remote.php/webdav/ HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Android) ownCloud-android/1.4.3"

Please test everything with 2.0.0 beta. Thanks!

Sorry, new to this, how would I go about getting the beta to test?

@Socs28 Open the app in the Google Play store, check the app description and select that you want to join the beta team.

This request 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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Shagequi picture Shagequi  Â·  3Comments

tobiasKaminsky picture tobiasKaminsky  Â·  3Comments

JSoko picture JSoko  Â·  3Comments

Tie-fighter picture Tie-fighter  Â·  3Comments

ikke-t picture ikke-t  Â·  3Comments