android icon indicating copy to clipboard operation
android copied to clipboard

Google Photos -> Nextcloud: share does not upload multiple files

Open doits opened this issue 10 years ago • 34 comments

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

  1. Open Google Photos App
  2. Select 5+ pictures
  3. Click Share
  4. Select nextcloud beta app
  5. Chose a folder
  6. 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 avatar Nov 02 '16 21:11 doits

@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

AndyScherzinger avatar Nov 06 '16 22:11 AndyScherzinger

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.

doits avatar Nov 07 '16 14:11 doits

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 avatar Nov 07 '16 14:11 AndyScherzinger

@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

doits avatar Nov 07 '16 15:11 doits

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 avatar Nov 07 '16 15:11 doits

@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

AndyScherzinger avatar Nov 07 '16 15:11 AndyScherzinger

Here are all the permissions:

screenshot_20161107-163822 screenshot_20161107-163832 screenshot_20161107-163837

doits avatar Nov 07 '16 15:11 doits

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)

zbraniecki avatar Dec 18 '16 04:12 zbraniecki

Uploading the same photos from NextCloud app seems to work, so it's just the Photos->NextCloud upload that failed.

zbraniecki avatar Dec 18 '16 04:12 zbraniecki

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.

eleith avatar Jan 15 '17 19:01 eleith

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 avatar Jun 30 '17 12:06 tobiasKaminsky

@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.

OlivierS1 avatar Jun 30 '17 19:06 OlivierS1

@tobiasKaminsky I'm seeing this same issue even without the screen turning off.

Nexus 5 with Android 6..0.1 Nextcloud 1.4.3

redbarnnobrakes avatar Jul 30 '17 00:07 redbarnnobrakes

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

PakhomGolynga avatar Feb 21 '18 14:02 PakhomGolynga

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.

tobiasKaminsky avatar Feb 22 '18 08:02 tobiasKaminsky

I tried several other applications "gallery" and with some of them there are no problems with unloading. Thank you!

PakhomGolynga avatar Feb 22 '18 11:02 PakhomGolynga

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!

stale[bot] avatar May 10 '19 04:05 stale[bot]

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.

MatthiasLohr avatar Sep 27 '19 08:09 MatthiasLohr

None that I know of while I didn't experience this issue on my device. @tobiasKaminsky @ezaquarii can you reproduce this?

AndyScherzinger avatar Oct 02 '19 10:10 AndyScherzinger

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

MatthiasLohr avatar Oct 02 '19 11:10 MatthiasLohr