Bug 344432 - SFTP: When attempting to view kdeconnect in dolphin it crashes
Summary: SFTP: When attempting to view kdeconnect in dolphin it crashes
Status: RESOLVED FIXED
Alias: None
Product: kdeconnect
Classification: Applications
Component: common (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Albert Vaca Cintora
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-21 19:44 UTC by voncloft
Modified: 2019-03-08 15:28 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description voncloft 2015-02-21 19:44:18 UTC
I will bring up a folder in KDE and under "Places" lt will show my android device, I click on it and dolphin states it is trying to bring up kdeconnect://long_drawn_out_string in the address bar.

And dolphin freezes, eventually it states :
The file or folder /home/nick/.kde4/share/apps/kdeconnect/4d1cf51aa2eb12be/storage/emulated/0 does not exist.

I will brows to /home/nick/.kde4/share/apps/kdeconnect and the folder exists, but nothing is in it.

Reproducible: Always

Steps to Reproduce:
1. Open Folder
2. Click on Android device under "Places"
3. Wait for kdeconnect to fail.

Actual Results:  
Dolphin freezes, eventually it states :
The file or folder /home/nick/.kde4/share/apps/kdeconnect/4d1cf51aa2eb12be/storage/emulated/0 does not exist.

I will brows to /home/nick/.kde4/share/apps/kdeconnect and the folder exists, but nothing is in it.

Expected Results:  
To view my files and folders on my android device as they are in the directory tree on itself.
Comment 1 logins 2017-03-03 18:24:36 UTC
Also on found on KDE Neon User Edition with newest updates.

Following same steps as voncloft, also tried using Dolphin as root user, pulled this from terminal (launched with sudo dolphin)

kdeinit5: Got EXEC_NEW '/usr/lib/x86_64-linux-gnu/qt5/plugins/kio_kdeconnect.so' from launcher.
kdeinit5: preparing to launch '/usr/lib/x86_64-linux-gnu/qt5/plugins/kio_kdeconnect.so'
kdeconnect.kio: Setting host:  "7bbbc87b4655f0d8"
kdeconnect.kio: Setting host:  "7bbbc87b4655f0d8"
kdeconnect.kio: Listing... QUrl("kdeconnect://7bbbc87b4655f0d8/")
kdeconnect.kio: ListDevice "7bbbc87b4655f0d8"
kdeconnect.kio: Stat:  QUrl("kdeconnect://7bbbc87b4655f0d8/")
kdeconnect.kio: Error in DBus request: QDBusError("org.freedesktop.DBus.Error.UnknownObject", "No such object path '/modules/kdeconnect/devices/7bbbc87b4655f0d8/sftp'")
Comment 2 Anna 2017-03-15 13:12:59 UTC
I'm using Kubuntu 16.10 64bits
KDE Plasma version 5.7.5 / KDE Frameworks 5.26.0 / Qt Version 5.6.1

I have the same issue as described in this thread:

1. Click on folder in the KDEConnect system tray icon, or in 'places' in Dolphin.
2. a folder comes up, with two folders in it: 'Images from the camera' and 'all files'.
3. When clicking in either one of them, a message displays on the top of the window, stating: «File or folder /home/<user>/.config/kdeconnect/d5f66b4b718ad604/kdeconnect_sftp/d5f66b4b718ad604/storage/emulated/0 does not exist.»

It happens every single time. I was never able to transfer files from the computer to the mobile. I am able to transfer files from the mobile to the computer normally.
Comment 3 Sunhoo 2017-07-11 11:38:27 UTC
I can confirm the same exact bug on the latest KDE Neon User Edition (and it's been that way for months).

I built kdeconnect from source and started it from command line, here's what logs I've got for the daemon kdeconnectd:

kdeconnect.core: KdeConnect daemon starting
kdeconnect.core: onStart
kdeconnect.core: KdeConnect daemon started
kdeconnect.core: Broadcasting identity packet
kdeconnect.core: Socket connected QSslSocket(0xe51ba0)
kdeconnect.core: TCP connection done (i'm the existing device)
kdeconnect.core: Starting server ssl (I'm the client TCP socket)
kdeconnect.core: Socket succesfully stablished an SSL connection
kdeconnect.core: It is a known device "Motorola"
kdeconnect.core: Not loading plugin "kdeconnect_remotecommands" because device doesn't support it
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
kdeconnect.plugin.sftp: add to dolphin
kdeconnect.plugin.sftp: Created device: "Motorola"
QObject::connect: No such signal QDBusAbstractInterface::messageReceived(QString,QString)
[1]    25814 segmentation fault  build/daemon/kdeconnectd

(Sometimes it also says: Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString) before the segfault.)

And for kdeconnect-indicator:

kdeconnect.interfaces: Adding missing or previously removed device "9a8b63987a327f12"
kdeconnect.interfaces: Adding missing or previously removed device "9a8b63987a327f12"
kdeconnect.interfaces: dbus interface not valid
kdeconnect.interfaces: dbus interface not valid
kdeconnect.interfaces: dbus interface not valid
kdeconnect.interfaces: dbus interface not valid
kdeconnect.interfaces: Adding missing or previously removed device "9a8b63987a327f12"
kdeconnect.interfaces: Adding missing or previously removed device "9a8b63987a327f12"
kdeconnect.interfaces: Adding missing or previously removed device "9a8b63987a327f12"
kdeconnect.interfaces: dbus interface not valid

The daemon segfaults and crashes automatically once it finds the device (before I can even launch dolphin and try to browse). It doesn't crash like that with the official package from KDE Neon.
Comment 4 Sunhoo 2017-07-11 12:44:42 UTC
I found the sshfs command used by the kdeconnect daemon to try to mount the device:

sshfs kdeconnect@10.20.10.10:/ /home/jean/.config/kdeconnect/9a8b63987a327f12/kdeconnect_sftp/9a8b63987a327f12 -p 1739 -f -F /dev/null -o IdentityFile=/home/jean/.config/kdeconnect/privateKey.pem -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o HostKeyAlgorithms=ssh-dss -o password_stdin

Except that 10.20.10.10 is my tun0 address and it should be using 192.168.0.41 which is my local network address (from wlan0, which is what I'd use when I manually ssh into my device).

So when I execute this command manually, it just hangs for 60 seconds then timeout as expected.

But if I change the command to:

sshfs kdeconnect@192.168.0.41:/ /home/jean/.config/kdeconnect/9a8b63987a327f12/kdeconnect_sftp/9a8b63987a327f12 -p 1739 -f -F /dev/null -o IdentityFile=/home/jean/.config/kdeconnect/privateKey.pem -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o HostKeyAlgorithms=ssh-dss -o password_stdin -d

I get:

FUSE library version: 2.9.7
nullpath_ok: 0
nopath: 0
utime_omit_ok: 0
Warning: Permanently added '[192.168.0.41]:1739' (DSA) to the list of known hosts.
Permission denied (password).
read: Connection reset by peer

It waits for the password from the standard input (see "-o password_stdin"), so I enter something then it does seem to find the device but the connection is denied because of the incorrect password. This is normal since this password should be automatically given by KDE Connect and we are not supposed to type it in.

So how come 10.20.10.10 is used instead of 192.168.0.41 (in my case)?

As a side note, I do use a VPN on both devices but the result is the same when not connected to them.
Comment 5 Sunhoo 2017-07-15 18:14:25 UTC
After some debugging, I can see that the problem (in my case at least) does come from my smartphone's VPN: it creates a tun0 interface to which KDE Connect tries to connect but can't.

For example the VPN creates tun0 with an address of 10.20.10.10 and my wlan0 address is 192.168.0.41. The address sent by the KDE Connect app is 10.20.10.10 and this is where the connection timeout.

If I hard code "192.168.0.41" for the network address in the KDE Connect source code, I can mount and browse the filesystem.

I guess a solution in my case would be to redirect traffic from tun0 to wlan0 with iptables in Android.
Comment 6 Erik Duisters 2019-03-08 15:28:51 UTC
Fixed by commit a6fdddf84379dc6d6da06295217870d1a1e970d2 on kdeconnect-kde