Google Photos -> Nextcloud: share does not upload multiple files
Actual behaviour
When I select multiple files to upload it only uploads some of them.
Expected behaviour
It should upload every file I want to upload.
Steps to reproduce
- Open Google Photos App
- Select 5+ pictures
- Click Share
- Select nextcloud beta app
- Chose a folder
- Click upload
Upload starts, but not all files are uploaded. Which ones and how many are uploaded seems to be random, but I only got it to upload 2 files at once in multiple tries. At "Uploads" in the app only those are visible that were really uploaded. The others are not displayed at all.
When I select one file after another to upload it uploads them all, even when they are queued because network connection is too slow.
Environment data
Android version: 7.0
Device model: Nexus 6P
Stock or customized system: Customized (Pure Nexus)
Nextcloud app version: beta-20161027, beta-20161102, beta-20161107
Nextcloud server version: 10.0.1
Logs
Nextcloud log (data/nextcloud.log)
Tried to upload 11 pictures with beta-20161107: https://gist.github.com/doits/537176b4aa4be5eaa8233105e71b0590
@doits just tried the beta on my phone (Nexus5X, 7.1.1) and I can do multi-uploads as described by you. What does the Uploads view of Nextcloud say? As for the log, there is still a bug in the beta, hope this is fixed with beta-20161105.
Other than that you should find the log on your phone Android\data\com.nextcloud.client\files\nextcloud\log
Here's the log I've taken while trying to upload multiple pictures to nextcloud, using beta-20161107.
It uploaded just one file, but in Photos I selected 11. The uploaded picture is neither the first or the last one of my selection, it is one in the middle.
The upload view only has the picture that was uploaded, others are missing.
Hmm, unfortunately the log "stops" before it would get interesting
2016/11/07 15:45:02
ReceiveExternalFilesActivity : Uploading file to dir /
2016/11/07 15:45:02
FileActivity : show loading dialog
What happens if you upload 1 or 2 files?
@AndyScherzinger I think the lines you quoted are from my next test; the file that got uploaded from Photos is "IMG_20161105_145121.jpg", and the start is here I think:
2016/11/07 15:43:39
ReceiveExternalFilesActivity : onCreate(Bundle) starting
Here's a try where I try to upload 2 files (now to the root directory), and it fails completely (does not upload at all):
https://gist.github.com/doits/27491e7caea9985983d2d537d9c08569
Only one of the two files is displayed as "Failed" in "Uploads" view, the other one is not displayed at all.
@doits can you check the app's permission in Androids (app) settings:
CopyAndUploadContentUrisTask : Not enough permissions to read source file content://com.google.android.apps.photos.contentprovider/-1/1/content%3A%2F%2Fmedia%2Fexternal%2Ffile%2F6118/REQUIRE_ORIGINAL/NONE/1619937482 Exception : [Ljava.lang.StackTraceElement;@a243d4c
Here are all the permissions:

I tried to upload (from Photos app, click "share") 154 photos today (manually, not auto-upload) and it uploaded ~10, then stopped. From that moment, when I try to upload any of those photos (even one) it doesn't react at all.
I tried restarting the phone, but that help.
(NextCloud Android 1.4.0, NextCloud 10 hosted on OwnCube)
Uploading the same photos from NextCloud app seems to work, so it's just the Photos->NextCloud upload that failed.
i can confirm that when it comes to multiple file uploads nextcloud -> photos upload always works and that photos -> nextcloud will stop after uploading just a handful. there are no UI errors given, it fails silently.
Strongly related to #1066 but also no idea what is wrong.
@all is your device idle and turns off screen? Maybe it is related to the new doze mode which kills active jobs silently if the device is idle?
@tobiasKaminsky I have noticed that when phone turns off, Google Photos will stop downloads in progress but will not terminate them. I had to keep pressing the screen to keep the phone alive so download would still be underway. Downloads would resume when display becomes active.
@tobiasKaminsky I'm seeing this same issue even without the screen turning off.
Nexus 5 with Android 6..0.1 Nextcloud 1.4.3
After update to MIUI Global 9.2 (from MIUI 8x) I'm seeing this same issue. App upload only 7-10 files and stopping upload process. Also I see in log file: "CopyAndUploadContentUrisTask : Not enough permissions to read source file content://com.miui.gallery.open/raw/" currentLog.txt
Android version: Android 6.0.1 Device model: Xiaomi redmi 4 pro Stock or customized system: MIUI Global 9.2 (stock) Nextcloud app version: 3.0.1 Nextcloud server version: 13
Passing files from one app to another is done via content uri. The sender app must give enough rights so that the receiver app can read it. From your log it seems that miui gallery passes a content uri to the receiver app, but does not grant the access to it. On Nextcloud there is nothing we can do here.
I tried several other applications "gallery" and with some of them there are no problems with unloading. Thank you!
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!
Is there any known solution for directly sharing photos from Google Photos for Nextcloud? I have the same problem and couldn't find a working solution for now.
None that I know of while I didn't experience this issue on my device. @tobiasKaminsky @ezaquarii can you reproduce this?
Just a guess: It happens when I try to upload multiple "effects" images from Google Photos. Using effects, sometimes Google Photos will give two files the same name (e.g. two files named EFFECTS.jpg). Google Photos and Google Drive support that, I assume that Nextcloud doesn't. So my guess it, that nextcloud stops working on the list of shared files when the first duplicate occurs.
Two, in my opinion, important changes that should be made:
- Don't drop files silently, at least display a short info text
- Don't stop the loop completely, only skip the problematic file