Bug 518012 - Trash not working with systemd-automount (possible regression)
Summary: Trash not working with systemd-automount (possible regression)
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Trash (other bugs)
Version First Reported In: 6.24.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords: regression
: 517795 (view as bug list)
Depends on:
Blocks:
 
Reported: 2026-03-22 19:06 UTC by Arnab Bose
Modified: 2026-06-04 17:30 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.27
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arnab Bose 2026-03-22 19:06:33 UTC
SUMMARY

Dolphin is unable to trash files on fs mounted using systemd-automount.
I suspect this is a recent regression, since this used to work.

I tested for ext4 and btrfs, not working for either.

I suspect this commit could have caused it -

https://invent.kde.org/frameworks/kio/-/commit/5e98d7d0fe8a2b0c80ed450193ffcbd2c95378d6#cb540eb235d7edff046e2fb76b1e3148c4ec9ef7_992_946

Since the error log says the following -
```
kf.kio.workers.trash: trashing a file QUrl("file:///mnt/drive/test_file.txt") QUrl("trash:/test_file.txt")
kf.kio.workers.trash: "/mnt/drive/test_file.txt" is on a pseudofs: "autofs"
```

STEPS TO REPRODUCE
1. Mount a drive with automount, e.g. 
```
# /etc/fstab
/dev/mapper/luksdev /mnt/drive ext4 defaults,x-systemd.automount 0 2
```
2. Try to delete a file from Dolphin.

OBSERVED RESULT
Dolphin asks to delete permanently -
"The trash is not available for this item's location. Permanently delete instead?"

EXPECTED RESULT
The file should be trashed.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
KDE Plasma Version: 6.6.3
KDE Frameworks Version: 6.24.0
Qt Version: 6.10.2

ADDITIONAL INFORMATION
The .Trash-UID directory exists with correct permissions.
The `trash` cli works.
Comment 1 Arnab Bose 2026-03-22 19:20:29 UTC
To clarify, it used to work with ext4 and xfs. I do not recall specifically if it worked for btrfs.

Now it no longer works for ext4, xfs, or btrfs when auto mounted.
Comment 2 Harald Sitter 2026-03-23 14:08:35 UTC
Moving to kio, where the trash worker lives.
Comment 3 Patrick Gianelli 2026-04-03 01:14:34 UTC
I can pile on to this to confirm it's not working for me either. The error I get when trying to delete is:

`kf.kio.workers.trash: Creating trash for "/" failed - no permission?`

This is a SMB mount, so it appears that autofs trash is just broken as a whole now.

Dolphin version: 25.12.3
KDE Plasma Version: 6.6.3
KDE Frameworks Version: 6.24.0
Qt Version: 6.11.0
Kernel Version: 6.19.10-1-cachyos (64-bit)
Comment 4 Patrick Gianelli 2026-04-03 01:58:47 UTC
(In reply to Patrick Gianelli from comment #3)
> I can pile on to this to confirm it's not working for me either. The error I
> get when trying to delete is:
> 
> `kf.kio.workers.trash: Creating trash for "/" failed - no permission?`
> 
> This is a SMB mount, so it appears that autofs trash is just broken as a
> whole now.
> 
> Dolphin version: 25.12.3
> KDE Plasma Version: 6.6.3
> KDE Frameworks Version: 6.24.0
> Qt Version: 6.11.0
> Kernel Version: 6.19.10-1-cachyos (64-bit)

Potentially this change is at fault:
https://invent.kde.org/frameworks/kio/-/commit/5e98d7d0fe8a2b0c80ed450193ffcbd2c95378d6

It *might* explain why KIO is trying to make a .trash folder at root instead of at /mnt/Folder/.trash-1000
Comment 5 Bug Janitor Service 2026-06-02 14:08:20 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/2253
Comment 6 Méven 2026-06-04 08:33:20 UTC
Git commit 90539e742a1fbc89702645d0ebf372a7e534357b by Méven Car, on behalf of Oliver Schramm.
Committed on 04/06/2026 at 08:17.
Pushed by meven into branch 'master'.

kmountpoint: Iterate mountpoint backwards to handle systemd-automount

When using systedm-automount it results in two entries
in mountinfo for the same path. autofs and the actual fs.
The actual fs appears AFTER the automount, which is why
using backward iterators in libmount is usually the
default.

Because autofs is a pseudofs for which trash is not
available, we want to rather have the actual fs.
Also, this way findByPath will return the expected result.

M  +1    -1    src/core/kmountpoint.cpp

https://invent.kde.org/frameworks/kio/-/commit/90539e742a1fbc89702645d0ebf372a7e534357b
Comment 7 Oliver Schramm 2026-06-04 11:40:27 UTC
*** Bug 517795 has been marked as a duplicate of this bug. ***