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

Created on 2 Nov 2016  路  34Comments  路  Source: nextcloud/android

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

bug needs infdiscussion stale

Most helpful comment

Let's have a chat to confirm if we want to close it for good.

All 34 comments

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

screenshot_20161107-163822
screenshot_20161107-163832
screenshot_20161107-163837

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

How do you create them within the Google Photos app? I just had collages and animations and they work fine for me.

I can't create them intentionally. I just bought a new handy, took some photos. The Google Photos assistant applied effects on some of my photos. Result: 3x EFFECTS.jpg, but also some other files $ORIGINAL_FILE_NAME-EFFECTS.jpg (where $ORIGINAL_FILE_NAME was the timestamp of taking the photos, this is how photos usually are named). So, no idea how to reproduce this intentionally.

What you can do: Create files with the same name on Google Drive (easiest way: Download 3 different files, e.g. a.txt, b.txt, c.txt, and rename one to the name of another (e.g. c.txt -> b.txt). Now you have a.txt, b.txt, b.txt.
Open Google Drive and share these 3 files to Nextcloud. Nextcloud will silently skip on of the b.txt files. In Nextcloud Upload status, you also see only 2 uploaded files.

This approach is uploading all non-duplicate files. I couldn't reproduce the behaviour of sharing from Google Photos yet, where even non-duplicates are skipped.

@MatthiasLohr @AndyScherzinger From description (I don't use Google services) it looks like Google is having different file system concept then rest of the planet and / or they have separated file name from displayable name.

@MatthiasLohr can you download those files on your computer? What happens then?

Let's have a chat to confirm if we want to close it for good.

I couldn't reproduce this yet :/

@ezaquarii, do you mean downloading from Google Drive? Here filenames are changed in the resulting ZIP archive: 003-Testfile.txt, 003-Testfile(1).txt, 003-Testfile(2).txt... In Google Drive they are still displayed with the same name:
image

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!

@AndyScherzinger, any progress?

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!

@AndyScherzinger, any progress?

@MatthiasLohr none yet since I can't reproduce this issue (yet)

Strange. Really strange.

Since we're living somehow close... maybe we'll get it managed to meet personally and you can use my device for testing. Maybe that way we get closer to the cause of that...

Since we're living somehow close... maybe we'll get it managed to meet personally

That is rather tricky these days since I am mostly blocked by private live. I did test https://github.com/nextcloud/android/issues/369#issuecomment-537457910 a while a go (at least I think). Is there any other way to test this, like what I can see in the screenshot?

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

tobiasKaminsky picture tobiasKaminsky  路  3Comments

Tie-fighter picture Tie-fighter  路  3Comments

AndyScherzinger picture AndyScherzinger  路  3Comments

Bugsbane picture Bugsbane  路  3Comments

JSoko picture JSoko  路  3Comments