<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>518012</bug_id>
          
          <creation_ts>2026-03-22 19:06:33 +0000</creation_ts>
          <short_desc>Trash not working with systemd-automount (possible regression)</short_desc>
          <delta_ts>2026-06-04 17:30:56 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>Frameworks and Libraries</classification>
          <product>frameworks-kio</product>
          <component>Trash</component>
          <version>6.24.0</version>
          <rep_platform>Arch Linux</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.kde.org/show_bug.cgi?id=517795</see_also>
    
    <see_also>https://bugs.kde.org/show_bug.cgi?id=515582</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>regression</keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Arnab Bose">hirak99</reporter>
          <assigned_to name="KIO Bugs">kio-bugs-null</assigned_to>
          <cc>bnerickson87</cc>
    
    <cc>kde</cc>
    
    <cc>kdedev</cc>
    
    <cc>kdelibs-bugs-null</cc>
    
    <cc>nate</cc>
    
    <cc>oliver.schramm97</cc>
    
    <cc>patrickgianelli</cc>
    
    <cc>s+kde</cc>
    
    <cc>sitter</cc>
    
    <cc>voidpointertonull+bugskdeorg</cc>
          
          <cf_commitlink>https://invent.kde.org/frameworks/kio/-/commit/90539e742a1fbc89702645d0ebf372a7e534357b</cf_commitlink>
          <cf_versionfixedin>6.27</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2505419</commentid>
    <comment_count>0</comment_count>
    <who name="Arnab Bose">hirak99</who>
    <bug_when>2026-03-22 19:06:33 +0000</bug_when>
    <thetext>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(&quot;file:///mnt/drive/test_file.txt&quot;) QUrl(&quot;trash:/test_file.txt&quot;)
kf.kio.workers.trash: &quot;/mnt/drive/test_file.txt&quot; is on a pseudofs: &quot;autofs&quot;
```

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 -
&quot;The trash is not available for this item&apos;s location. Permanently delete instead?&quot;

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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2505424</commentid>
    <comment_count>1</comment_count>
    <who name="Arnab Bose">hirak99</who>
    <bug_when>2026-03-22 19:20:29 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2505553</commentid>
    <comment_count>2</comment_count>
    <who name="Harald Sitter">sitter</who>
    <bug_when>2026-03-23 14:08:35 +0000</bug_when>
    <thetext>Moving to kio, where the trash worker lives.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2507759</commentid>
    <comment_count>3</comment_count>
    <who name="Patrick Gianelli">patrickgianelli</who>
    <bug_when>2026-04-03 01:14:34 +0000</bug_when>
    <thetext>I can pile on to this to confirm it&apos;s not working for me either. The error I get when trying to delete is:

`kf.kio.workers.trash: Creating trash for &quot;/&quot; 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)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2507764</commentid>
    <comment_count>4</comment_count>
    <who name="Patrick Gianelli">patrickgianelli</who>
    <bug_when>2026-04-03 01:58:47 +0000</bug_when>
    <thetext>(In reply to Patrick Gianelli from comment #3)
&gt; I can pile on to this to confirm it&apos;s not working for me either. The error I
&gt; get when trying to delete is:
&gt; 
&gt; `kf.kio.workers.trash: Creating trash for &quot;/&quot; failed - no permission?`
&gt; 
&gt; This is a SMB mount, so it appears that autofs trash is just broken as a
&gt; whole now.
&gt; 
&gt; Dolphin version: 25.12.3
&gt; KDE Plasma Version: 6.6.3
&gt; KDE Frameworks Version: 6.24.0
&gt; Qt Version: 6.11.0
&gt; 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2520055</commentid>
    <comment_count>5</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2026-06-02 14:08:20 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/2253</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2520501</commentid>
    <comment_count>6</comment_count>
    <who name="Méven">meven</who>
    <bug_when>2026-06-04 08:33:20 +0000</bug_when>
    <thetext>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 &apos;master&apos;.

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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2520583</commentid>
    <comment_count>7</comment_count>
    <who name="Oliver Schramm">oliver.schramm97</who>
    <bug_when>2026-06-04 11:40:27 +0000</bug_when>
    <thetext>*** Bug 517795 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>