Bug 230621

Summary: kio_sftp disconnection causes kate to not save file
Product: [Frameworks and Libraries] kio-extras Reporter: maddog75 <bill>
Component: SFTPAssignee: Andreas Schneider <asn>
Status: RESOLVED FIXED    
Severity: normal CC: bill, kinnalru
Priority: NOR    
Version First Reported In: 18.04.3   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description maddog75 2010-03-13 21:32:14 UTC
Version:            (using KDE 4.4.1)
OS:                Linux
Installed from:    Ubuntu Packages

Sometimes i get an error saving a file in kate over kio_sftp. It would appear that the sftp connection has closed for whatever reason and nothing bothers to start a new connection. see log showing a successful save prior to the problem and then 3 failed saves


kio_sftp(12893) sftpProtocol::put: put():  KUrl("sftp://root@jupiter.grapevineit.net/var/www/clients/client1/web1/web/sites/all/themes/gv_kbltheme/page.tpl.php")  , permissions =  "-1" , overwrite =  4 , resume =  0
kio_sftp(12893) sftpProtocol::put: Appending .part extension to  "/var/www/clients/client1/web1/web/sites/all/themes/gv_kbltheme/page.tpl.php"
kio_sftp(12893) sftpProtocol::put: Trying to open:  "/var/www/clients/client1/web1/web/sites/all/themes/gv_kbltheme/page.tpl.php.part" , mode= "33188"
kio_sftp(12893) sftpProtocol::put: Trying to set final permissions of  "/var/www/clients/client1/web1/web/sites/all/themes/gv_kbltheme/page.tpl.php"  to  "33188"
kio_sftp(12894) sftpProtocol::listDir: list directory:  KUrl("sftp://root@jupiter.grapevineit.net/var/www/clients/client1/web1/web/sites/all/themes/gv_kbltheme")
kio_sftp(12894) sftpProtocol::listDir: readdir:  "/var/www/clients/client1/web1/web/sites/all/themes/gv_kbltheme" , details:  "2"
kio_sftp(12894) sftpProtocol::closeConnection: closeConnection()
kio_sftp(12894) sftpProtocol::slave_status: connected to  "jupiter.grapevineit.net" ?:  false
kio_sftp(12893) sftpProtocol::put: put():  KUrl("sftp://root@jupiter.grapevineit.net/var/www/clients/client1/web1/web/sites/all/themes/gv_kbltheme/page.tpl.php")  , permissions =  "-1" , overwrite =  4 , resume =  0
kio_sftp(12893) sftpProtocol::put: Appending .part extension to  "/var/www/clients/client1/web1/web/sites/all/themes/gv_kbltheme/page.tpl.php"
kio_sftp(12893) sftpProtocol::put: Trying to open:  "/var/www/clients/client1/web1/web/sites/all/themes/gv_kbltheme/page.tpl.php.part" , mode= "384"
kio_sftp(12893) sftpProtocol::put: ####################### COULD NOT WRITE  "/var/www/clients/client1/web1/web/sites/all/themes/gv_kbltheme/page.tpl.php.part"  permissions= -1
kio_sftp(12894) kdemain: *** kio_sftp Done
kio_sftp(12894) sftpProtocol::~sftpProtocol: pid =  12894
kio_sftp(12894) sftpProtocol::closeConnection: closeConnection()
kio_sftp(12893) sftpProtocol::put: put():  KUrl("sftp://root@jupiter.grapevineit.net/var/www/clients/client1/web1/web/sites/all/themes/gv_kbltheme/page.tpl.php")  , permissions =  "-1" , overwrite =  4 , resume =  0
kio_sftp(12893) sftpProtocol::put: Appending .part extension to  "/var/www/clients/client1/web1/web/sites/all/themes/gv_kbltheme/page.tpl.php"
kio_sftp(12893) sftpProtocol::put: Trying to open:  "/var/www/clients/client1/web1/web/sites/all/themes/gv_kbltheme/page.tpl.php.part" , mode= "384"
kio_sftp(12893) sftpProtocol::put: ####################### COULD NOT WRITE  "/var/www/clients/client1/web1/web/sites/all/themes/gv_kbltheme/page.tpl.php.part"  permissions= -1
kio_sftp(12893) sftpProtocol::put: put():  KUrl("sftp://root@jupiter.grapevineit.net/var/www/clients/client1/web1/web/sites/all/themes/gv_kbltheme/page.tpl.php")  , permissions =  "-1" , overwrite =  4 , resume =  0
kio_sftp(12893) sftpProtocol::put: Appending .part extension to  "/var/www/clients/client1/web1/web/sites/all/themes/gv_kbltheme/page.tpl.php"
kio_sftp(12893) sftpProtocol::put: Trying to open:  "/var/www/clients/client1/web1/web/sites/all/themes/gv_kbltheme/page.tpl.php.part" , mode= "384"
kio_sftp(12893) sftpProtocol::put: ####################### COULD NOT WRITE  "/var/www/clients/client1/web1/web/sites/all/themes/gv_kbltheme/page.tpl.php.part"  permissions= -1
Comment 1 maddog75 2010-03-13 21:36:44 UTC
Application/System Versions

Kate 3.4.1
KDE 4.4.1
Linux Mint 8 Helena - KDE64 ( based on Ubuntu Karmic )
Ubuntu Karmic ppa backports to get the latest KDE packages
Comment 2 Andreas Schneider 2010-03-13 21:52:30 UTC
Looking at the log output there was no closeConnection() so the kio still thinks we are still connnected.

It looks like the server closed the connection. How long do you have to wait until the save fails?
Comment 3 maddog75 2010-03-13 21:56:03 UTC
I think you are right, the connection was not closed by the kio slave, but rather by the ssh link failing or the server disconnecting the connection.

The failure message is reported very quickly < 1s
Comment 4 maddog75 2010-03-16 14:49:11 UTC
Where you log sftpProtocol::put: ####################### COULD NOT WRITE 
"/var/www/clients/client1/web1/web/sites/all/themes/gv_kbltheme/page.tpl.php.part"
 permissions= -1
Can you just run sftpProtocol::closeConnection: closeConnection() for good measure and then repeat the put request on a new connection?

Just because it is the IP network or the remote end which has closed the connection still means that the user should not care, just start a new connection and try again would be my solution, but then i never write nice code!
Comment 5 Andreas Schneider 2010-03-17 20:08:41 UTC
Can you test a patch?

http://www.cynapses.org/tmp/patches/kde/look
Comment 6 Samoilenko Yuri 2014-01-12 20:49:17 UTC
(In reply to comment #5)
> Can you test a patch?
> 
> http://www.cynapses.org/tmp/patches/kde/look

What about this patch now?
Comment 7 Andreas Schneider 2014-01-13 12:56:57 UTC
I guess this is already fixed since a long time ...
Comment 8 Andreas Schneider 2018-09-03 05:37:54 UTC
This seems to be fixed at least since 2014.