nextcloud / nextcloud/server

[Bug]: public-link files owned by deleted LDAP users cannot be downloaded after update to 34.x

Open
#62,952 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 34-feedback bug feature: ldap feature: sharing
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

Last known working version: 33.x
Affected version: all 34.x up to current 34.0.2.1
Storage: local home storage
Encryption: no

The public share page and directory listing work, but GET returns HTTP 503:
Sabre\DAV\Exception\ServiceUnavailable:
Could not open file ... file does seem to exist

The share owner has been deleted from LDAP and is retained as an LDAP
remnant. The file exists, has the same size as oc_filecache, belongs to
the web-server account and can be opened directly by that account.

oc_storages.id: home::john.dunlop
oc_filecache.fileid: 292012
oc_filecache.size: 3015566
oc_filecache.encrypted: 0

occ ldap:check-user:
The user does not exist on LDAP anymore

This worked for the same shares and LDAP remnants on Nextcloud 32.x
and 33.x after the LDAP user was deleted.

Steps to reproduce
  1. Follow existing public link. The expected link content is shown.
  2. Attempt to open or download a file
  3. File downloads as zero bytes, or if a viewer is available, shows no content.
Expected behavior

Behaviour prior to 34.x update, where public links continued to work after LDAP user was deleted.

Nextcloud Server version

34

Operating system

RHEL/CentOS

PHP engine version

PHP 8.3

Web server

Apache (supported)

Database engine version

MariaDB

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

Upgraded to a MAJOR version (ex. 31 to 32)

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
./occ config:list system
{
    "system": {
        "updatechecker": false,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "f-drive.mclh.co.uk"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/f-drive.mclh.co.uk",
        "overwriteprotocol": "https",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "htaccess.RewriteBase": "\/",
        "dbtype": "mysql",
        "version": "34.0.2.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "mail_smtpmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "default_locale": "en_GB",
        "default_language": "en",
        "default_phone_region": "GB",
        "knowledgebaseenabled": false,
        "allow_user_to_change_display_name": false,
        "lost_password_link": "disabled",
        "auth.webauthn.enabled": false,
        "simpleSignUpLink.shown": false,
        "ldapIgnoreNamingRules": false,
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "filelocking.enabled": true,
        "theme": "mclh",
        "loglevel": 2,
        "enable_avatars": false,
        "maintenance": false,
        "maintenance_window_start": 1,
        "allow_user_to_change_mail_address": "",
        "mysql.utf8mb4": true,
        "app_install_overwrite": [
            "sharerenamer"
        ]
    }
}
{
    "system": {
        "updatechecker": false,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "f-drive.mclh.co.uk"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/f-drive.mclh.co.uk",
        "overwriteprotocol": "https",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "htaccess.RewriteBase": "\/",
        "dbtype": "mysql",
        "version": "34.0.2.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "mail_smtpmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "default_locale": "en_GB",
        "default_language": "en",
        "default_phone_region": "GB",
        "knowledgebaseenabled": false,
        "allow_user_to_change_display_name": false,
        "lost_password_link": "disabled",
        "auth.webauthn.enabled": false,
        "simpleSignUpLink.shown": false,
        "ldapIgnoreNamingRules": false,
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "filelocking.enabled": true,
        "theme": "mclh",
        "loglevel": 2,
        "enable_avatars": false,
        "maintenance": false,
        "maintenance_window_start": 1,
        "allow_user_to_change_mail_address": "",
        "mysql.utf8mb4": true,
        "app_install_overwrite": [
            "sharerenamer"
        ]
    }
}
{
    "system": {
        "updatechecker": false,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "f-drive.mclh.co.uk"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/f-drive.mclh.co.uk",
        "overwriteprotocol": "https",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "htaccess.RewriteBase": "\/",
        "dbtype": "mysql",
        "version": "34.0.2.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "mail_smtpmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "default_locale": "en_GB",
        "default_language": "en",
        "default_phone_region": "GB",
        "knowledgebaseenabled": false,
        "allow_user_to_change_display_name": false,
        "lost_password_link": "disabled",
        "auth.webauthn.enabled": false,
        "simpleSignUpLink.shown": false,
        "ldapIgnoreNamingRules": false,
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "filelocking.enabled": true,
        "theme": "mclh",
        "loglevel": 2,
        "enable_avatars": false,
        "maintenance": false,
        "maintenance_window_start": 1,
        "allow_user_to_change_mail_address": "",
        "mysql.utf8mb4": true,
        "app_install_overwrite": [
            "sharerenamer"
        ]
    }
}
List of activated Apps
./occ app:list
Enabled:
  - activity: 7.0.0
  - appstore: 1.0.0
  - bruteforcesettings: 7.0.0
  - cloud_federation_api: 1.18.0
  - dav: 1.39.0
  - federatedfilesharing: 1.24.0
  - files: 2.6.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
  - impersonate: 5.0.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
  - systemtags: 1.24.0
  - text: 8.0.0
  - theming: 2.9.0
  - twofactor_backupcodes: 1.23.0
  - twofactor_totp: 16.0.0
  - updatenotification: 1.24.0
  - user_ldap: 1.25.0
  - viewer: 7.0.0-dev.0
  - webhook_listeners: 1.6.0
  - workflowengine: 2.16.0
Disabled:
  - admin_audit: 1.24.0 (installed 2.1.3)
  - app_api: 34.0.0 (installed 32.0.0)
  - circles: 34.0.0 (installed 25.0.0)
  - comments: 1.24.0 (installed 1.15.0)
  - contactsinteraction: 1.15.0 (installed 1.6.0)
  - dashboard: 7.14.0 (installed 7.5.0)
  - encryption: 2.22.0
  - federation: 1.24.0 (installed 0.1.0)
  - files_external: 1.26.0 (installed 1.17.0)
  - files_versions: 1.27.0 (installed 1.18.0)
  - firstrunwizard: 7.0.0-dev.0 (installed 1.1)
  - survey_client: 6.0.0-dev.0 (installed 1.13.0)
  - suspicious_login: 12.0.0-dev.0
  - terms_of_service: 4.6.1 (installed 4.6.1)
  - testing: 1.23.0
  - theming_customcss: 1.20.0 (installed 1.20.0)
  - twofactor_nextcloud_notification: 8.0.0
  - user_status: 1.14.0 (installed 1.5.0)
  - weather_status: 1.14.0 (installed 1.5.0)
Enabled:
  - activity: 7.0.0
  - appstore: 1.0.0
  - bruteforcesettings: 7.0.0
  - cloud_federation_api: 1.18.0
  - dav: 1.39.0
  - federatedfilesharing: 1.24.0
  - files: 2.6.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
  - impersonate: 5.0.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
  - systemtags: 1.24.0
  - text: 8.0.0
  - theming: 2.9.0
  - twofactor_backupcodes: 1.23.0
  - twofactor_totp: 16.0.0
  - updatenotification: 1.24.0
  - user_ldap: 1.25.0
  - viewer: 7.0.0-dev.0
  - webhook_listeners: 1.6.0
  - workflowengine: 2.16.0
Disabled:
  - admin_audit: 1.24.0 (installed 2.1.3)
  - app_api: 34.0.0 (installed 32.0.0)
  - circles: 34.0.0 (installed 25.0.0)
  - comments: 1.24.0 (installed 1.15.0)
  - contactsinteraction: 1.15.0 (installed 1.6.0)
  - dashboard: 7.14.0 (installed 7.5.0)
  - encryption: 2.22.0
  - federation: 1.24.0 (installed 0.1.0)
  - files_external: 1.26.0 (installed 1.17.0)
  - files_versions: 1.27.0 (installed 1.18.0)
  - firstrunwizard: 7.0.0-dev.0 (installed 1.1)
  - survey_client: 6.0.0-dev.0 (installed 1.13.0)
  - suspicious_login: 12.0.0-dev.0
  - terms_of_service: 4.6.1 (installed 4.6.1)
  - testing: 1.23.0
  - theming_customcss: 1.20.0 (installed 1.20.0)
  - twofactor_nextcloud_notification: 8.0.0
  - user_status: 1.14.0 (installed 1.5.0)
  - weather_status: 1.14.0 (installed 1.5.0)
Enabled:
  - activity: 7.0.0
  - appstore: 1.0.0
  - bruteforcesettings: 7.0.0
  - cloud_federation_api: 1.18.0
  - dav: 1.39.0
  - federatedfilesharing: 1.24.0
  - files: 2.6.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
  - impersonate: 5.0.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
  - systemtags: 1.24.0
  - text: 8.0.0
  - theming: 2.9.0
  - twofactor_backupcodes: 1.23.0
  - twofactor_totp: 16.0.0
  - updatenotification: 1.24.0
  - user_ldap: 1.25.0
  - viewer: 7.0.0-dev.0
  - webhook_listeners: 1.6.0
  - workflowengine: 2.16.0
Disabled:
  - admin_audit: 1.24.0 (installed 2.1.3)
  - app_api: 34.0.0 (installed 32.0.0)
  - circles: 34.0.0 (installed 25.0.0)
  - comments: 1.24.0 (installed 1.15.0)
  - contactsinteraction: 1.15.0 (installed 1.6.0)
  - dashboard: 7.14.0 (installed 7.5.0)
  - encryption: 2.22.0
  - federation: 1.24.0 (installed 0.1.0)
  - files_external: 1.26.0 (installed 1.17.0)
  - files_versions: 1.27.0 (installed 1.18.0)
  - firstrunwizard: 7.0.0-dev.0 (installed 1.1)
  - survey_client: 6.0.0-dev.0 (installed 1.13.0)
  - suspicious_login: 12.0.0-dev.0
  - terms_of_service: 4.6.1 (installed 4.6.1)
  - testing: 1.23.0
  - theming_customcss: 1.20.0 (installed 1.20.0)
  - twofactor_nextcloud_notification: 8.0.0
  - user_status: 1.14.0 (installed 1.5.0)
  - weather_status: 1.14.0 (installed 1.5.0)
Nextcloud Signing status
No errors have been found.
Nextcloud Logs
{"reqId":"anNZSR1V3I5_K_ZJ07fjSwAAAMo","level":3,"time":"2026-08-05T15:39:53+00:00","remoteAddr":"10.1.6.74","user":"--","app":"webdav","method":"GET","url":"/public.php/dav/files/Cl78txTIRt2VP8R/Books/Practical%20Guide%20to%20the%20NEC3.pdf","scriptName":"/public.php","message":"Could not open file: Books/Practical Guide to the NEC3.pdf (292012), file does seem to exist","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36","version":"34.0.2.1","exception":{"Exception":"Sabre\\DAV\\Exception\\ServiceUnavailable","Message":"Could not open file: Books/Practical Guide to the NEC3.pdf (292012), file does seem to exist","Code":0,"Trace":[{"file":"/var/www/vhosts/fdrive/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":85,"function":"get","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/vhosts/fdrive/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpGet","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/vhosts/fdrive/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/vhosts/fdrive/apps/dav/lib/Connector/Sabre/Server.php","line":215,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/vhosts/fdrive/apps/dav/appinfo/v2/publicremote.php","line":174,"function":"start","class":"OCA\\DAV\\Connector\\Sabre\\Server","type":"->"},{"file":"/var/www/vhosts/fdrive/public.php","line":90,"args":["/var/www/vhosts/fdrive/apps/dav/appinfo/v2/publicremote.php"],"function":"require_once"}],"File":"/var/www/vhosts/fdrive/apps/dav/lib/Connector/Sabre/File.php","Line":488,"message":"Could not open file: Books/Practical Guide to the NEC3.pdf (292012), file does seem to exist","exception":"{\"class\":\"Sabre\\DAV\\Exception\\ServiceUnavailable\",\"message\":\"Could not open file: Books/Practical Guide to the NEC3.pdf (292012), file does seem to exist\",\"code\":0,\"file\":\"/var/www/vhosts/fdrive/apps/dav/lib/Connector/Sabre/File.php:488\",\"trace\":\"#0 /var/www/vhosts/fdrive/3rdparty/sabre/dav/lib/DAV/CorePlugin.php(85): OCA\\DAV\\Connector\\Sabre\\File->get()\\n#1 /var/www/vhosts/fdrive/3rdparty/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\\DAV\\CorePlugin->httpGet()\\n#2 /var/www/vhosts/fdrive/3rdparty/sabre/dav/lib/DAV/Server.php(472): Sabre\\DAV\\Server->emit()\\n#3 /var/www/vhosts/fdrive/apps/dav/lib/Connector/Sabre/Server.php(215): Sabre\\DAV\\Server->invokeMethod()\\n#4 /var/www/vhosts/fdrive/apps/dav/appinfo/v2/publicremote.php(174): OCA\\DAV\\Connector\\Sabre\\Server->start()\\n#5 /var/www/vhosts/fdrive/public.php(90): require_once('...')\\n#6 {main}\"}","CustomMessage":"Could not open file: Books/Practical Guide to the NEC3.pdf (292012), file does seem to exist"}}
Additional info

No response

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 by reproducing the listed public-link GET failure for a file owned by an LDAP user retained as a remnant, using the public share page and occ ldap:check-user output. Trace the download path for local home storage and compare behavior with Nextcloud 33.x; done means the existing public link downloads nonzero file content again.

Written by the indexing model from the issue text.

Assessment

Tech stack
apache, mariadb, php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.