Bug 341175

Summary: Remote filesystem does not work with Android L
Product: [Applications] kdeconnect Reporter: edward.81
Component: android-applicationAssignee: Albert Vaca Cintora <albertvaka>
Status: RESOLVED DUPLICATE    
Severity: normal CC: cc, haakondr, kdebugs, pikkuporo, r0uzic, schugt, subdiff, valeriodean, zellox
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Android   
OS: Unspecified   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Nexus 5 folders

Description edward.81 2014-11-22 09:07:11 UTC
After installing Android lollipop (clean install on nexus5 with the official google rom) and have re-run the association of the device are no longer able to browse the file system on the phone.
When I open the device in Dolphin, I see two folders (All files / Camera Pictures), All Files always appears empty, while Camera pictures work properly.

Reproducible: Always

Steps to Reproduce:
1.Open Dolphin
2.Select the Phone from the list
3.Open All Files

Actual Results:  
Empty folder

Expected Results:  
The folders and files in my phone

Kde connect form the google play store 0.7.3.2
Kde connect from arch community repository version 0.7.3-1 (I also tried the git version from Aur version 544.955f0db-1)
Comment 1 Albert Vaca Cintora 2014-11-22 17:12:25 UTC
I just got my Lollipop upgrade and I can't reproduce this bug. However, I will publish a new version today with some changes to how the filesystem browse plugin works, so you might want to try again after the next update :)
Comment 2 edward.81 2014-11-23 10:30:35 UTC
Thanks for the reply. I tried the new version of the Android client but this behavior remains. In the end I managed to solve. For convenience I installed TWRP recovery. This creates in the root of  sdcard a directory called /TWRP with owner and group root The presence of this folder prevents the application to list files and folders. You may notice an error repeated many times with logcat when you try to open the folder with dolphin.

11:17:00.272 Warning sdcard 202  type=1400 audit(0.0:339): avc: denied { getattr } for path="/data/media/0/TWRP" dev="mmcblk0p28" ino=1368135 scontext=u:r:sdcardd:s0 tcontext=u:object_r:unlabeled:s0 tclass=dir
Comment 3 Carlos Cabezas 2015-07-17 03:07:31 UTC
I can't access to device's files from Debian and Kubuntu (clean install), the devices are Nexus 5 and Moto G (2012) with Lollipop.

KDE Connect download from Play Store, version 0.8h
Comment 4 Albert Vaca Cintora 2015-07-17 20:01:07 UTC
Hi Carlos :)

Is your case the same case as the original issue? That is: "All files" doesn't work but "Camera pictures" does.

Also, is your Nexus 5 rooted? And are you running KDE 4 or Plasma 5?

Albert
Comment 5 Carlos Cabezas 2015-07-17 20:35:36 UTC
Hi Albert! :)

Yes, "camera pictures" folder appear the photos taken by the camera but the other folder doesn't show anything.

Nexus 5 (5.1.1 stock) is rooted but only to access the system partition from Root Explorer, I haven't installed any other kernel, and Moto G (5.0.2 stock) isn't rooted. I can prove with a Huawei smartphone with Android 4, tomorrow I will comment the results.
Comment 6 Carlos Cabezas 2015-07-17 20:36:19 UTC
Created attachment 93629 [details]
Nexus 5 folders
Comment 7 Carlos Cabezas 2015-07-17 23:26:55 UTC
I used a Huawei G510 with Android 4.1 and works fine.
Comment 8 Albert Vaca Cintora 2015-07-21 18:11:07 UTC
This might happen if, as stated by Edward above, there are directories that you can not list because of restricted permissions. 

Some phones (even though not the Nexus 5) ship with restricted permissions in some directories, and this is also the case for some root apps (hence my question :). This makes KDEConnect fail to list them apparently (and this is a bug we should fix).

Can you check if that's the case for you, by checking the permissions of your files and directories in "/"? If there is something with owner-only read permission, can you see if making the permissions less restrictive fixes the problem?
Comment 9 Carlos Cabezas 2015-07-21 22:06:27 UTC
The permissions for the sdcard folder are 777 and I can't see or modify the permissions for /. Anyway, Moto G isn't rooted and KDE connect fails too.
Comment 10 edward.81 2015-07-21 22:16:45 UTC
Hi, for the nexus5 try yo update TWRP to the latest version (2.8.7.0 now). The boot in the recovery and select "advanced"->"File manager" search for the "twrp" or ".twrp" in the sdcard folder and tap on it to enter on the dir. Then chose "delete" for removing the folder. Now, without doing anything shutdown the phone by holding down the power button until it reset.
In my case (now i don't know if it is fixed and if was an kdeconnect or android trouble)  the directory listing failed just for the presence of a dir with "strange" permission on the sdcard dir, I was unable to open it with an android file manager or adb that listed it as file not folder.
I hope this can help, at least for the nexus5.
Comment 11 zellox 2015-07-27 10:28:34 UTC
I have a similar (the same?) issue.

I'm using the developmental version of kdeconnect as I'm using plasma 5. When I attempt to open the phone in dolphin no folders are displayed. Interestingly, if I look in gwenview, I can see the top level folders as well.

If I mount the phone using the exact same sshfs command (I grabbed it via ps), and go into the directory, running ls gives me a permissions error:
"ls: reading directory .: Operation not permitted"

If you let me know exactly what permissions you are looking for, I can tell you what is set for mine phone (running cyanongemod 12.1). Here are some:
/sdcard 777
/storage 550 (owner = system : group = sdcard_r)
/storage/emulated 751 (root : sdcard_r)
/storage/sdcard0 700 (root : root)
/storage/sdcard1 775 (root : sdcard_rw)
/storage/emulated/0 771 (root : sdcard_r)
Comment 12 zellox 2015-07-27 11:10:25 UTC
To add to my comment above, if I change into the mounted directory, I can cd into e.g. /etc or /storage and get a directory listing with no issue there.

So if you let me know what directories kdeconnect uses, I can grab the permissions to help debug the issue.
Comment 13 Albert Vaca Cintora 2015-07-27 17:21:28 UTC
That's a different bug in Plasma 5's Dolphin/KIO [1].

When you get to that empty directory, just copy and paste the URL into a new Dolphin window (or actually, even the same window) and it will load just fine.

[1] https://bugs.kde.org/show_bug.cgi?id=345199
Comment 14 zellox 2015-07-27 21:15:04 UTC
(In reply to Albert Vaca from comment #13)
> That's a different bug in Plasma 5's Dolphin/KIO [1].
> 
> When you get to that empty directory, just copy and paste the URL into a new
> Dolphin window (or actually, even the same window) and it will load just
> fine.
> 
> [1] https://bugs.kde.org/show_bug.cgi?id=345199

I already tried that it doesn't work.

Pasting the URL into a new tab of the same window shows a blank folder as before, and pasting it into a new window shows "Invalid protocol"
Comment 15 Albert Vaca Cintora 2015-11-12 01:06:30 UTC
*** Bug 352568 has been marked as a duplicate of this bug. ***
Comment 16 SZÉKELYI Szabolcs 2016-02-29 18:57:43 UTC
Same issue here. One thing that I couldn't find above is that copying files and folders to the device does work fine. Camera pictures work fine on both the internal storage and the SD card, whereas browsing for general files show only empty folders "SD card" and "Internal storage", and nothing inside them.

This is certainly a permission problem:

shell@GT-I9100:/ $ ps | grep kde
u0_a103   18571 4529  711376 30636 ffffffff 00000000 S org.kde.kdeconnect_tp
shell@GT-I9100:/ $ su - u0_a103
u0_a103@GT-I9100:/ $ ls -l /storage/sdcard1/
opendir failed, Permission denied
1|u0_a103@GT-I9100:/ $ 

Here are the permissions:

drwxr-x--x root     sdcard_r          2016-02-25 13:23 /storage
drwxrwx--x root     sdcard_r          1970-01-01 01:00 /storage/sdcard1

Running Cyanogenmod 12.1, KDE Connect 0.9e, KDE Frameworks 5.15.0.
Comment 17 moli 2016-04-13 22:05:47 UTC
Looks like i have the same problem here, but i cant even enter the camera dir ("the directory [..] does not exist"). Xiaomi Redmi Note 2 MIUI 7.2.3.0 global rom Android 5.0.2 Ping, touchpad, sending urls to phone works.
Browsing phone works on the same desktop machine with an other phone.
Tell me what more info do you need.

I dont even know what directory the app would like to share, what is it's root. Can we set this root on the android app at the plugin's settings?
Comment 18 pikkuporo 2016-10-13 12:31:51 UTC
Possible duplicates:
#369495
#356528
Comment 19 Albert Vaca Cintora 2016-10-18 11:07:43 UTC
*** Bug 356528 has been marked as a duplicate of this bug. ***
Comment 20 Albert Vaca Cintora 2016-10-18 11:07:56 UTC
*** Bug 369495 has been marked as a duplicate of this bug. ***
Comment 21 SZÉKELYI Szabolcs 2016-11-01 21:51:54 UTC
Still persists with KDEConnect 1.4.4, CM13, Samsung Galaxy S4.

No fix for almost 2 years now... do you need any more information?
Comment 22 Ed_FR38 2017-01-29 17:28:36 UTC
*** This bug has been confirmed by popular vote. ***
Comment 23 HD 2017-03-07 01:30:31 UTC
I have similar permission problems, on Android 7.1 (also happened on Android 6). 

I can browse my general files fine, as well as both the camera folders on internal and sdcard storage. However I can't browse the files on the sdcard main folder, it doesn't give me an error in dolphin, it just shows zero files. It tries getting the correct folder, but just shows nothing. 

Everyone I know using kdeconnect has the same issue of not being able to access the sdcard itself.

Permissions:
drwxrwx--x 21 root sdcard_rw   <sdcard>
drwxrwx--x  5 root sdcard_rw    <sdcard>/DCIM
Comment 24 HD 2017-03-07 01:36:42 UTC
Small update: Manually specifying folders in my sdcard works, I just can't list the sdcard's main/"root" folder. So for instance .../<sdcard>/music works. Doesn't seem to be affected by changing perms.
Comment 25 Albert Vaca Cintora 2017-03-15 10:41:41 UTC
I think I know what the problem is... but I don't have an affected phone myself, so I haven't been able to reproduce it to be able to fix it. Since there are many reports about this, I'm closing this one to centralize them allin #336043.

*** This bug has been marked as a duplicate of bug 336043 ***