Bug 340152

Summary: Folder "does not exist" error when browsing external SD card folder over SFTP
Product: [Applications] kdeconnect Reporter: zellox <zellox>
Component: commonAssignee: Albert Vaca Cintora <albertvaka>
Status: RESOLVED FIXED    
Severity: normal CC: arthur, kde.bugzilla.2012, tsebrenko
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description zellox 2014-10-20 11:26:12 UTC
When I click the "SD Card" folder for the SFTP thing, instead of getting access to my external SD card, I get an dolphin error that states:

"The file or folder /home/foo/.kde4/share/apps/kdeconnect/*device_id*/mnt/media_rw/sdcard1 does not exist."

Reproducible: Always

Steps to Reproduce:
1. Open dolphin
2. Click on the android device
3. Open "SD card" folder

Actual Results:  
Dolphin error: "The file or folder /home/foo/.kde4/share/apps/kdeconnect/*device_id*/mnt/media_rw/sdcard1 does not exist."

Expected Results:  
Show my external SD card contents.

My sdcard is mounted at /storage/sdcard1 and /mnt/media_rw/sdcard1 on my android device:
/dev/block/vold/179:33 /mnt/media_rw/sdcard1 vfat
/dev/fuse /storage/sdcard1 fuse 

KDE Connect version 0.7.3
KDE Connect (Android) version: latest as of 2014/10/20
Android: 4.4.4 with Cyanogenmod
Comment 1 Albert Vaca Cintora 2014-10-20 20:54:29 UTC
So it looks like /mnt/media_rw/sdcard1 is not accessible, and we should use /storage/sdcard1 instead? Can you somehow execute "mount" in your android phone and paste the output?
Comment 2 zellox 2014-10-20 21:03:39 UTC
Yeah I get a "permission denied" error when browsing /mnt/media_rw on my phone (unless I use root).

Here's the relevant mount output:
$ mount | grep sdcard                                                                                           
/dev/block/vold/179:33 /mnt/media_rw/sdcard1 vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/fuse /storage/sdcard1 fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
Comment 3 Albert Vaca Cintora 2014-10-20 21:49:19 UTC
You mean that being root on the desktop fixes the problem? Then it means that the permission problems is not on the Android filesystem but on the desktop!

Do you have write permission with your regular user if you access  /home/*your_user*/.kde4/share/apps/kdeconnect/*device_id*/mnt/media_rw instead after mounting the remote filesystem?
Comment 4 zellox 2014-10-21 01:51:22 UTC
No, I was talking about in the context of accessing the folder from/on the phone. 
It doesn't work if I use a terminal emulator, but if I use Root Explorer (file explorer using root), I can access that folder (/mnt/media_rw) fine.
Comment 5 Albert Vaca Cintora 2014-10-21 04:29:40 UTC
Can you try the other thing I said? Manually accessing the other path from your computer?
Comment 6 zellox 2014-10-21 04:44:23 UTC
I wasn't able to try before since the filesystem plugin bugged out on my phone after I put my desktop to sleep.

Anyway after fixing that, I tried the other path "/home/user/.kde4/share/apps/kdeconnect/device_id/storage/sdcard1/" and it worked! I can actually browse the whole filesystem if I leave the path empty, which is pretty handy
Comment 7 Albert Vaca Cintora 2014-10-21 06:52:40 UTC
Yes, that's something new in the last version, so advanced users can actually access the entire phone filesystem.

About the bug...  can you tell me the name of the directories you see when you access your phone in Dolphin using KDE Connect?
Comment 8 zellox 2014-10-21 07:28:58 UTC
When I click the phone in dolphin, I can see three folders:

SD Card => "/home/user/.kde4/share/apps/kdeconnect/device_id/mnt/media_rw/sdcard1/" (no permissions)

Internal Storage => "/home/user/.kde4/share/apps/kdeconnect/device_id/storage/emulated/0/"

Camera Pictures => "/home/user/.kde4/share/apps/kdeconnect/device_id/storage/emulated/0/DCIM/Camera/"
Comment 9 Albert Vaca Cintora 2014-11-23 01:08:51 UTC
I just published a new version to the Play store where this issue should be fixed. Since I have no way to test it, I would like if you could try it and say if it fixed the problem. Note that the update may take some time to be available to everybody.
Comment 10 zellox 2014-11-23 06:32:23 UTC
Fixes the issue for me - thanks :)
Comment 11 alpir 2015-01-10 12:29:58 UTC
Hi, i have the same problem, like discribed above.
Error message in Dolphin: File or folder /home/user/.kde4/share/apps/kdeconnect/970d22206710d2c9/storage/sdcard0 not exist.
Folders storage and sdcard0 really not exist. But when i manually created them - they were empty in case of the next connection and no error message.
I freely go to the /mnt/sdcard as normal user in my phone, like and in /storage/sdcard0. Both ways go to the my sdcard. May be problem in different names my sdcard: sdcard in /mnt and sdcard0 in /storage ?
Comment 12 Albert Vaca Cintora 2015-01-10 21:19:02 UTC
Can you tell me which path is KDE Connect trying to access, and which one is the one that should be using instead?
Comment 13 alpir 2015-01-11 06:45:51 UTC
I don't know exactly. May by KDE connect trying path /mnt/sdcard0 instead /mnt/sdcard.