Skip to content

[Bug]: Error while renaming a file by a shared user #57919

@nabim777

Description

@nabim777

⚠️ This issue respects the following points: ⚠️

Bug description

When a file is shared and reshared, a user who didn’t upload it (e.g., user2) can’t rename it and gets an error. The file doesn’t rename right away, but after reloading the page, the file got renamed.

Network Log:

Here’s the browser error log when trying to rename the file.
Image

Steps to reproduce

  1. As a user user1, upload a file named file.txt.
  2. As a user user1, share the file file.txt with user2.
  3. As a user user2, share the file file.txt with user3.
  4. When as a user2, try to rename the file file.txt to rename.txt.

Expected behavior

The file should be renamed from file.txt to rename.txt successfully.

Nextcloud Server version

Nextcloud Hub 26 Winter (33.0.0 RC2)

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

None

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

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "debug": true,
        "profiler": true,
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            },
            {
                "path": "\/var\/www\/html\/apps-shared",
                "url": "\/apps-shared",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/apps-writable",
                "url": "\/apps-writable",
                "writable": true
            }
        ],
        "allow_local_remote_servers": true,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "1025",
        "skeletondirectory": "\/skeleton",
        "setup_create_db_user": false,
        "loglevel": 2,
        "log_query": false,
        "query_log_file": "\/shared\/log\/querylog-nextcloud.log",
        "query_log_file_requestid": "yes",
        "diagnostics.logging": false,
        "diagnostics.logging.threshold": 0,
        "log.condition": {
            "apps": [
                "diagnostics",
                "admin_audit"
            ]
        },
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "nextcloud.local",
            "nextcloud.local",
            "172.19.0.8",
            "localhost"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "33.0.0.13",
        "overwrite.cli.url": "https:\/\/nextcloud.local",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "updater.release.channel": "git",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "lookup_server": "",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "user_oidc": {
            "oidc_provider_bearer_validation": true
        }
    }
}

List of activated Apps

Enabled:
  - cloud_federation_api: 1.17.0
  - comments: 1.23.0
  - contactsinteraction: 1.14.1
  - dashboard: 7.13.0
  - dav: 1.36.0
  - federatedfilesharing: 1.23.0
  - federation: 1.23.0
  - files: 2.5.0
  - files_reminders: 1.6.0
  - files_sharing: 1.25.2
  - files_trashbin: 1.23.0
  - files_versions: 1.26.0
  - groupfolders: 21.0.2
  - lookup_server_connector: 1.21.0
  - oauth2: 1.21.0
  - oidc: 1.15.0
  - profile: 1.2.0
  - provisioning_api: 1.23.0
  - settings: 1.16.0
  - sharebymail: 1.23.0
  - systemtags: 1.23.0
  - theming: 2.8.0
  - twofactor_backupcodes: 1.22.0
  - updatenotification: 1.23.0
  - user_oidc: 8.3.0
  - user_status: 1.13.0
  - weather_status: 1.13.0
  - webhook_listeners: 1.5.0
  - workflowengine: 2.15.0
Disabled:
  - admin_audit: 1.23.0
  - encryption: 2.21.0
  - files_external: 1.25.1
  - integration_openproject: 3.0.0-alpha.1 (installed 3.0.0-alpha.1)
  - testing: 1.23.0
  - user_ldap: 1.24.0

Nextcloud Signing status

Nextcloud Logs

    "File": "/var/www/html/lib/private/Share20/Manager.php",
    "Line": 244,
    "Hint": "Cannot increase permissions of ",
    "message": "Uncaught exception",
    "exception": "{\"class\":\"OCP\\Share\\Exceptions\\GenericShareException\",\"message\":\"Cannot increase permissions of \",\"code\":404,\"file\":\"/var/www/html/lib/private/Share20/Manager.php:244\",\"trace\":\"#0 /var/www/html/lib/private/Share20/Manager.php(776): OC\\Share20\\Manager->generalCreateChecks(Object(OC\\Share20\\Share), true)\\n#1 /var/www/html/apps/files_sharing/lib/Updater.php(120): OC\\Share20\\Manager->updateShare(Object(OC\\Share20\\Share), false)\\n#2 /var/www/html/apps/files_sharing/lib/Updater.php(26): OCA\\Files_Sharing\\Updater::moveShareInOrOutOfShare('/rename.txt')\\n#3 /var/www/html/lib/private/legacy/OC_Hook.php(85): OCA\\Files_Sharing\\Updater::renameHook(Array)\\n#4 /var/www/html/lib/private/Files/View.php(835): OC_Hook::emit('OC_Filesystem', 'post_rename', Array)\\n#5 /var/www/html/apps/dav/lib/Connector/Sabre/Node.php(127): OC\\Files\\View->rename('/file.txt', '/rename.txt')\\n#6 /var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php(171): OCA\\DAV\\Connector\\Sabre\\Node->setName('rename.txt')\\n#7 /var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php(612): Sabre\\DAV\\Tree->move('files/user2/fil...', 'files/user2/ren...')\\n#8 /var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\\DAV\\CorePlugin->httpMove(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\\n#9 /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php(472): Sabre\\DAV\\Server->emit('method:MOVE', Array)\\n#10 /var/www/html/apps/dav/lib/Connector/Sabre/Server.php(212): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\\n#11 /var/www/html/apps/dav/lib/Server.php(427): OCA\\DAV\\Connector\\Sabre\\Server->start()\\n#12 /var/www/html/apps/dav/appinfo/v2/remote.php(25): OCA\\DAV\\Server->exec()\\n#13 /var/www/html/remote.php(151): require_once('/var/www/html/a...')\\n#14 {main}\"}",
    "CustomMessage": "Uncaught exception"

Additional info

No response

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions