[regression 14.10->15.04] Kate can no longer edit files over ftp

Bug #1449731 reported by Tony Middleton
30
This bug affects 4 people
Affects Status Importance Assigned to Milestone
kate
Fix Released
High
kate (Arch Linux)
New
Undecided
Unassigned
kate (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Since upgrading to 15.04 I cannot edit files accessed over ftp. The file appears to open but I end up with a blank file. This worked fine on earlier releases.

There are a number of reports of this on the Internet. As documented elsewhere I can get round the problem by editing file

/usr/share/applications/org.kde.kate.desktop

and removing %U from the "Exec=" line.

Don't know whether this has any negative impacts.

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: kate 4:14.12.3-0ubuntu2 [modified: usr/share/applications/org.kde.kate.desktop]
ProcVersionSignature: Ubuntu 3.19.0-15.15-generic 3.19.3
Uname: Linux 3.19.0-15-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 2.17.2-0ubuntu1
Architecture: amd64
CurrentDesktop: KDE
Date: Tue Apr 28 20:28:03 2015
InstallationDate: Installed on 2014-04-19 (373 days ago)
InstallationMedia: Kubuntu 14.04 LTS "Trusty Tahr" - Release amd64 (20140416.1)
ProcEnviron:
 LANGUAGE=en_GB:en
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: kate
UpgradeStatus: Upgraded to vivid on 2015-04-25 (3 days ago)

Revision history for this message
In , Martynas-stropa (martynas-stropa) wrote :

After starting Dolphin and logging-in to an FTP server using Kwallet, I tried editing a remote file with Kate, like I've been doing for many years now, Kate asked to migrate the kwallet to a newer version. That seemed to go smoothly, but whenever a remote file is loaded it is displayed empty. I've tried restarting, using another FTP server, etc. Nothing helped. Is there something I need to set up first to make it work or something? There are no errors or warnings. I'm using Arch Linux x64.
Kate version: 5.0.0

Also, what I noticed is that when opening a remote file, temporary file in /tmp is created like "katepartTJ3018.php" and alongside "katepartTJ3018.php.part". The .part file has all the needed contents in it, however the non .part file stays empty.

Saving an opened remote file works file and file gets uploaded.

Reproducible: Always

Steps to Reproduce:
1. Open Dolphin
2. Navigate to FTP server
3. Open file

Actual Results:
Files is opened empty

Expected Results:
File opened with actual file content

Tmmporary file in /tmp is created like "katepartTJ3018.php" and alongside "katepartTJ3018.php.part". The .part file has all the needed contents in it, however the non .part file stays empty.

Revision history for this message
In , Martynas-stropa (martynas-stropa) wrote :

kdesdk-kioslaves 14.12.1-1 and kio-extras 5.1.2-1 installed.

Revision history for this message
In , JIghtuse (jightuse) wrote :

I can't reproduce it. I've successfully opened a few files on GNU FTP (ftp://ftp.gnu.org/) server in Dolphin (README, welcome.msg).

Revision history for this message
In , Alain-1 (alain-1) wrote :

Tested with a text file on a FTP server (vsftpd) : it doesn't work with Kate and KWrite, but I can open this remote file with Okular.

Revision history for this message
In , Michal-humpula-6 (michal-humpula-6) wrote :

As far as I know, the okular is still kde4 based. It might be some issue with kio/kio_ftp for KF5. I can replicate the issue even with the raw kioexec client:

```
lib/x86_64-linux-gnu/libexec/kf5/kioexec cat ftp://ftp.gnu.org/README
```

Revision history for this message
In , Alain-1 (alain-1) wrote :

Like Michal, I try this command :

alain@Ordi:~$/usr/lib/kf5/kioexec cat ftp://ftp.gnu.org/README
QCommandLineParser: option not defined: "suggestedfilename"
command= "cat" args= ("cat", "ftp://ftp.gnu.org/README")
kf5.kjobwidgets: kuiserver found
Copying QUrl( "ftp://ftp.gnu.org/README" ) to QUrl( "file:///home/alain/.cache/kioexec/krun/6890_0_README" )
kf5.kservice.sycoca: Trying to open ksycoca from "/home/alain/.cache/ksycoca5"
Calling notify on "Sound"
Changing audio state from Phonon::LoadingState to Phonon::StoppedState
Calling notify on "Taskbar"
0 60817413
Changing audio state from Phonon::LoadingState to Phonon::StoppedState
Changing audio state from Phonon::StoppedState to Phonon::PausedState
Changing audio state from Phonon::PausedState to Phonon::PlayingState
Changing audio state from Phonon::PlayingState to Phonon::StoppedState
Closing notification 1
not found dbus id to close 1
All files downloaded, will call slotRunApp shortly
No files downloaded -> exiting

A popup window appear with this error message : "Could not write to /home/alain/.cache/kioexec/krun/6890_0_README."

The directory /home/alain/.cache/kioexec/krun/ is missing, I create it. And I try again. A new popup window appear with this error message : "Could not rename partial file /home/alain/.cache/kioexec/krun/6537_0_README.
Please check permissions."

I set permissions of /home/alain/.cache/kioexec and /home/alain/.cache/kioexec/krun to 777 and the same error message appear.

I remove /home/alain/.cache/kioexec directory and I try with HTTP and I was this error message : "Access denied.
Could not write to /home/alain/.cache/kioexec/krun/7840_0_.part."

I create /home/alain/.cache/kioexec/krun without specific permission and it works well :

alain@Ordi:~$/usr/lib/kf5/kioexec cat http://example.com
QCommandLineParser: option not defined: "suggestedfilename"
command= "cat" args= ("cat", "http://example.com")
kf5.kjobwidgets: kuiserver found
kf5.kservice.sycoca: Trying to open ksycoca from "/home/alain/.cache/ksycoca5"
Copying QUrl( "http://example.com/" ) to QUrl( "file:///home/alain/.cache/kioexec/krun/7599_0_" )
All files downloaded, will call slotRunApp shortly
EXEC "/usr/bin/cat /home/alain/.cache/kioexec/krun/7599_0_"
<!doctype html>
<html>
<head>
    <title>Example Domain</title>
[...]
</html>
EXEC done
sleeping...
^C

It works well with "/usr/lib/kde4/libexec/kioexec cat ftp://ftp.gnu.org/README".

Revision history for this message
In , Lê Hoàng Phương (herophuong93) wrote :

My error is a different to the case above. The message is:

/home/herop/.cache/kioexec/krun/8682_0_README is a folder, but a file was expected.

I have a look at the krun folder and indeed, the 8682_0_README is a folder instead of a file. Here is the log:

QCommandLineParser: option not defined: "suggestedfilename"
command= "cat" args= ("cat", "ftp://ftp.gnu.org/README")
kf5.kjobwidgets: kuiserver found
kf5.kiconthemes: "Theme tree: (Breeze)"
Copying QUrl( "ftp://ftp.gnu.org/README" ) to QUrl( "file:///home/herop/.cache/kioexec/krun/8682_0_README" )
kf5.kservice.sycoca: Trying to open ksycoca from "/home/herop/.cache/ksycoca5"
Calling notify on "Sound"
Changing audio state from Phonon::LoadingState to Phonon::StoppedState
Calling notify on "Taskbar"
0 153092101
Changing audio state from Phonon::LoadingState to Phonon::StoppedState
Changing audio state from Phonon::StoppedState to Phonon::PausedState
Changing audio state from Phonon::PausedState to Phonon::PlayingState
Changing audio state from Phonon::PlayingState to Phonon::StoppedState
Closing notification 1
not found dbus id to close 1
All files downloaded, will call slotRunApp shortly
No files downloaded -> exiting
QCoreApplication::postEvent: Unexpected null receiver

Revision history for this message
In , Kde-n (kde-n) wrote :

Another confirmation for this bug from my site, using Arch Linux with latest (Kate 5.0.0, packet kate-14.12.3-1, Frameworks 5.8.0, QT 5.4.1) from Testing repo.

Trying with kioexec I get the error as described in #6 with "is a folder instead of a file".

While it is not possible to edit files over FTP there is no problem with files
over sftp! So it seems no generall problem with remote files but with ftp.

Another finding: I monitored the server logs while opening the file and the file is actually transfered, but not displayed. Opening the file directly in Kate (Using open file, navigate to ftp://server) has the same effect.

Revision history for this message
In , Bugs-kde-q (bugs-kde-q) wrote :

Kubunta 15.04 (KDE 5.9.0, Kate 5.0.0), I am seeing this issue. Open remote directory via FTP (shared web hosting service), attempt to open a file in the remote directory (Open with... Kate), file appears empty in the Kate window. The same file opens normally in Okular, but appears to cause an endless authentication loop in Libre.

This worked as expected in Kubuntu 14.10.

Revision history for this message
Tony Middleton (ximera) wrote :
Revision history for this message
In , Gregory-f (gregory-f) wrote :

I have also Kubuntu 15.04, after updating (from 14.10) I see the same problem. (It wasn't before.)
If I open a remote FTP directory in Dolphin, then try to open a file with Kate, there is an empty page. But if I write something and save, it overwrites the remote file. So it seems, it just can't load the content, but besides it works.
If I open an SSH directory, everything works fine. So I think, the problem must be somewhere at FTP.

I installed Bluefish editor too, just for test. If I open a file from Dolphin, the same result. But if I open a file in Bluefish (File/Open URL) from ftp, then I can see the folder tree and files, and I can open and edit. But with Dolphin and Kate it were much more comfortable for me, so I hope this bug will be fixed.

Revision history for this message
In , Charalampos Tampakopoulos (ctampak) wrote :

In my case using in my laptop also Kubuntu 15.04, after upgrading from 14.10 and in two other computers using 15.04 clean installation, I am unable to even see the remote locations added by dolphin. I have tried both ftp and sftp locations, and both have the same problem.

If I try to open the file from dolphin, dolphin freezes and kate displays a white page as all the others mentioned before me.

For local files everything seems to work just fine.

Revision history for this message
In , JIghtuse (jightuse) wrote :

Git commit b290473167b9d0388715fffe494ee95a5c2c2851 by Boris Egorov.
Committed on 02/05/2015 at 10:47.
Pushed by egorov into branch 'master'.

Fix path for writable location for kurl (kioexec)

There was a porting issue with this code:
QStandardPaths::writableLocation do not creates a directory [1], so we
need QDir::mkpath. Commit ff412e0bd3ba54 tried to fix it, but it gone
too far: we need to create directory only up to "/krun/", strings after
that is filename. So we were creating directory instead of file,
confusing some apps. For example, kate [2].

New behavior was tested by removing CacheLocation, and it successfully
creates needed path.

    1: http://doc.qt.io/qt-5/qstandardpaths.html#writableLocation
    2: https://bugs.kde.org/show_bug.cgi?id=343329
Related: bug 342732
REVIEW: 123589
CHANGELOG: kioexec: Fixed path for writeable location for kurl

M +3 -3 src/kioexec/main.cpp

http://commits.kde.org/kio/b290473167b9d0388715fffe494ee95a5c2c2851

Revision history for this message
In , JIghtuse (jightuse) wrote :

Git commit e5c3f7eda489ee22c2f9f266884faa43f444f03c by Boris Egorov.
Committed on 02/05/2015 at 10:47.
Pushed by egorov into branch 'master'.

ftp slave: Fix conditions for QFile::rename

QFile::rename returns true on success[1], so code should treat it
appropriately. Previously code shows an error when all worked fine.

    1: http://doc.qt.io/qt-5/qfile.html#rename
REVIEW: 123590
CHANGELOG: ftp slave: Fix conditions for QFile::rename

M +2 -2 src/ioslaves/ftp/ftp.cpp

http://commits.kde.org/kio/e5c3f7eda489ee22c2f9f266884faa43f444f03c

Revision history for this message
In , Alain-1 (alain-1) wrote :

Fix confirmed on ArchLinux with package kio 5.10.0.

Thanks a lot!

Revision history for this message
Tony Middleton (ximera) wrote :

I've now done a clean install of Kubuntu 15.04 and Kate now works fine over ftp without any special action.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in kate (Ubuntu):
status: New → Confirmed
tags: added: regression-release
summary: - Kate cannot edit files over ftp
+ [regression 14.10->15.04] Kate can no longer edit files over ftp
Changed in kate (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Gilles Turgeon (turgeon-9) wrote :

" ... and removing %U from the "Exec=" line..."

It's ok for opening the file. But when you save the file, the modification affects only the clocal copy of the files, not the orginal one on ftp site. The file on ftp site is updated when kate close.

Revision history for this message
Krzysztof Pyrkosz (pyrkosz) wrote :

It is probably upstream bug fixed in kio 5.10.0.
https://bugs.kde.org/show_bug.cgi?id=343329
Please, prepare it for upgrade ASAP, thanks.

Changed in kate:
importance: Unknown → High
Revision history for this message
In , JIghtuse (jightuse) wrote :

This bug appears to be fixed. Feel free to reopen this bug if you notice such behavior.

Changed in kate:
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.