Bug 510810

Summary: Dolphin fails to move files to or from FUSE mounts on the first attempt; second and subsequent attempts succeed
Product: [Frameworks and Libraries] frameworks-kio Reporter: OIRNOIR <hi>
Component: generalAssignee: KIO Bugs <kio-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: ad.liu.jin, agurenko, aubert66, deadmeu, dekamir, fabsese, failsafe65, findanotherplace, frederick888, jesusnavarrojr188, kde.sghqi, kde49861515, kdebugs, kdelibs-bugs-null, nate, paul.chaffey, pecunia, zxvb12z
Priority: NOR    
Version First Reported In: 6.19.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.20
Sentry Crash Report:
Attachments: Screenshot of undesired behavior
Move file across ZFS datasets

Description OIRNOIR 2025-10-20 05:35:52 UTC
Created attachment 185911 [details]
Screenshot of undesired behavior

***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***

SUMMARY
Filed under "I don't know" because plasma-vaults was not listed.
Attempting to delete a file from within a plasma vault yields an error message ("Could not rename file") on first try. Deleting the file works on the second try. Additionally, any movement of files in or out of the vault yields a warning/error message in journalctl about failing to rename a file.

STEPS TO REPRODUCE
1. Create a new plasma vault. If it asks for a choice (I don't believe it does anymore), pick gocryptfs.
2. Open dolphin to the vault.
3. Create a new file in the vault, if there isn't already one in there.
4. Open a terminal and type journalctl -xf (just so that we see what gets logged)
5. Right-click on the file in the vault, and select "Move to Trash"

OBSERVED RESULT
- An error appears: "Could not rename file /path/to/Vaults/yourvault/yourfile."
- The file is not deleted.
- A subsequent "Move to Trash" will (sometimes) delete the file.

EXPECTED RESULT
The file is deleted immediately.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.19.0
Qt Version: 6.10.0
Kernel Version: 6.17.3-arch2-1 (64-bit)
Graphics Platform: Wayland
Processors: 22 × Intel® Core™ Ultra 7 155H
Memory: 48 GiB of RAM (46.7 GiB usable)
Graphics Processor: Intel® Arc
Manufacturer: Notebook
Product Name: V54x_6x_TU
System Version: V540TU

ADDITIONAL INFORMATION
Also reproduced this issue on the latest KDE neon Testing Edition ISO. Exactly the same.

The logs from a failed "Move to Trash" look like the below:
```
Oct 20 01:33:50 periwinkle kioworker[22371]: Could not rename file "/home/oirnoir/Vaults/Testing/Text File.txt" to "/home/oirnoir/.local/share/Trash/files/Text File.txt"
Oct 20 01:33:50 periwinkle dolphin[22349]: "Could not rename file /home/oirnoir/Vaults/Testing/Text File.txt."
```

The logs from a successful "Move to Trash", as well as from any movement of files into and out of the plasma vault, look like the following:
```
Oct 20 01:34:26 periwinkle kioworker[22371]: Could not rename file "/home/oirnoir/Vaults/Testing/Text File.txt" to "/home/oirnoir/.local/share/Trash/files/Text File.txt"
Oct 20 01:34:26 periwinkle kioworker[22371]: Could not rename file "/home/oirnoir/Vaults/Testing/Text File.txt" to "/home/oirnoir/.local/share/Trash/files/Text File.txt"
Oct 20 01:34:26 periwinkle kioworker[22371]: copy() QUrl("file:///home/oirnoir/Vaults/Testing/Text File.txt") to QUrl("file:///home/oirnoir/.local/share/Trash/files/Text File.txt") mode= 420
```
When moving a file out of the vault, the logs are the same, except the destination is not .local/share/Trash/files.
Comment 1 OIRNOIR 2025-10-20 05:37:02 UTC
Attempted to file as plasma-vaults instead of Dolphin because this only occurs in plasma-vaults. Could not find a listing in the bug directory for plasma-vaults.
Comment 2 Frederick Zhang 2025-10-20 11:07:56 UTC
Created attachment 185918 [details]
Move file across ZFS datasets

I'm seeing the same symptom moving files across ZFS datasets too.

My home folder and root folder are two separate datasets. When I first move a file across datasets after Dolphin starts, I also see a 'could not rename file' error. It moves the file normally on the second try.

This issue does not happen if the file stays in the same dataset.
Comment 3 Nate Graham 2025-10-20 16:44:50 UTC
I'm not seeing the move to trash issue, but I can reproduce the issue with being unable to move a file *into* a Vault the first time; I get that exact error.

Likely a KIO issue, rather than an issue in Plasma Vaults or Dolphin.
Comment 4 OIRNOIR 2025-10-20 16:54:29 UTC
(In reply to Nate Graham from comment #3)
> I'm not seeing the move to trash issue, but I can reproduce the issue with
> being unable to move a file *into* a Vault the first time; I get that exact
> error.
> 
> Likely a KIO issue, rather than an issue in Plasma Vaults or Dolphin.

I'm surprised that you can't reproduce the trash issue, but after trying, I can confirm that I also experience the issue moving files into a Vault. Thanks for working on this!
Comment 5 Nate Graham 2025-10-21 15:27:17 UTC
*** Bug 510856 has been marked as a duplicate of this bug. ***
Comment 6 OIRNOIR 2025-10-24 12:22:39 UTC
Just updated, can reproduce in Plasma 6.5

Operating System: Arch Linux 
KDE Plasma Version: 6.5.0
KDE Frameworks Version: 6.19.0
Qt Version: 6.10.0
Kernel Version: 6.17.4-arch2-1 (64-bit)
Graphics Platform: Wayland
Processors: 22 × Intel® Core™ Ultra 7 155H
Memory: 48 GiB of RAM (46.7 GiB usable)
Graphics Processor: Intel® Arc
Manufacturer: Notebook
Product Name: V54x_6x_TU
System Version: V540TU
Comment 7 Bug Janitor Service 2025-10-24 16:36:35 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/2033
Comment 8 Méven 2025-10-24 17:10:03 UTC
Git commit 381582d3ff17fb52bc8133d266611eba2d94491d by Méven Car.
Committed on 24/10/2025 at 16:40.
Pushed by meven into branch 'master'.

file_unix: print errnum in rename when failing

To be able to diagnose issues, the files are not very relevant.
The errno should tell us a lot more about what is the error.

M  +8    -4    src/kioworkers/file/file_unix.cpp

https://invent.kde.org/frameworks/kio/-/commit/381582d3ff17fb52bc8133d266611eba2d94491d
Comment 9 Jin Liu 2025-10-25 14:40:28 UTC
Funny thing is, this bug only happens to me when Dolphin is launched via GUI. When launched from terminal, it works fine.

In the first case, system journal only has:

dolphin[171046]: Could not rename file "/home/jin/Downloads/a" to "/mnt/shared/a"

While in the latter case, the terminal has:
kf.kio.workers.file: Could not rename file "/home/jin/Downloads/a" to "/mnt/shared/a"
kf.kio.workers.file: Could not rename file "/home/jin/Downloads/a" to "/mnt/shared/a"
kf.kio.workers.file: copy() QUrl("file:///home/jin/Downloads/a") to QUrl("file:///mnt/shared/a") mode= 420

And the target dir is not a FUSE mount, but a kernel ntfs3 mount.
Comment 10 kmdest 2025-10-25 18:44:46 UTC
Can confirm on Cachyos,
Dolphin: 25.08.2
KDE Frameworks: 6.19.0
Qt: Using 6.10.0 and built against 6.10.0
CachyOS (Xcb)
Build ABI: x86_64-little_endian-lp64
Kernel: linux 6.17.5-2-cachyos
Comment 11 llama 2025-10-27 19:48:39 UTC
Can confirm on Bazzite. Not using plasma vaults.

The source file to be trashed is on a different BTRFS partition (but same drive) than where the trash location is (also BTRFS). Also occurs with functions like "Extract here and delete archive" where the directories and files are created as expected, but then it fails to delete the original archive erroring with the same popup.

Operating System: Bazzite 42
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.19.0
Qt Version: 6.9.2
Kernel Version: 6.16.4-116.bazzite.fc42.x86_64 (64-bit)
Comment 12 failsafe65 2025-10-29 03:25:04 UTC
I get the same error when trying to move things between different drives with shift drag.
It seems to be related to the first change in this commit https://invent.kde.org/system/dolphin/-/commit/22010186.
If I change line 67 in "src/kitemviews/kitemlistcontroller.cpp" back to "m_autoActivationTimer->setInterval(-1);" the problem goes away.
Comment 13 Jayes 2025-10-29 15:24:26 UTC
Just installed Fedora 43 and I get this as well. Fails the first time, proceeds the next time.
Comment 14 Nate Graham 2025-10-30 16:45:02 UTC
*** Bug 511213 has been marked as a duplicate of this bug. ***
Comment 15 Nate Graham 2025-11-05 14:39:47 UTC
With the last few days' git master, this hasn't been happening to me anymore. I can no longer reproduce it in any of the cases where I could before.
Comment 16 owltropicalastronaut 2025-11-08 19:30:43 UTC
I am experiencing this on Bazzite 43.20251029. I am moving files from a secondary drive to the primary drive. Both drives are btrfs. Error happens on initial move, but all subsequent moves succeed.
Comment 17 zxvb12z 2025-11-18 15:18:37 UTC
looks like updating kde framework to version 6.20 fixed this issue someone else checked it?
Comment 18 Jayes 2025-11-18 16:14:34 UTC
On Fedora 43 I now have KDE frameworks 6.20.0 and, indeed, the problem does appear to be solved.
Comment 19 Riccardo Robecchi 2025-11-23 23:21:04 UTC
*** Bug 511658 has been marked as a duplicate of this bug. ***
Comment 20 Riccardo Robecchi 2025-11-23 23:21:07 UTC
*** Bug 511408 has been marked as a duplicate of this bug. ***