Bug 388025 - Failed to create backup copy
Summary: Failed to create backup copy
Status: RESOLVED UPSTREAM
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-19 03:16 UTC by MountainX
Modified: 2018-11-24 05:24 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description MountainX 2017-12-19 03:16:26 UTC
Version 17.12.0
Arch Linux (fully updated)

To reproduce:
Kate Settings > Open/Save > Advanced tab
Under "Backup on Save" check local files and remote files. Apply. 
All other settings can be default.

Mount an SSHFS share. Save a file to that location. After saving it, attempt to modify it and save it again (which will cause Kate to produce a backup file). (You may need to close it and reopen the file before modifying. But I'm not sure about that step.)

Expected result:

File is saved, backup copy is made and no error messages are producted.

Actual result - error message shown next:

Failed to create backup copy. -- Kate

For file /home/user/documents/test.txt no backup copy 
could be created before saving. 
If an error occurs while saving, you might lose the 
data of this file. 
A reason could be that the media you write to is full 
or the directory of the file is read-only for you.

[Try to Save Nevertheless]
[Cancel]

I checked permissions and disk space. Both are fine. Permissions have not changed, my user owns the file and the containing directory and has rw permissions. I'm using only about 2% of the space on the device.

Other editors (e.g., nano) work normally. If I disable creating backups in Kate settings, Kate works normally and I do not receive any error messages.

On my systems that are still running Kate 17.08.3, saving to the SSHFS mounts works as expected with backups. The problem happens when Kate is upgraded from 17.08.3 to 17.12.0 with no other changes to SSHFS or anything else (as far as I can tell - of course, the Kate upgrade comes with a lot of other packages too, so I cannot rule out some other component as being the cause of of issue).
Comment 1 bugreporter11 2017-12-21 00:53:06 UTC
I'm seeing the same behavior on several systems. After upgrading to Kate 17.12.0, each machine produces this error if backups are enabled in Kate settings.
Comment 2 Jim S 2017-12-21 19:05:19 UTC
I can confirm this bug. An update from Kate 17.08.3 to Kate 17.12.0 triggers the error on creating the backup file. I'm also on Arch.
Comment 3 Dominik Haumann 2017-12-21 19:22:34 UTC
The only change I can find is this one:
- https://bugs.kde.org/show_bug.cgi?id=377373
- https://cgit.kde.org/ktexteditor.git/commit/?id=f34b10f77be12c748afaf020581a678b7293525e

If you revert this change, does it work for you again?
Comment 4 MountainX 2017-12-21 20:23:31 UTC
(In reply to Dominik Haumann from comment #3)
> The only change I can find is this one:
> - https://bugs.kde.org/show_bug.cgi?id=377373
> -
> https://cgit.kde.org/ktexteditor.git/commit/
> ?id=f34b10f77be12c748afaf020581a678b7293525e
> 
> If you revert this change, does it work for you again?

For me, this change occurred on the update from Kate 17.08.3 to Kate 17.12.0. @Dominik, the changes you reference are much older. They were already present in Kate 17.08.3, which does not have the bug.

I am happy to provide additional information if you tell me what to send. I'm not a developer and I do not have developer tools installed. But I can send logs or run specific tests. Thank you.
Comment 5 MountainX 2017-12-21 20:33:06 UTC
(In reply to Dominik Haumann from comment #3)
> The only change I can find is this one:
> - https://bugs.kde.org/show_bug.cgi?id=377373
> -
> https://cgit.kde.org/ktexteditor.git/commit/
> ?id=f34b10f77be12c748afaf020581a678b7293525e
> 
> If you revert this change, does it work for you again?

On my system running Kate 17.12.0 (where making the backup copy fails), testing Kate's "Save Copy As..." feature works as expected. The copy has the correct permissions and no errors are produced. I would say that's not related to this issue.
Comment 6 MountainX 2017-12-22 04:47:14 UTC
Kate 17.08.3 is able to save files to SSHFS mounts and make the backup copy when that option is enabled.

Starting with Kate 17.12.0, when the "backup on save" option is enabled, Kate produces an error dialog and fails to make the backup copy on save.

In an effort to isolate this, I started with an Arch Linux system that had not been updated in about two weeks. It was running Kate 17.08.3 and making backup copies on saving files to SSHFS mounts was working correctly.

I attempted to upgrade only Kate from 17.08.3 to 17.12.0. However, that is not possible, as Kate 17.12.0 requires a new version of qt5-base and a number of other components. I'm running Arch Linux, and Arch doesn't support partial upgrades anyway. 

So I am forced to do a full system update in order to move from Kate 17.08.3 to 17.12.0. But when I do that upgrade, Kate 17.12.0 fails to be able to make backup copies on saving the file.

The problem also happens in the latest version of KWrite. However, KWrite does not produce the error dialog. It fails silently (not a good thing when this means that your expected backup copies simply are not made).
Comment 7 Ahmad Samir 2018-11-24 05:24:23 UTC
This was an sshfs upstream bug, that's already been fixed in sshfs-3.5:
https://github.com/libfuse/sshfs/commit/b5d14843143fc8ca6d2e46e1e0dd14b5f1e6ba12#diff-a136a3ab0403c35496be1955335be9d9