nextcloud / nextcloud/server

[Bug]: Move or rename incoming shares not possible if a share is in my trash

Open
#51,767 5 comments 1 reaction 1 assignee View on GitHub

@icewind1991 is already working on this.

Since Apr 30, 2025.

1. to develop 31-feedback bug feature: sharing feature: trashbin regression
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ This issue respects the following points: ⚠️
Bug description

If I delete one of my files shared with other, I can no more rename or move other incomming shares.
Run occ sharing:delete-orphan-shares and delete the share resolves the bug

Steps to reproduce
  1. As user1, create a file "one", share it with user2 and delete the file "one"
  2. As user3, create a file "three" and share it with user1
  3. As user1, try to rename or move the file "three" shared by user3: not possible
Expected behavior

It was possible with my previous NC27, but it is not possible with NC30 and NC31 (NC28 and NC29 not tested)

Nextcloud Server version

31

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
Configuration report
{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "upgrade.disable-web": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "127.0.0.1"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "sqlite3",
        "version": "31.0.2.1",
        "overwrite.cli.url": "http:\/\/127.0.0.1",
        "installed": true
    }
}
List of activated Apps
Enabled:
  - activity: 4.0.0
  - app_api: 5.0.2
  - bruteforcesettings: 4.0.0
  - circles: 31.0.0
  - cloud_federation_api: 1.14.0
  - comments: 1.21.0
  - contactsinteraction: 1.12.0
  - dashboard: 7.11.0
  - dav: 1.33.0
  - federatedfilesharing: 1.21.0
  - federation: 1.21.0
  - files: 2.3.1
  - files_downloadlimit: 4.0.0
  - files_pdfviewer: 4.0.0
  - files_reminders: 1.4.0
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - files_versions: 1.24.0
  - firstrunwizard: 4.0.0
  - logreader: 4.0.0
  - lookup_server_connector: 1.19.0
  - nextcloud_announcements: 3.0.0
  - notifications: 4.0.0
  - oauth2: 1.19.1
  - password_policy: 3.0.0
  - photos: 4.0.0-dev.1
  - privacy: 3.0.0
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - recommendations: 4.0.0
  - related_resources: 2.0.0
  - serverinfo: 3.0.0
  - settings: 1.14.0
  - sharebymail: 1.21.0
  - support: 3.0.0
  - survey_client: 3.0.0
  - systemtags: 1.21.1
  - text: 5.0.0
  - theming: 2.6.1
  - twofactor_backupcodes: 1.20.0
  - updatenotification: 1.21.0
  - user_status: 1.11.0
  - viewer: 4.0.0
  - weather_status: 1.11.0
  - webhook_listeners: 1.2.0
  - workflowengine: 2.13.0
Disabled:
  - admin_audit: 1.21.0
  - encryption: 2.19.0
  - files_external: 1.23.0
  - suspicious_login: 9.0.1
  - twofactor_nextcloud_notification: 5.0.0
  - twofactor_totp: 13.0.0-dev.0
  - user_ldap: 1.22.0
Nextcloud Signing status
No errors have been found.
Nextcloud Logs
{"reqId":"EunjDoYiden4OTDt9gx6","level":3,"time":"2025-03-27T19:35:50+00:00","remoteAddr":"192.168.65.1","user":"user1","app":"webdav","method":"MOVE","url":"/remote.php/dav/files/user1/Installation%20GlobalProtect%20_%20Wiki%20DDUNI.pdf","message":"Node for share not found, fileid: 683","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:128.0) Gecko/20100101 Firefox/128.0","version":"31.0.2.1","exception":{"Exception":"OCP\\Files\\NotFoundException","Message":"Node for share not found, fileid: 683","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Files/View.php","line":1896,"function":"getNode","class":"OC\\Share20\\Share","type":"->","args":[]},{"file":"/var/www/html/lib/private/Files/View.php","line":784,"function":"targetIsNotShared","class":"OC\\Files\\View","type":"->","args":["user1","/user1/files/test.pdf"]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Node.php","line":133,"function":"rename","class":"OC\\Files\\View","type":"->","args":["/Installation GlobalProtect _ Wiki DDUNI.pdf","/test.pdf"]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php","line":171,"function":"setName","class":"OCA\\DAV\\Connector\\Sabre\\Node","type":"->","args":["test.pdf"]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":612,"function":"move","class":"Sabre\\DAV\\Tree","type":"->","args":["files/user1/Installation GlobalProtect _ Wiki DDUNI.pdf","files/user1/test.pdf"]},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpMove","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["method:MOVE",[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Server.php","line":49,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/apps/dav/lib/Server.php","line":397,"function":"start","class":"OCA\\DAV\\Connector\\Sabre\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/appinfo/v2/remote.php","line":21,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/remote.php","line":145,"args":["/var/www/html/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/Share20/Share.php","Line":167,"message":"Node for share not found, fileid: 683","exception":[],"CustomMessage":"Node for share not found, fileid: 683"},"id":"67e5a8b0135ab"}
Additional info
  • This bug is not present on fresh docker NC27 with sqlite
  • This bug was not present on my production using NC27 with postgresql
  • This bug is present on fresh docker NC30 with sqlite
  • This bug is present on my production using NC30 with postgresql
  • This bug is present on fresh docker NC31 with sqlite

File with id 683 is the file in the trash of user1:

sqlite> select * from oc_filecache where fileid=683;
+--------+---------+--------------------------------------------------------------+----------------------------------+--------+-------------------------------------------------------+----------+----------+--------+------------+---------------+-----------+------------------+----------------------------------+-------------+----------+
| fileid | storage |                             path                             |            path_hash             | parent |                         name                          | mimetype | mimepart |  size  |   mtime    | storage_mtime | encrypted | unencrypted_size |               etag               | permissions | checksum |
+--------+---------+--------------------------------------------------------------+----------------------------------+--------+-------------------------------------------------------+----------+----------+--------+------------+---------------+-----------+------------------+----------------------------------+-------------+----------+
| 683    | 3       | files_trashbin/files/Capture d’écran 2025-03-21 à 17.56.39.p | 9c680f18db6cc62021d7db5ea1b19068 | 528    | Capture d’écran 2025-03-21 à 17.56.39.png.d1743104121 | 14       | 13       | 662616 | 1742576224 | 1742576224    | 0         | 0                | 385b43ff33facbeebb08cf1a3d445ba1 | 27          |          |
|        |         | ng.d1743104121                                               |                                  |        |                                                       |          |          |        |            |               |           |                  |                                  |             |          |
+--------+---------+--------------------------------------------------------------+----------------------------------+--------+-------------------------------------------------------+----------+----------+--------+------------+---------------+-----------+------------------+----------------------------------+-------------+----------+


sqlite> select * from oc_storages where numeric_id = 3 ;
+------------+-------------+-----------+--------------+
| numeric_id |     id      | available | last_checked |
+------------+-------------+-----------+--------------+
| 3          | home::user1 | 1         |              |
+------------+-------------+-----------+--------------+

Similar issues:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.