android icon indicating copy to clipboard operation
android copied to clipboard

`Unrecovered transport exception` when trying to download/sync files without having proper permissions for local storage folder

Open R0Wi opened this issue 3 years ago • 2 comments

Steps to reproduce

  1. Install and configure App (local storage folder in "settings" is set to /storage/emulated/0, currently i don't know why? I would expect some other default location where we have write permissions.)
  2. Set Android storage permissions to WRITE_EXTERNAL_STORAGE (media only, see also here)
  3. Try to download a file or sync a folder

Expected behaviour

  • App should recognize that it cannot write to the local storage which was configured via "settings" view
  • An appropriate dialog should be presented to the user which tells him/her to either evaluate Android permissions or to choose another storage location where the app is able to write files to

Actual behaviour

  • Notification "File cannot be downloaded" is presented to the user (without a specific error message)
  • Log shows an "Unrecovered transport exception"

Workaround

  • Configure app local storage folder in "settings" to be a storage where app can write to (/storage/emulated/0/Android/media/com.nextcloud.client, for example) OR
  • Give app elevated storage permissions permissions MANAGE_EXTERNAL_STORAGE

Environment data

Android version: 12.0

Device model: Poco F4

Stock or customized system: MIUI 13

Nextcloud app version: 3.21.0 RC1

Nextcloud server version: 24.0.0.12

Reverse proxy: No

Logs

App logs

E;DownloadFileRemoteOperation;Download of /homeserver/[...]/20181130_175928.jpg to /storage/emulated/0/nextcloud/tmp/<USER>@<SERVER>/homeserver/[...]/20181130_175928.jpg: Unrecovered transport exception
I;DownloadFileOperation;Download of /homeserver/[...]/20181130_175928.jpg to /storage/emulated/0/nextcloud/tmp/<USER>@<SERVER>/homeserver/[...]/20181130_175928.jpg: Unrecovered transport exception

Nextcloud log (data/nextcloud.log)

<no relevant entries>

Contribution

I'm not an Android DEV but if you tell me the desired way to go i can try to create a PR for this if you're interested.

R0Wi avatar Jul 18 '22 13:07 R0Wi

The "real bug" here is that /storage/emulated/0 without is not a valid storage location for the app and should not be shown as such, not sure how that even happened.

AlvaroBrey avatar Jul 19 '22 09:07 AlvaroBrey

Totally agree and i also don't know how that happened since i just installed the app and did not change anything inside the settings so far. If i tab on the storage location settings i have only 3 "valid" options to choose so if i choose one of them i'm not able to configure that invalid path again.

But since it took me hours to figure out what's going on i thought an improved errorhandling in that case would have made things more easy 😎

R0Wi avatar Jul 19 '22 09:07 R0Wi