Closed archont00 closed 3 years ago
GitMate.io thinks possibly related issues are https://github.com/nextcloud/android/issues/227 (Cannot upload anything from nextcloud app), https://github.com/nextcloud/android/issues/2292 (Nextcloud Androi app don't work ), https://github.com/nextcloud/android/issues/1806 (Nextcloud android app doesn't connect), https://github.com/nextcloud/android/issues/1085 (share with Nextcloud app - empty folder doesn't show the no empty message for create folder), and https://github.com/nextcloud/android/issues/1048 (Nextcloud android app does not move or delete original files).
Which gallery app do you use? And which image do you share, e.g. where is it stored?
Hi, It must have been some error introduced during updates of the Nextcloud app - I deleted cache & storage in Android app settings of Nextcloud and now it works. Let's consider this for a "closed" issue.
This is still happening for me
This is also happening to me, what makes it even worse is that some pictures make it and some not. This means that I can't trust this app to backup files. The upload dialog just disappears after a few images without transmitting the other pictures, but I get not error message.
I am using a stock Pixel 2 and Google Photos with Nextcloud Android 3.8.1 and Nextcloud Server NC16.
@tobiasKaminsky can you reopen the issue or should I create a new one?
reopened
It's still happening, it might be related to context switches. I feel like the process of uploading aborts earlier when switching to other apps or locking the screen. Uploading 45 images manages to upload around 8 each time, from which many are copies of already uploaded files and are postfixed with " (2)" or bigger. I will gladly assist in fixing this issue, as it seems to be difficult to reproduce.
It's fairly easy to reproduce for me, sharing any file to the nextcloud app to upload it simply does nothing at all, 100% of the time. It used to work at some point though, but maybe an Android version ago. I'm on a Note 9 running Android 9.
I can confirm that bug too. lineage 16,android 9, nextcloud 3.9.2
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!
It's not stale, it's not fixed.
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!
Still happening, still frustrated...
for me, changing storage folder from "storage/emulated/0/..." to "data/user/0/..." in nextcloud settings solved the problem. maybe worth trying?
for me, changing storage folder from "storage/emulated/0/..." to "data/user/0/..." in nextcloud settings solved the problem. maybe worth trying?
It works! (At least for now).
Wow, what a weird workaround. I already changed the path once, but to another /emulated/ one. I won't close the ticket, but it should be a big hint for the devs.
okay, it's still happening somehow. It seems to be better, but single file uploads still won't start sometimes.
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!
Still inconsistent uploads. I just tested out 3x 5+ pictures. First two batches uploaded fine, the last one "finished" with 4 pictures missing.
I often get "operation failed, server unavailable", could that be related? It might be that only a few of the picture uploads are restarted correctly. My host is hetzner, if that helps.
This issue is the reason why i no longer use nextcloud since this february. Nextcloud is a great software and i like the feeling of freedom and privacy. But, if I have to choose between data consistency and data privacy, then I choose data consistency.
Losing important photos and memories is something that must not happen. The worst thing is: The user may not notice the problem.
I was lucky that my smartphone has a trash bin and I even noticed the problem.
This bug report 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!
Can't really add anything anymore, feels like it's just getting ignored...
Sorry for coming back so late, but we have an insane amount of work to do.
So, I tried to share 10 files from files/document app to NC on my device and all got uploaded. Is there a reliable way to test your problem? For me it seems to be very device specific, given the amount of users we have and the few users experiencing this bug. This does not mean that I do not want to fix it, but it is hard to reproduce :/
Thank you for coming back to it and explaining the situation, I appreciate it.
I share your thought of it being device specific, I understand the problem of troubleshooting without being able to reproduce it. Sadly, I am able to reproduce it more or less regularly with the procedures described above. I tested it again right now, the first few batches with 6, 5, 8, 4 images went fine, the last one transmitted only 7 of 11 pictures. All images came from the same source, had similar sizes and directories.
I have a background in CS, can I assist you in any way with the "sometimes broken" installation I have? I am able to provide log files (if generated) or debug/read logcat with android studio (if possible).
You are testing this
Yes.
Stored in /storage/emulated/0/DCIM/Camera
, the default location of images on a Pixel.
I tested it again, only successful uploads are shown in the upload folder, so: 8 selected, 7 in uploads, 7 in folder.
@modischFabrications https://github.com/nextcloud/android/pull/5834 in this will be soon an APK file, which you can install in parallel next to your existing app.
Alright, I'm on it, give me a few minutes to get everything going and I will extend this post.
I caught a good one:
Seems like the files arrive successfully:
There are a lot of errors in the logs, but only for the files that actually made it to the server. Seems like the files are lost somewhere earlier than that. (Server URL is replaced with {NX-SERVER}.)
I can send you the full log for that occurrence if that helps.
Can I uninstall the test version now or is there anything else you need?
Sorry for coming back so late. Your log would be helpful, so that I can see why the app receives 11 images, but only processes 5…
Here ist the full log:
Thanks for the logs. So NC receives 11 images:
2020-04-09 16:16:48.590 25394-25394/com.nextcloud.android.qa D/ReceiveExternalFilesActivity: URI: IMG_20200225_180334.jpg
2020-04-09 16:16:48.611 25394-25394/com.nextcloud.android.qa D/ReceiveExternalFilesActivity: URI: IMG_20200224_213423_MP.jpg
2020-04-09 16:16:48.631 25394-25394/com.nextcloud.android.qa D/ReceiveExternalFilesActivity: URI: IMG_20200225_180247.jpg
2020-04-09 16:16:48.645 25394-25394/com.nextcloud.android.qa D/ReceiveExternalFilesActivity: URI: IMG_20200224_084711.jpg
2020-04-09 16:16:48.662 25394-25394/com.nextcloud.android.qa D/ReceiveExternalFilesActivity: URI: IMG_20200224_214208.jpg
2020-04-09 16:16:48.676 25394-25394/com.nextcloud.android.qa D/ReceiveExternalFilesActivity: URI: IMG_20200224_213349.jpg
2020-04-09 16:16:48.691 25394-25394/com.nextcloud.android.qa D/ReceiveExternalFilesActivity: URI: IMG_20200224_084731.jpg
2020-04-09 16:16:48.724 25394-25394/com.nextcloud.android.qa D/ReceiveExternalFilesActivity: URI: IMG_20200225_180339__exported_3059744077990077256.jpg
2020-04-09 16:16:48.745 25394-25394/com.nextcloud.android.qa D/ReceiveExternalFilesActivity: URI: IMG_20200224_213441.jpg
2020-04-09 16:16:48.763 25394-25394/com.nextcloud.android.qa D/ReceiveExternalFilesActivity: URI: IMG_20200224_084719.jpg
2020-04-09 16:16:48.781 25394-25394/com.nextcloud.android.qa D/ReceiveExternalFilesActivity: URI: IMG_20200224_085002.jpg
According to your screenshot only 5 made it. Interesting is that it is the top 5. Log then does not show anything after uploading the 5th one.
For me it seems like that something is killling/stopping the upload and thus only 5 items were uploaded successfully.
Can you test it again, but this time go directly to NC app and see the upload queue? Please also make sure that there is no screen off, e.g. by clicking on option menu from time to time.
Note for me: the other suspect would be that FilesSyncJob runs on the same time and thus kills the pending uploads.
I just tried it, this time 2/8 made it.
Can you test it again, but this time go directly to NC app and see the upload queue?
The upload queue shows only the successful uploads, the missing ones are not even displayed. I was able to get to the app shortly after the first picture was uploaded I believe.
Second try: 6/8 pictures made it, still only these 6 were shown in the upload queue.
Possibly related problem: This time the last picture took >30s to start uploading, I was able to get it started by clicking on the notification.
The screen was on the whole time, I was manually keeping a finger on the screen to prevent hibernation.
The upload queue shows only the successful uploads, the missing ones are not even displayed.
As the other app is sharing files only temporarily via content:// (and therefore resume is not possible) it is not shown in upload.
I added even more debug output. @ModischFabrications once a new APK is in #5834 can you give it another try? 💙
Possibly related problem: This time the last picture took >30s to start uploading, I was able to get it started by clicking on the notification.
Interesting. So it might that the file is shared not long enough and therefore it fails…?
Next test with https://github.com/nextcloud/android/pull/5834 .
6/8 made it, log file looks fruitful on first glance, references every picture.
I just appended the log this time, that's a lot easier than building a collapsable each time.
Upload was a lot better this time, worked without a hiccup.
We are getting closer…:tada:
2020-06-08 14:20:54.606 30153-30360/com.nextcloud.android.qa E/CopyAndUploadContentUrisTask: Not enough permissions to read source file content://com.google.android.apps.photos.contentprovider/2/1/content%3A%2F%2Fmedia%2Fexternal%2Fimages%2Fmedia%2F3643/REQUIRE_ORIGINAL/NONE/image%2Fjpeg/673405317
So this is one of 2 failing ones…
Doc says:
File security is preserved in this process because the content URI is the only piece of data that the client app receives. Since this URI doesn't contain a directory path, the client app can't discover and open any other files in the server app. Only the client app gets access to the file, and only for the permissions granted by the server app. The permissions are temporary, so once the client app's task stack is finished, the file is no longer accessible outside the server app. (https://developer.android.com/training/secure-file-sharing/request-file#OpenFile)
So it seems that once you close the sharing app, in this case Gallery app, it also removes the permission to read these files. @ModischFabrications can you do another try and keep the Gallery app open and running, also without any screen off?
Happy to hear that, wouldn't have expected this issue to be so complicated.
5/8 successful, gallery was open the whole time, didn't even check the notifications.
How long did the total upload took, until it failed?
Something around 1min, not long.
Any progress?
The permissions are temporary, so once the client app's task stack is finished, the file is no longer accessible outside the server app.
Hm. Seems I had the wrong idea last time. It is not about keeping the "server app" (gallery) open, but it purely relies on the "client app's task stack".
Upon sharing files to our app the "receive external activity" is created. This will then be stopped and the real upload happens in background. I know assume that this is the problem: Android thinks that "client app's task stack" is finished as soon as the activity is done.
Do you know how other apps are handling this? One "quick" solution would be to keep our activity open during entire upload process.
That sounds plausible, this also explains why the issue was so random. I guess different vendors have different delay to cleanup old activities.
Previous implementations of mine had no long-running background tasks, I fear that I can't really help you with it. I think there is a way to register long running tasks to not be terminated, but I can't tell you more than that, sorry. The quick fix seems good enough at first sight, but I haven't reviewed the code.
I will give this quick fix a try soon and ping you for testing :)
This comes up for me with the latest rc1/Rc2. Interesting that it exists before.
This comes up for me with the latest rc1/Rc2. Interesting that it exists before.
Same for me with beta and stable version of nextcloud app. It do nothing after selecting folder.
Also, when i try to upload files from another app to new folder the NC app creates new folder on server but does not put files to it.
And it works if i add files directly from NC app.
There are no error logs, seems that app just don't try to connect to server if i try to upload files from another app...
I have the same problem on Google Pixel 4a on Android 11. Sharing images from the Gallery app and also from other apps such as Cx File Explorer (file manager) does not work.
When pressing share and choose Nextcloud app, Nextcloud app opens up. I can select a folder and press "Upload" button. Nextcloud app quickly shows a dialog I cannot recognize so quick and closes while nothing more happens.
Help! The only "workaround" is to open up Nextcloud app and use the "+" button to choose files manually from the DCIM folder. However opening up the DCIM folder takes about 20 seconds and I already moved all files except those from 2020 to subfolders...
Help! api
Hello, i too have this problem. I'm developing my own documentscanner app and while testing the sharing i encountered this problem. I use a Xiaomi Redmi Note 9 Pro with MIUI 12.0.1 Android 10, the sharing with nextcloud only works from google drive. With the explorer, gallery, SwitScan (another docscanner from the Play Store) and my own app it doesn't work. The nextcloud app opens for a millisecond and you can see the message "copying file from private storage" then the app closes and nothing happend. Does anyone know what google drive dose differently?
Actual behaviour
Expected behaviour
Steps to reproduce
Environment data
Android version: 8.0.0
Device model: Samsung SGS S7
Stock or customized system: Stock, unbranded.
Nextcloud app version: 3.3.2
Nextcloud server version: 14.0.1
Logs
Nextcloud log (data/nextcloud.log)
There is no recent "nextcloud.log" in the android filesystem accessible to the user. (Only some old version from 2017.) There seems to be no option in app settings to enable debug logging.