nextcloud / nextcloud/server

[Bug]: Reshare a file shared from a remote server error User not found in backend

Open
#53,596 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 30-feedback bug feature: federation 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

When trying to reshare (by link or to an user) a file in a folder shared by another NC instance to my user lead to an error 500 when create the share and NoUserException User not found in backend.
The share is created anyway but try to access to the file lead to the same error.

Steps to reproduce
  1. Share a folder to a remote account, from a NC instance 1 to instance 2, with the reshare right.
  2. On the instance 2, try to share a file in this folder to a user of the instance 2 or by link
  3. See the error 500 in the console log Bug from Maps app https://github.com/nextcloud/maps/issues/1427
  4. Try to access to the file by the shale link
  5. See the error in the NC log
Expected behavior

Can access to the shared file.

Nextcloud Server version

30

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Nginx

Database engine version

MariaDB

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

None

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": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "forwarded_for_headers": [
            "HTTP_X_FORWARDED_FOR"
        ],
        "trusted_domains": [
            "cloud.lebib.org",
            "nuage.lebib.org",
            "claude.lebib.org",
            "bib-cloud.lebib.lan",
            "bib-cloud",
            "10.13.208.6"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "30.0.12.2",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "default_language": "fr",
        "installed": true,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "htaccess.RewriteBase": "\/",
        "enable_previews": true,
        "preview_max_x": 2048,
        "preview_max_scale_factor": 1,
        "log_type": "file",
        "syslog_tag": "NextCloud",
        "loglevel": 3,
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "log_query": false,
        "updater.release.channel": "stable",
        "allow_user_to_change_display_name": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "mysql.utf8mb4": true,
        "mail_sendmailmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "cache_chunk_gc_ttl": 86400,
        "default_phone_region": "FR",
        "maintenance": false,
        "overwrite.cli.protocol": "https",
        "overwrite.cli.url": "https:\/\/cloud.lebib.org",
        "webhooks_calendar_object_created_url": "https:\/\/framagit.org\/api\/v4\/projects\/84144\/ref\/main\/trigger\/pipeline?token=glptt-36bc1bc933dc7e9dedf9397010a39993067899bf",
        "mail_smtpdebug": false,
        "debug": false,
        "mail_smtpsecure": "ssl",
        "mail_smtpstreamoptions": {
            "ssl": {
                "allow_self_signed": true,
                "verify_peer": false,
                "verify_peer_name": false
            }
        },
        "profiler": false,
        "app_install_overwrite": [
            "files_rightclick",
            "issuetemplate",
            "apporder",
            "metadata",
            "calendar_news",
            "side_menu",
            "files_trackdownloads"
        ],
        "maintenance_window_start": 2
    }
}
List of activated Apps
- activity: 3.0.0
  - announcementcenter: 7.1.3
  - app_api: 4.0.6
  - bruteforcesettings: 3.0.0
  - calendar: 5.3.3
  - calendar_resource_management: 0.9.0
  - circles: 30.0.0
  - cloud_federation_api: 1.13.0
  - collectives: 2.18.0
  - comments: 1.20.1
  - contacts: 7.1.3
  - contactsinteraction: 1.11.0
  - cospend: 3.0.11
  - dashboard: 7.10.0
  - data_request: 2.0.1
  - dav: 1.31.1
  - deck: 1.14.5
  - drawio: 3.0.9
  - drop_account: 2.7.1
  - federatedfilesharing: 1.20.0
  - federation: 1.20.0
  - files: 2.2.0
  - files_downloadlimit: 3.0.0
  - files_external: 1.22.0
  - files_pdfviewer: 3.0.0
  - files_reminders: 1.3.0
  - files_sharing: 1.22.0
  - files_trashbin: 1.20.1
  - files_versions: 1.23.0
  - fileslibreofficeedit: 2.0.1
  - firstrunwizard: 3.0.0
  - forms: 5.1.0
  - groupfolders: 18.1.2
  - impersonate: 1.17.1
  - integration_dropbox: 3.1.0
  - integration_gitlab: 3.2.0
  - integration_google: 3.2.0
  - integration_openstreetmap: 2.1.0
  - intros: 1.1.2
  - keeweb: 0.6.21
  - logreader: 3.0.0
  - lookup_server_connector: 1.18.0
  - maps: 1.5.0
  - nextcloud_announcements: 2.0.0
  - notifications: 3.0.0
  - notify_push: 1.1.0
  - oauth2: 1.18.1
  - password_policy: 2.0.0
  - photos: 3.0.2
  - polls: 7.4.4
  - privacy: 2.0.0
  - provisioning_api: 1.20.0
  - quota_warning: 1.21.0
  - recommendations: 3.0.0
  - registration: 2.7.0
  - related_resources: 1.5.0
  - serverinfo: 2.0.0
  - settings: 1.13.0
  - sharebymail: 1.20.0
  - side_menu: 4.1.1
  - spreed: 20.1.7
  - survey_client: 2.0.0
  - suspicious_login: 8.0.0
  - systemtags: 1.20.0
  - tables: 0.9.3
  - tasks: 0.16.1
  - text: 4.1.0
  - theming: 2.6.0
  - theming_customcss: 1.18.0
  - timemanager: 0.3.18
  - twofactor_backupcodes: 1.19.0
  - updatenotification: 1.20.0
  - uppush: 2.3.0
  - user_status: 1.10.0
  - viewer: 3.0.0
  - weather_status: 1.10.0
  - webhook_listeners: 1.1.0-dev
  - workflow_ocr: 1.30.1
  - workflowengine: 2.12.0
Nextcloud Signing status

Nextcloud Logs
{"reqId":"lBZWe1y7fJe9sGal0rtZ","level":3,"time":"2025-06-18T20:14:45+00:00","remoteAddr":"10.12.200.200","user":"--","app":"webdav","method":"PROPFIND","url":"/public.php/dav/files/MLMyaZttBjzow8m/","message":"User not found in backend","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0","version":"30.0.12.2","exception":{"Exception":"OC\\User\\NoUserException","Message":"User not found in backend","Code":0,"Trace":[{"file":"/srv/nextcloud/lib/private/User/LazyUser.php","line":124,"function":"getUser","class":"OC\\User\\LazyUser","type":"->"},{"file":"/srv/nextcloud/lib/private/Accounts/AccountManager.php","line":542,"function":"getEMailAddress","class":"OC\\User\\LazyUser","type":"->"},{"file":"/srv/nextcloud/lib/private/Accounts/AccountManager.php","line":202,"function":"buildDefaultUserRecord","class":"OC\\Accounts\\AccountManager","type":"->"},{"file":"/srv/nextcloud/lib/private/Accounts/AccountManager.php","line":648,"function":"getUser","class":"OC\\Accounts\\AccountManager","type":"->"},{"file":"/srv/nextcloud/apps/dav/lib/Connector/Sabre/FilesPlugin.php","line":373,"function":"getAccount","class":"OC\\Accounts\\AccountManager","type":"->"},{"file":"/srv/nextcloud/3rdparty/sabre/dav/lib/DAV/PropFind.php","line":95,"function":"OCA\\DAV\\Connector\\Sabre\\{closure}","class":"OCA\\DAV\\Connector\\Sabre\\FilesPlugin","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/srv/nextcloud/apps/dav/lib/Connector/Sabre/FilesPlugin.php","line":358,"function":"handle","class":"Sabre\\DAV\\PropFind","type":"->"},{"file":"/srv/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"handleGetProperties","class":"OCA\\DAV\\Connector\\Sabre\\FilesPlugin","type":"->"},{"file":"/srv/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1052,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":984,"function":"getPropertiesByNode","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1662,"function":"getPropertiesIteratorForPath","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1647,"function":"writeMultiStatus","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":346,"function":"generateMultiStatus","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPropFind","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/srv/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/apps/dav/lib/Connector/Sabre/Server.php","line":49,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/apps/dav/appinfo/v2/publicremote.php","line":139,"function":"start","class":"OCA\\DAV\\Connector\\Sabre\\Server","type":"->"},{"file":"/srv/nextcloud/public.php","line":82,"args":["/srv/nextcloud/apps/dav/appinfo/v2/publicremote.php"],"function":"require_once"}],"File":"/srv/nextcloud/lib/private/User/LazyUser.php","Line":41,"message":"User not found in backend","exception":[],"CustomMessage":"User not found in backend"},"id":"685323d227983"}
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

Reproduce the federated reshare and inspect the logged trace through apps/dav/lib/Connector/Sabre/FilesPlugin.php, lib/private/Accounts/AccountManager.php, and lib/private/User/LazyUser.php, starting at the publicremote.php entry point. Trace why the remote shared file reaches account lookup with a missing user. Done means the reshare can be accessed without the 500 response or “User not found in backend” error.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.