Android: Uploads of multiple or subsequent files to Nextcloud incomplete

Created on 18 May 2018  Â·  11Comments  Â·  Source: nextcloud/android

Actual behaviour

I have observed this when trying to share especially multiple pictures from my gallery at once to my Nextcloud server. It just fails for some pictures without any warning or error. Some files are neither uploaded nor can be found in the upload queue of the Nextcloud app. While mostly the first or second file succeeds, subsequent items just do not trigger any action in the Nextcloud client anymore. The queue is also missing any trace of the missing pictures. Any subsequent try to upload to the same folder mostly fails in this condition, even if it is a single file only. I could not find out under which conditions this can be reproduced. Sometimes I see it happening for single but subsequent uploads.
My current workaround is to switch to the Nextcloud app and jump back and forth between some folders and then try again. Then at least I can upload the next files.

Expected behaviour

Anything that is shared by the share button to the Nextcloud app should be at least put into upload queue or uploaded immediately to the Nextcloud server.

Steps to reproduce

  1. Try to upload multiple selected files from eg. the gallery
  2. Check if all files have been uploaded on server
  3. Check upload queue if all files shared to the app have been registered for upload

Environment data

Android version:
8.1.0
Device model:
Pixel 2
Stock or customized system:
Stock
Nextcloud app version:
3.1.0
Nextcloud server version:
13.0.2

no errors in server log

bug stale

All 11 comments

I can confirm this. Whenever I select multiple images (more than ~20) only a subset gets uploaded.

Android version:
9
Device model:
Pixel 3
Stock or customized system:
Stock
Nextcloud app version:
3.4.1
Nextcloud server version:
14.0.5

no errors in server log

Update:

2019-01-20 18:14:05.180 22277-30342/? E/DatabaseUtils: Writing exception to parcel
    java.lang.SecurityException: Permission Denial: reading com.google.android.apps.photos.contentprovider.impl.MediaContentProvider uri content://com.google.android.apps.photos.contentprovider/-1/1/content%3A%2F%2Fmedia%2Fexternal%2Fimages%2Fmedia%2F17185/REQUIRE_ORIGINAL/NONE/342172376 from pid=22562, uid=10242 requires the provider be exported, or grantUriPermission()
        at android.content.ContentProvider.enforceReadPermissionInner(ContentProvider.java:634)
        at android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:503)
        at android.content.ContentProvider$Transport.enforceFilePermission(ContentProvider.java:494)
        at android.content.ContentProvider$Transport.openTypedAssetFile(ContentProvider.java:422)
        at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:302)
        at android.os.Binder.execTransact(Binder.java:731)
2019-01-20 18:14:05.181 22562-22562/com.nextcloud.client D/FileUploader: Total 1
2019-01-20 18:14:05.181 22562-22562/com.nextcloud.client D/FileUploader: /storage/emulated/0/Android/media/com.nextcloud.client/nextcloud/tmp/[email protected]/Test/IMG_20181224_175420.jpg -> /Test/IMG_20181224_175420.jpg
2019-01-20 18:14:05.181 22562-22562/com.nextcloud.client V/UploadsStorageManager: Inserting /storage/emulated/0/Android/media/com.nextcloud.client/nextcloud/tmp/[email protected]/Test/IMG_20181224_175420.jpg with status=UPLOAD_IN_PROGRESS
2019-01-20 18:14:05.182 22562-25696/com.nextcloud.client E/CopyAndUploadContentUrisTask: Not enough permissions to read source file content://com.google.android.apps.photos.contentprovider/-1/1/content%3A%2F%2Fmedia%2Fexternal%2Fimages%2Fmedia%2F17185/REQUIRE_ORIGINAL/NONE/342172376
    java.lang.SecurityException: Permission Denial: reading com.google.android.apps.photos.contentprovider.impl.MediaContentProvider uri content://com.google.android.apps.photos.contentprovider/-1/1/content%3A%2F%2Fmedia%2Fexternal%2Fimages%2Fmedia%2F17185/REQUIRE_ORIGINAL/NONE/342172376 from pid=22562, uid=10242 requires the provider be exported, or grantUriPermission()
        at android.os.Parcel.createException(Parcel.java:1950)
        at android.os.Parcel.readException(Parcel.java:1918)
        at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
        at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:146)
        at android.content.ContentProviderProxy.openTypedAssetFile(ContentProviderNative.java:698)
        at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1458)
        at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1295)
        at android.content.ContentResolver.openInputStream(ContentResolver.java:1015)
        at com.owncloud.android.ui.asynctasks.CopyAndUploadContentUrisTask.doInBackground(CopyAndUploadContentUrisTask.java:147)
        at com.owncloud.android.ui.asynctasks.CopyAndUploadContentUrisTask.doInBackground(CopyAndUploadContentUrisTask.java:47)
        at android.os.AsyncTask$2.call(AsyncTask.java:333)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)

Sounds to me like something described here: https://issues.liferay.com/browse/MOBILE-936

Does anyone with more insight into the code base have some idea on a fix?

But it is working if you pick only a few pictures?

In my experience it happens more often with multiple pictures like 3-5. Sometimes I am missing one or two, sometimes more than 50% of my pictures are not picked up. Even uploading a single picture then fails on subsequent attempts. No icon in the status bar indicating the transfer to Nextcloud. There is even no trace of the failed uploads in the app's uploads folder either.

Once that happens, the following workaround works for me:
Before pressing the _Upload_ button I jump to another folder and back to the desired destination folder, then I press Upload and the transfer succeeds.

Is this related to the app you share from?
Is this related to the data you share, e.g. storage location, cached image, etc.?

I have been using Google Photos mostly. The destination folder is on shared storage.
I also tested with the Pixel file manager pushing some PDF files from my download folder. One PDF didn't make it to Nextcloud. This time I was using my personal folder as destination. No way to get it uploaded. Switching to another folder worked eventually.

2019-01-22 10:45:27.561 15892-15991/com.nextcloud.client D/CopyAndUploadContentUrisTask: current uri: content://com.google.android.apps.photos.contentprovider/-1/1/content%3A%2F%2Fmedia%2Fexternal%2Fimages%2Fmedia%2F248/REQUIRE_ORIGINAL/NONE/1606994744
2019-01-22 10:45:27.605 15892-15991/com.nextcloud.client D/CopyAndUploadContentUrisTask: current uri: content://com.google.android.apps.photos.contentprovider/-1/1/content%3A%2F%2Fmedia%2Fexternal%2Fimages%2Fmedia%2F241/REQUIRE_ORIGINAL/NONE/705925445
2019-01-22 10:45:27.643 15892-15991/com.nextcloud.client D/CopyAndUploadContentUrisTask: current uri: content://com.google.android.apps.photos.contentprovider/-1/1/content%3A%2F%2Fmedia%2Fexternal%2Fimages%2Fmedia%2F249/REQUIRE_ORIGINAL/NONE/1083710861
2019-01-22 10:45:27.718 15892-15991/com.nextcloud.client D/CopyAndUploadContentUrisTask: current uri: content://com.google.android.apps.photos.contentprovider/-1/1/content%3A%2F%2Fmedia%2Fexternal%2Fimages%2Fmedia%2F240/REQUIRE_ORIGINAL/NONE/1358026469
2019-01-22 10:45:27.812 15892-15991/com.nextcloud.client D/CopyAndUploadContentUrisTask: current uri: content://com.google.android.apps.photos.contentprovider/-1/1/content%3A%2F%2Fmedia%2Fexternal%2Fimages%2Fmedia%2F246/REQUIRE_ORIGINAL/NONE/9561296
2019-01-22 10:45:28.037 15892-15991/com.nextcloud.client D/CopyAndUploadContentUrisTask: current uri: content://com.google.android.apps.photos.contentprovider/-1/1/content%3A%2F%2Fmedia%2Fexternal%2Fimages%2Fmedia%2F247/REQUIRE_ORIGINAL/NONE/1837433399
2019-01-22 10:45:28.159 15892-15991/com.nextcloud.client D/CopyAndUploadContentUrisTask: current uri: content://com.google.android.apps.photos.contentprovider/-1/1/content%3A%2F%2Fmedia%2Fexternal%2Fimages%2Fmedia%2F239/REQUIRE_ORIGINAL/NONE/701604855
2019-01-22 10:45:28.253 15892-15991/com.nextcloud.client D/CopyAndUploadContentUrisTask: current uri: content://com.google.android.apps.photos.contentprovider/-1/1/content%3A%2F%2Fmedia%2Fexternal%2Fimages%2Fmedia%2F244/REQUIRE_ORIGINAL/NONE/660728551
2019-01-22 10:45:28.361 15892-15991/com.nextcloud.client D/CopyAndUploadContentUrisTask: current uri: content://com.google.android.apps.photos.contentprovider/-1/1/content%3A%2F%2Fmedia%2Fexternal%2Fimages%2Fmedia%2F245/REQUIRE_ORIGINAL/NONE/356553828
2019-01-22 10:45:28.530 15892-15991/com.nextcloud.client D/CopyAndUploadContentUrisTask: current uri: content://com.google.android.apps.photos.contentprovider/-1/1/content%3A%2F%2Fmedia%2Fexternal%2Fimages%2Fmedia%2F234/REQUIRE_ORIGINAL/NONE/82499434

I tried to upload 12 images from google photos, the 10th is failing and thus the remaining are not uploaded.
However, the content uri looks exactly the same, so I do not understand why this is not readable.
For me this is a bug by google photos.
(I'll try to enhance it that at least the remaining images will be uploaded)

I'll try to enhance it that at least the remaining images will be uploaded

After implementing this, it still fails at 10th images, and all 3 remaining ones can also not be uploaded due to the same error.
Skipping the failing ones then would not help, we should try to find the real cause here…

I tried to upload 12 images from google photos, the 10th is failing and thus the remaining are not uploaded.
However, the content uri looks exactly the same, so I do not understand why this is not readable.
For me this is a bug by google photos.
(I'll try to enhance it that at least the remaining images will be uploaded)

As mentioned earlier, I had the same observation with Google File manager and PDFs. I couldn't spot anything special about the file that couldn't be uploaded. I tried to rename it before uploading and moved it around on my Pixel but yet no luck. It was also the 10th file but this could be coincidence.

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!

Could we reopen this: I'm having the same problem for a while now, and after googling found this bug report.

Actual behaviour

Google Photos, select 1 day with 43 pictures > share > Nextcloud > Actual Size (75MB) > Upload. I repeated this 7 times with varying results: 16, 19, 16, 23, 22, 19, 22 photos were uploaded. Not the first xx, but randomly skipping a few every now and then.
When viewing the upload queue just after uploading, there is the same amount of photos inside, so no failing uploads, the missing pictures never land in the queue.

Expected behaviour
same as above, all photos should be uploaded, or be seen in the upload queue.
Steps to reproduce

Try to upload multiple selected files from eg. the gallery
Check if all files have been uploaded on server
Check upload queue if all files shared to the app have been registered for upload

Environment data

Android version:
9.1.0 (EMUI)
Device model:
Huawei P20 Pro
Stock or customized system:
Huawei GUI (EMUI)
Nextcloud app version:
3.9.2
Nextcloud server version:
17.0.2.1
Google Photos version:
4.33.0

Nexcloud log:
no entry
Nginx error log:
for each uploaded picture:
2019/12/31 11:55:01 [warn] 89507#102629: *16735 a client request body is buffered to a temporary file /var/tmp/nginx/client_body_temp/0000000349, client: <<redacted:reverse-proxy local IP>>, server: <<redacted:mydomain.net>>, request: "PUT /nextcloud/remote.php/dav/uploads/dl/b0bd571693c552061f75624f6cb8187d/0000000000000000-0000000001734475 HTTP/1.0", host: "<<redacted:mydomain.net>>"

I have a Nokia 7.2 with the latest software installed, Android 10 with August patch. Nextcloud app 3.13.1, Nextcloud server v19 (Nginx, PHP 7.3).
And I'm experiencing this for a long time now on different phones everytime.

The only way i can do this is using the app file browser it self. But that is kinda bad since the images ar hardely viewable during the upload file selection.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

daywalk3r666 picture daywalk3r666  Â·  3Comments

ezaquarii picture ezaquarii  Â·  3Comments

eppfel picture eppfel  Â·  3Comments

tobiasKaminsky picture tobiasKaminsky  Â·  3Comments

Bugsbane picture Bugsbane  Â·  3Comments