b4j4 / indicator-kdeconnect

AppIndicator for KDE Connect
GNU Lesser General Public License v2.1
371 stars 38 forks source link

"Browse device" not working #10

Closed GoodGuyNick closed 6 years ago

GoodGuyNick commented 7 years ago

I don't know whether the problem is in the sftp or in the indicator-kdeconnect. When pressing "Browse device" it opens empty folder with 1TB free space. Path to the folder: /home/user/.config/kdeconnect/3eaf8b118bef4c06/kdeconnect_sftp/3eaf8b118bef4c06/ PC - Xubuntu 16.04.01, Smartphone - CM 12.1

Same issue was reported here: https://github.com/vikoadi/indicator-kdeconnect/issues/27

getmeacuboftea commented 7 years ago

Thank you very much, dev version solve that problems for me.

b4j4 commented 7 years ago

@getmeacuboftea the browse "SD Card" work for you?

ghost commented 7 years ago

Work for me if I adding "sdcard" on the end of the path.

~/.config/kdeconnect/98b2ce4882427226/kdeconnect_sftp/98b2ce4882427226/sdcard

I can read and write without problem.

But open default "Browse Device" open a blank folder

~/.config/kdeconnect/98b2ce4882427226/kdeconnect_sftp/98b2ce4882427226/

Using Linux Mint 18.1, Nemo FM, Samsung Galaxy S7, Android 7.0 stock rom and last KdeConnect 1.6.4 I don't know if is checked "Device Reachable and Trusted" help with this problem.

jlopezay commented 7 years ago

Thanks FinderX,

I have up some months ago :)

Just adding /sdcard at the end of the path also works for me.

bgeVam commented 7 years ago

@Bajoja I always need to manually select "browse device" before I am able to access my device. Is there a reason the sshfs connection isn't already established when the indicator starts and the "browse device" option only opens the folder in the file browser?

MarkoIndaco commented 6 years ago

Guys I really goin mad with this. Lemme explain better: Got 2 devices, the old Sony Xperia E4g (KitKat 4.4.4) works like a charm, instead the new HTC One M9 (Nougat 7.0) show and empty folder. I already try to:

Plus: All others Kde-Indicator functions on HTC works fine as Send file, Finde my phone etc. @FinderX can you please explain more detailed how did you rename/add sdcard path? When I try to do that, with *root priviliges, it show an error

jlopezay commented 6 years ago

Marko,

In my case, when I select Browse device, the file browser opens the following blank folder:

/home/jose/.config/kdeconnect/e221a4d89b0aecc6/kdeconnect_sftp/e221a4d89b0aecc6

then I just edit the path adding manually the /sdcard

/home/jose/.config/kdeconnect/e221a4d89b0aecc6/kdeconnect_sftp/e221a4d89b0aecc6/sdcard and works

Kind Regards.

2017-10-09 18:40 GMT+02:00 Marko notifications@github.com:

Guys I really goin mad with this. Lemme explain better: Got 2 devices, the old Sony Xperia E4g (KitKat 4.4.4) works like a charm, instead the new HTC One M9 (Nougat 7.0) show and empty folder. I already try to:

  • delete the kdeconnect folder
  • disassociate both the devices
  • associate each others (tested and working, they transfert files each other as well)

Plus: All others Kde-Indicator functions on HTC works fine as Send file, Finde my phone etc. @FinderX https://github.com/finderx can you please explain more detailed how did you rename/add sdcard path? When I try to do that, with *root priviliges, it show an error

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Bajoja/indicator-kdeconnect/issues/10#issuecomment-335213242, or mute the thread https://github.com/notifications/unsubscribe-auth/AYqohHG0b-rVV7BI392qKO9ZtYcdfG7dks5sqkyUgaJpZM4LEZ4A .

ghost commented 6 years ago

@MarkoIndaco Just exactly like @jlopezay say in his post. I give this screenshots for illustrations.

peek 2017-10-09 15-40

Regards.

MarkoIndaco commented 6 years ago

Thank you guys for explanations and video. Indeed (because I'm noob) my address bar was hidden by settings. Unluckly, even enabling the address bar and adding the sdcard at the end of the address, I got en error (see screenshot). It's write in italian but maybe you understand what's the problem. I also try to attach the /sdcard opening the Home folder, but got the same error.

github - kdeconnect issue 1

tsjnachos117 commented 6 years ago

@MarkoIndaco: Instead of adding "/sdcard", you can try adding "/storage" or "/mnt". The former works best on my Galaxy Tab 2 7.0 (LineageOS 13), and the latter works best on my Galaxy S6 (Android 5.1). IDK if either will work for you, but they're both worth a try. Also, if you go into Android's settings, I think there's a setting to enable access to the to your "SD Card", which basically means your files/folders, (or maybe that's just LineageOS, I'm not sure). I find that I have to manually enable that on my Tablet for this program to work. Hope something in this post helps. :smile:

MarkoIndaco commented 6 years ago

Thank very much mate. Following you're suggestion I find the way. I try to add /storage and it shows me 3 folder. Following this way I try /mnt instead, and this shows the folders where I find (also) the sdcard. Find this was simple to understand that I shuold attach /mnt/sdcard to access to the external storage. :+1:

Thank you again all for help and support!

C0rn3j commented 6 years ago

Am on Arch Linux - doesn't work on Nautilus, works on Dolphin.

Had to install sshfs (unsurprisinigly).

tsjnachos117 commented 6 years ago

@C0rn3j Can you mount the device through the applet and manually browse any directories in ~/.config/kdeconnect/ with Nautilus? Can you browse said directories from the terminal?

andyholmes commented 6 years ago

Be aware KDE Connect sftp server has issues with SSHFS 3.x, and I believe Arch uses 3.3 currently.

https://github.com/KDE/kdeconnect-android/blob/master/src/org/kde/kdeconnect/Plugins/SftpPlugin/SimpleSftpServer.java#L230

C0rn3j commented 6 years ago

@andyholmes Arch is on 3.3.1, the comment you linked specifically mentions 3.0 and 3.2.

@tsjnachos117

c0rn3j@Thor : ~/.config/kdeconnect
[0] % ls -lah *  
-rw------- 1 c0rn3j c0rn3j 1.2K Nov  2 10:39 certificate.pem
-rw------- 1 c0rn3j c0rn3j 1.7K Nov  2 10:39 privateKey.pem
-rw-r--r-- 1 c0rn3j c0rn3j 1.2K Nov  2 10:45 trusted_devices

4e735b0eee347175:
total 4.0K
drwxr-xr-x 1 c0rn3j c0rn3j  96 Nov  2 16:57 .
drwxr-xr-x 1 c0rn3j c0rn3j 120 Nov  2 10:45 ..
-rw------- 1 c0rn3j c0rn3j 524 Nov  2 10:45 config
drwxr-xr-x 1 c0rn3j c0rn3j   0 Nov  2 16:57 kdeconnect_pausemusic
drwxr-xr-x 1 c0rn3j c0rn3j   0 Nov  2 10:40 kdeconnect_runcommand

c0rn3j@Thor : ~/.config/kdeconnect
[0] % ls -lah ./*/*
-rw------- 1 c0rn3j c0rn3j 524 Nov  2 10:45 ./4e735b0eee347175/config

./4e735b0eee347175/kdeconnect_pausemusic:
total 0
drwxr-xr-x 1 c0rn3j c0rn3j  0 Nov  2 16:57 .
drwxr-xr-x 1 c0rn3j c0rn3j 96 Nov  2 16:57 ..

./4e735b0eee347175/kdeconnect_runcommand:
total 0
drwxr-xr-x 1 c0rn3j c0rn3j  0 Nov  2 10:40 .
drwxr-xr-x 1 c0rn3j c0rn3j 96 Nov  2 16:57 ..

Using the applet gives me this error message, and the folder structure then looks like this, so no.

A folder named /home/c0rn3j/.cache/kioexec/krun/2979_0/ already exists.

ArchangeGabriel commented 6 years ago

I also have this error message. See https://bugs.kde.org/show_bug.cgi?id=373967.

Apparently this is an error with kio.

Also, I had problem before with kdeconnect and sshfs because of hardening I made in /etc/ssh/ssh_config.

andyholmes commented 6 years ago

@C0rn3j You may be right it was fixed in 3.3 (probably best to check), but the commit says:

Detect data corruption caused by sshfs 3.x and abort transfer

If you get a message say something to the effect of "Connection reset by peer", then the Android app has decided (for some reason) to close the connection. If you don't have fusermount installed kdeconnect tries to use umount which doesn't work as reliably. Additionally, it may fail to cleanly unmount if the directory is in use when it tries.

//Free mount point (won't always succeed if the path is in use)

For me, sshfs always chokes in the top-level directory when listing files, which I think is a know issue with SSHFS/SFTP. I have to use a directory under it like DCIM or Download.

tsjnachos117 commented 6 years ago

@C0rn3j AFAIK, the indicator doesn't use KIO, it's odd that the error message you got mentions "kioexec". Also, the indicator mounts to ~/.config/kdeconnect/[device-id-thinggy]/kdeconnect_sftp/[device-id-thnggy agan]. (It looks to me like your device-id-thinggy is "4e735b0eee347175".)

Perhaps the indicator uses different mount points than KDE? If so, maybe the problem is that KDE already mounted the device, and the indicator refuses to mount it because it's already mounted in a subdirectory of ~/.cache?

I would try checking for any mounted sshfs shares, and unmounting all of them, unless you have some shares you need to access. You can then try mounting with the indicator (perhaps you should close Dolphin first, and maybe test with some desktop other than KDE), and do ls ~/.config/kdeconnect/4e735b0eee347175/kdeconnect_sftp/4e735b0eee347175/storage. I included the "/storage" directory because some Android systems don't seem to like to show their root directories, although Android should let you browse certain subdirectories, such as /storage or /mnt.

andyholmes commented 6 years ago

@tsjnachos117 You're right, KDE Connect stopped using kio sometime ago for this and probably couldn't anymore because of bug #351725, unless KIO allows some pretty advanced configuration of SFTP. The only thing it might use KIO for now is to add the device to the Places area in Dolphin.

On the other hand, the indicator doesn't do any mounting at all, it just asks KDE Connect to do it via DBus. You could be right about unmounted (or uncleanly unmounted) sshfs share hanging around, probably these would show up in mount.

ArchangeGabriel commented 6 years ago

Hum indeed. I have a line in mount:

kdeconnect@IP:/ on /run/user/1000/<hexaid> type fuse.sshfs (rw,nosuid,nodev,relatime,user_id=<user_id>,group_id=<group_id>)
ArchangeGabriel commented 6 years ago

But permissions…

d????????? ? ?        ?          ?              ? <hexaid>
C0rn3j commented 6 years ago

@tsjnachos117

You can then try mounting with the indicator (perhaps you should close Dolphin first, and maybe test with some desktop other than KDE),

My DE is Cinnamon and I primarily use Nautilus. I just used KDE for testing and before I couldn't really find anything.

I've tried multiple times even after rebooting.

b4j4 commented 6 years ago

I use Arch Linux, sometimes it work, sometimes not. @andyholmes what you use in the extension to mount the file system, the DBus command?

andyholmes commented 6 years ago

@Bajoja Yep, I use mountAndWait() then I call getDirectories() that returns the directory/name pairs and that's what I show in the menu. For me the top directory always causes sshfs to disconnect while listing files though, so I use the Camera directory. I think the Android app uses some built-in SFTP server class that's not very good.

Internally, think kdeconnect send a temporary password with user 'kdeconnect' but that's never exposed in the interface.

andyholmes commented 6 years ago

If this works in Dolphin, it must be a Nautilus problem, maybe the way it lists directories over SSHFS. I thought maybe the server class in the Android app had changed, but I don't think it has. In my newer extension I do it almost exactly how KDE Connect does and I still get crashes in the top-level directory.

https://github.com/andyholmes/gnome-shell-extension-gsconnect/blob/master/src/service/plugins/sftp.js#L127 https://github.com/KDE/kdeconnect-kde/blob/master/plugins/sftp/mounter.cpp#L124

b4j4 commented 6 years ago

@andyholmes thanks, the way you pointed solve the problem, i will launch a new version with the browse of the paths getted from the Dbus method getDirectory, it will be optional and it can be enabled on settings.

b4j4 commented 6 years ago

The last commit should solve the problem, just compile and install it, then go to settings and enable the option to show directories instead of broswe device and voilá.

bhughesshelton commented 6 years ago

I am experiencing this issue on Manjaro with Plasma, trying to connect to a Galaxy S5 with Google Android, but only when Thunar is set as the default file manager (i.e. If I set Plasma to prefer Dolphin, all works as it should). Each attempt to connect to the device creates a new directory and throws an error 'A folder named /home/user/.cache/kioexec/krun/randomNum/ already exists.' that the directory already exists. I am able to send data back and forth over CLI, notifications work properly, etc.

xgdgsc commented 5 years ago

Not working for me on Kubuntu 18.04 with xiaomi 8 after clicking "All FIles", shows The file or folder does not exist.

swedneck commented 5 years ago

I get a message saying that /home/user/.cache/kioexec/krun// already exists when i try to browse my phone, this number changes each time i try to browse the phone and deleting the folder does not help. My phone also doesn't show up in thunar.

ArchangeGabriel commented 5 years ago

Apparently this feature only works with Dolphin…

bastafidli commented 5 years ago

Not working for me on Kubuntu 18.04 with xiaomi 8 after clicking "All FIles", shows The file or folder does not exist.

On ubuntu 18.04 adding backports ppa and upgrading to kde connect 1.3.3 solved the problem

freddii commented 5 years ago

Rolling back to KDE Connect 1.8.4 from F-droid fixed it.

alexanderadam commented 5 years ago

Could it be related to this issue from 2015? I'm using Dolphin on Ubuntu 18.04 and the latest Android version (1.10.1) from F-Droid.

I wasn't able to test it with 1.8.4 because the installation had an "unknown error". Nevermind. The "Downgrade" feature of F-Droid doesn't work. Manually uninstalling and installing works. What's more important: I can confirm that downgrading works!

It's much slower than it used to be but I'm happy that it works at all. :wink: So I guess it's probably a bug in the Android app then? Does anyone know whether there is a corresponding bug for it in the app repository? On GitHub the issue tracker seems to be disabled.

C0rn3j commented 5 years ago

I have the same issue I had when I initially posted here in 2017.

I am on Arch, running kdeconnect 1.3.3 and on LineageOS I am running 1.10.1.

I can open the device fine in Dolphin directly:

image

However if I try to open it through the tray via right click > devicename > Browse files I get this error:

image

ArchangeGabriel commented 5 years ago

@C0rn3j Is Dolphin your only/default file browser?

C0rn3j commented 5 years ago

Neither only or default, default is Nautilus.

I don't see the device in Nautilus at all.

ArchangeGabriel commented 5 years ago

Then that’s your issue. Only Dolphin works with KDE Connect.

C0rn3j commented 5 years ago

If that is true then kdeconnect should make that button open Dolphin, not try whatever is the default file manager only to throw an error.

If you are correct, you should be able to reproduce it by associating Nautilus in mimeapps

~/.config/mimeapps.list

[Added Associations]
inode/directory=org.gnome.Nautilus.desktop;
ArchangeGabriel commented 5 years ago

Well, more importantly KDE Connect should be made working with other files browsers. But anyway, this is not the right place for this.

tsjnachos117 commented 5 years ago

Actually, I think that Dolphin (or kio) might be interfering. kdeconnect 1.3.3 should mount to /run/user/(user id number)/*, not ~/.cache/kioexec/krun/*. Try this: fusermount -u ~/.cache/kioexec/krun/*, and then try mounting again.

C0rn3j commented 5 years ago
[1] % fusermount -u ~/.cache/kioexec/krun/*
fusermount: extra arguments after the mountpoint
tsjnachos117 commented 5 years ago

What is the output of mount | grep -e ssh? Likewise for mount | grep fuse?

dylskiMarcin commented 5 years ago

Hi @tsjnachos117, I have the same problem as C0rn3j. I'm using Manjaro with Cinnamon 4.0.9 and Deepin as default file manager.

$ mount | grep -e ssh kdeconnect@[--IP--]:/ on /run/user/1000/9193b7e04a70e48 type fuse.sshfs (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)

$ mount | grep fuse fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime) gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000) kdeconnect@[--IP--]:/ on /run/user/1000/9193b7e04a70e48 type fuse.sshfs (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)

There directory /run/user/1000/9193b7e04a70e48/ is present but not accessible.

Bellow I attach gist with kdeinit5 output after "KDE Connect -> Browse device" https://gist.github.com/dylskiMarcin/034b7e6446d15449357215bd0f18fcc1

ArchangeGabriel commented 5 years ago

kdeconnect 1.3.4 which was just released seems to finally fix this issue according to the changelog:

  • [kio] Fix file browsing with non-KIO file managers

I should be able to confirm soon. :)

eriefisher commented 5 years ago

Just installed 1.3.4 from Ubuntu on my antix with xfce system. kdeconnect now goes farther but when trying to browse device it open the text editor instead of thunar. I need to find an open with config or some way to tell it to open thunar. The previous version would fail as mentioned earlier but navigating to the mount path pulled from mtab would work. Just a lot of work to see files.

Anyone know how to change the open with parameters? kdeconnect

tp0 commented 5 years ago

@eriefisher Workaround: copy/type that location in that dialog into Thunar's location bar (Ctrl+L) and then add it into Thunar's bookmarks.

eriefisher commented 5 years ago

@tp0 Yes, thank you. I know I can navigate/bookmark. Everything is accessible, just not through the application. Does this thing work properly with KDE?

awsms commented 4 years ago

While trying to browse my device, using the "Browse device" button on the indicator:

A folder named /home/user/.cache/kioexec/krun/14868_0/ already exists.

Wut? Lol

Nevermind, I'm absolutely not familiar with KDE stuff. I installed Dolphin and it works fine.