Delete's fail on 27 because of hash/poundsign

Nextcloud version : 27.0.0
Operating system and version : Rocky 8
Apache or nginx version : nginx 1.14.1-9
PHP version: 8.0.27

The issue you are facing:
I don’t recall this ever being a problem before so I’m wondering if it’s me or Nextcloud 27 or something to do with the fact that I just haven’t had time to deal with another PHP upgrade. :weary:

The short version, any files with a pound sign fail to be deleted. So $insert_annoyance_here people who keep putting hashtags inside file names… :rage: Anyway, yeah. They can’t delete their files anymore…

Is this the first time you’ve seen this error? Y

Steps to replicate it:

cd Nextcloud
echo 1 > 'this txt file has a pound sign here # before the.txt'
<wait for it to sync to Nextcloud>
rm 'this txt file has a pound sign here # before the.txt'

Now go to the Nextcloud web interface into the recycling and delete the file.
"Delete permanently" failed on some elements

Check the log and see something like this (trimming the json to the important bit):

{
        "file": "/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php",
        "line": 178,
        "function": "getNodeForPath",
        "class": "Sabre\\DAV\\Tree",
        "type": "->",
        "args": [
          "trashbin/stack/trash/this txt file has a pound sign here "
        ]
      },

Notice that the file name is truncated. :confounded:

I haven’t figured out how to delete these files yet. Thought I’d ask the community for thoughts/ideas on if this is something I’m doing wrong.
Thanks!

1 Like

Oh. Of course I just now find this after I post. :laughing:
occ trashbin:cleanup <username>

However, there’s still something still weird about not being able to delete from the UI.

1 Like