nextcloud / nextcloud/server

[Bug]: left group share can not be rejoined

Open
#63,688 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 34-feedback bug feature: sharing team: Files
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ This issue respects the following points: ⚠️
  • This is not a troubleshooting question, general support matter, or webserver/proxy problem, but likely a bug (if unsure, ask the Community Help Forum).
  • This issue is not already reported on Github OR solved at the Community Help Forum (I've searched!).
  • I'm using a maintained major version of Nextcloud Server and tested against the latest patch level. (Supported major versions and current patch levels).
  • I agree to follow Nextcloud's Code of Conduct.
  • I've tried my best to provide clear reproduction steps that someone unfamiliar with this bug could use to reproduce it.
Bug description

User A shares a Directory with Group G.
User B of Group G clicks by error on "Leave share"
The Share is now viewed as "Deleted share" but can not be restored.

Steps to reproduce
  1. Create User A and B and Group G
  2. Add B to G
  3. User A shared Directory D with Group G (custom permissions: Allow Download and Sync, Custom permissions: Read, Create, Edit)
  4. User B clicks on the shared Directory "Leave share"
  5. User B sees the share as "Deleted share" but cannot click "restore share". An information popup appears "Restore share: failed"
Expected behavior

The share should be restored

Nextcloud Server version

34

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.5

Web server

Apache (supported)

Database engine version

MariaDB

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

Fresh Nextcloud Server install

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": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REDACTED***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "34.0.3.2",
        "overwrite.cli.url": "https:\/\/"***REDACTED***"",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": ""***REDACTED***"",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 0
        },
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "proxy": "http:\/\/"***REDACTED***"",
        "proxyexclude": [
            "***REDACTED***"
        ],
        "allowed_admin_ranges": [
            "***REDACTED***"
        ],
        "default_language": "de_DE",
        "default_phone_region": "de",
        "maintenance_window_start": 1,
        "skeletondirectory": "\/data\/www\/nextcloud\/core\/**REDACTED**\/",
        "upgrade.disable-web": true,
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_smtpstreamoptions": {
            "ssl": {
                "allow_self_signed": false,
                "verify_peer": true,
                "verify_peer_name": true
            }
        },
        "htaccess.RewriteBase": "\/",
        "maintenance": false,
        "app_install_overwrite": []
    }
}
List of activated Apps
Enabled:
  - activity: 7.0.0
  - appstore: 1.0.0
  - bruteforcesettings: 7.0.0
  - circles: 34.0.0
  - cloud_federation_api: 1.18.0
  - comments: 1.24.0
  - contactsinteraction: 1.15.0
  - dashboard: 7.14.0
  - dav: 1.40.0
  - federatedfilesharing: 1.24.0
  - federation: 1.24.0
  - files: 2.6.0
  - files_antivirus: 6.4.0
  - files_downloadlimit: 5.2.0
  - files_lock: 34.0.1
  - files_pdfviewer: 7.0.0-dev.0
  - files_reminders: 1.7.0
  - files_sharing: 1.26.0
  - files_trashbin: 1.24.0
  - files_versions: 1.27.0
  - firstrunwizard: 7.0.0-dev.0
  - logreader: 7.0.0
  - lookup_server_connector: 1.22.0
  - nextcloud_announcements: 6.0.0
  - notifications: 7.0.0-dev.1
  - oauth2: 1.22.0
  - office: 1.0.0
  - password_policy: 6.0.0-dev.0
  - photos: 7.0.0
  - privacy: 6.0.0-dev.1
  - profile: 1.3.0
  - provisioning_api: 1.24.0
  - recommendations: 7.0.0
  - related_resources: 5.0.0-dev.0
  - serverinfo: 6.0.0
  - settings: 1.17.0
  - sharebymail: 1.24.0
  - support: 6.0.0
  - survey_client: 6.0.0-dev.0
  - systemtags: 1.24.0
  - text: 8.0.0
  - theming: 2.9.0
  - twofactor_backupcodes: 1.23.0
  - twofactor_totp: 16.0.0
  - twofactor_webauthn: 2.7.0
  - updatenotification: 1.24.0
  - user_status: 1.14.0
  - viewer: 7.0.0-dev.0
  - weather_status: 1.14.0
  - webhook_listeners: 1.6.0
  - workflowengine: 2.16.0
Disabled:
  - admin_audit: 1.24.0
  - app_api: 34.0.0 (installed 34.0.0)
  - encryption: 2.22.0
  - files_external: 1.26.0
  - suspicious_login: 12.0.0-dev.0
  - twofactor_nextcloud_notification: 8.0.0
  - user_ldap: 1.25.0
Nextcloud Signing status
No errors have been found.
Nextcloud Logs
{"reqId":"PBPyQHt8fcn3D2XWQAZG","level":2,"time":"2026-08-27T08:37:20+00:00","remoteAddr":"*REDACTED*","user":"**REDACTED","app":"PHP","method":"POST","url":"/ocs/v2.php/apps/files_sharing/api/v1/deletedshares/150","scriptName":"/ocs/v2.php","message":"Undefined array key 1 at *REDACTED*nextcloud/lib/private/Share20/Manager.php#1323","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36","version":"34.0.3.2","data":{"app":"PHP"}}
Additional info

Browser Debugging: when clicking on "restore share" as User B
Image

As a workaround User A has to share D again with explicit User B and same permissions as Group G.
Also deleting the Group Share and creating it new works, but has implications like shortly lost access and possible resend mails to affected users of Group B

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.

Research direction

Start at lib/private/Share20/Manager.php line 1323 and trace the restore request from the /ocs/v2.php/apps/files_sharing/api/v1/deletedshares/150 endpoint. Reproduce the group-share scenario, inspect why restoring User B's deleted share produces the undefined array key warning, and verify that the share can be restored without the error.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
66/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.