Skip to content

[Bug]: Sharing between NC instances (federation) fails since v32 if instances use URL prefixes #58502

Open

Description

@bjoernv

⚠️ This issue respects the following points: ⚠️

Bug description

Two Nextcloud instances share multiple folders in a federation. Since Nextcloud upgrade from 31.0.14 to 32.0.6 this fails both for existing shares and newly created shares.

The problem occurs for on new NC instances and on upgraded NC instances.

The problem only occurs, if the NC instances use URL prefixes like "/nextcloud" in https://www.my-domain.com/nextcloud.

Steps to reproduce

  1. Create 2 NC instances with version 32.0.6 and URL prefixes like https://www.my-domain.com/nextcloud
  2. Create at least one remote share from NC 1 to NC 2
  3. Check if the remote share works on NC 2 (the remote share is stuck as pending)

Expected behavior

Remote shares work

Nextcloud Server version

32

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.3

Web server

Apache (supported)

Database engine version

MySQL

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?

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_domains": [
            "www.my-domain.com"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "htaccess.RewriteBase": "\/nextcloud",
        "overwrite.cli.url": "https:\/\/www.my-domain.com\/nextcloud",
        "trashbin_retention_obligation": "7, 14",
        "dbtype": "mysql",
        "version": "32.0.6.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "forcessl": true,
        "forceSSLforSubdomains": true,
        "mail_smtpmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "app.mail.importance_classification_default": false,
        "enable_certificate_management": true,
        "filelocking.enabled": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "password": "***REMOVED SENSITIVE VALUE***",
            "dbindex": 1
        },
        "maintenance": false,
        "loglevel": 2,
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "integrity.check.disabled": true,
        "theme": "",
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [
            "multifactorauth"
        ],
        "twofactor_enforced_excluded_groups": [],
        "mysql.utf8mb4": true,
        "log_rotate_size": 10485760,
        "allow_local_remote_servers": true,
        "default_phone_region": "DE",
        "app_install_overwrite": [
            "twofactor_admin",
            "user_external"
        ],
        "maintenance_window_start": 1,
        "mail_sendmailmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***"
    }
}

List of activated Apps

Enabled:
  - activity: 5.0.0
  - admin_audit: 1.22.0
  - app_api: 32.0.0
  - bruteforcesettings: 5.0.0
  - circles: 32.0.0
  - cloud_federation_api: 1.16.0
  - comments: 1.22.0
  - contactsinteraction: 1.13.1
  - dashboard: 7.12.0
  - dav: 1.34.2
  - federatedfilesharing: 1.22.0
  - federation: 1.22.0
  - files: 2.4.0
  - files_downloadlimit: 5.0.0-dev.0
  - files_external: 1.24.1
  - files_pdfviewer: 5.0.0
  - files_reminders: 1.5.0
  - files_sharing: 1.24.1
  - files_trashbin: 1.22.0
  - files_versions: 1.25.0
  - firstrunwizard: 5.0.0
  - logreader: 5.0.0
  - lookup_server_connector: 1.20.0
  - nextcloud_announcements: 4.0.0
  - notifications: 5.0.0
  - oauth2: 1.20.0
  - password_policy: 4.0.0
  - photos: 5.0.0
  - privacy: 4.0.0
  - profile: 1.1.0
  - provisioning_api: 1.22.0
  - recommendations: 5.0.0
  - related_resources: 3.0.0
  - serverinfo: 4.0.0
  - settings: 1.15.1
  - sharebymail: 1.22.0
  - support: 4.0.0
  - survey_client: 4.0.0
  - suspicious_login: 10.0.0
  - systemtags: 1.22.0
  - text: 6.0.1
  - theming: 2.7.0
  - twofactor_backupcodes: 1.21.0
  - twofactor_totp: 14.0.0
  - updatenotification: 1.22.0
  - user_status: 1.12.0
  - viewer: 5.0.0
  - weather_status: 1.12.0
  - webhook_listeners: 1.3.0
  - workflowengine: 2.14.0
Disabled:
  - contacts: 7.3.15 (installed 7.3.15)
  - encryption: 2.20.0
  - groupfolders: 19.1.17 (installed 19.1.17)
  - mail: 5.6.13 (installed 5.6.13)
  - twofactor_admin: 4.9.0 (installed 4.9.0)
  - twofactor_nextcloud_notification: 6.0.0
  - user_ldap: 1.23.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"tE7zYnOIjXVvpuTjBDOY","level":2,"time":"2026-02-21T23:35:10+00:00","remoteAddr":"2a00:1169:11c:af60::","user":"--","app":"no app in context","method":"POST","url":"/nextcloud/index.php/ocm/shares","scriptName":"/nextcloud/index.php","message":"signature could not be verified","userAgent":"Nextcloud Server Crawler","version":"32.0.6.1","exception":{"Exception":"NCU\\Security\\Signature\\Exceptions\\SignatoryNotFoundException","Message":"empty result from getRemoteSignatory","Code":0,"Trace":[{"file":"/var/www/nextcloud-extern/lib/private/Security/Signature/SignatureManager.php","line":155,"function":"getSaneRemoteSignatory","class":"OC\\Security\\Signature\\SignatureManager","type":"->"},{"file":"/var/www/nextcloud-extern/lib/private/Security/Signature/SignatureManager.php","line":108,"function":"confirmIncomingRequestSignature","class":"OC\\Security\\Signature\\SignatureManager","type":"->"},{"file":"/var/www/nextcloud-extern/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php","line":460,"function":"getIncomingSignedRequest","class":"OC\\Security\\Signature\\SignatureManager","type":"->"},{"file":"/var/www/nextcloud-extern/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php","line":125,"function":"getSignedRequest","class":"OCA\\CloudFederationAPI\\Controller\\RequestHandlerController","type":"->"},{"file":"/var/www/nextcloud-extern/lib/private/AppFramework/Http/Dispatcher.php","line":204,"function":"addShare","class":"OCA\\CloudFederationAPI\\Controller\\RequestHandlerController","type":"->"},{"file":"/var/www/nextcloud-extern/lib/private/AppFramework/Http/Dispatcher.php","line":118,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud-extern/lib/private/AppFramework/App.php","line":153,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud-extern/lib/private/Route/Router.php","line":321,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud-extern/lib/base.php","line":1091,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud-extern/index.php","line":25,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud-extern/lib/private/Security/Signature/SignatureManager.php","Line":305,"message":"signature could not be verified","exception":[],"signedRequest":{"body":"{\"shareWith\":\"admin@https:\\/\\/www.my-domain.com\\/nextcloud\",\"shareType\":\"user\",\"name\":\"I21_05_Neue TGM Website\",\"resourceType\":\"file\",\"description\":\"\",\"providerId\":\"2110\",\"owner\":\"projektadmin@cloud.vpn.my-domain.com\\/nextcloud\",\"ownerDisplayName\":\"projektadmin\",\"sharedBy\":\"projektadmin@cloud.vpn.my-domain.com\\/nextcloud\",\"sharedByDisplayName\":\"projektadmin\",\"sender\":\"projektadmin@cloud.vpn.my-domain.com\\/nextcloud\",\"senderDisplayName\":\"projektadmin\",\"protocol\":{\"name\":\"webdav\",\"options\":{\"sharedSecret\":\"mVuF1o1xhvinvr3\",\"permissions\":\"{http:\\/\\/open-cloud-mesh.org\\/ns}share-permissions\"}}}","digest":"SHA-512=yFJX4BLD5yzv2YEk+fIdyaD3ZyEkdl1IqT/XYIUNoHBmVTOw4ujL6OT1GZUK7vGQikOO3T5i+iiwPQ+36K6ybQ==","digestAlgorithm":"SHA-512","signingElements":{"keyId":"https://cloud.vpn.my-domain.com/nextcloud/index.php/ocm#signature","algorithm":"rsa-sha512","headers":"(request-target) content-length date digest host","signature":"K8WXSSF/8vpyluCGpiOSUcdikEg0sXN9GH4GsCdRzbM3oYpalvzt3kkEV+GxpGcD+YWIuzunywFHS9j7U3Td6/wH7m4Ugeft+yAT3PVFRTaVZ9o8lzmRDKIQE6bskmIr79lrZegVh9Qgdxj2Hz8VO57QCkk1ujnAXMwtZaf+dkeBDA4y5QTrnRnBJx0TAJEcUex4pOdZcyQkpPCME2bl8O0LHvj0SL3SagAXh4YveVBUKEHa/7WteJXOAi/Tkok1nxbELJxaBfiC2zXd40IXvqCzKnqhxPP/xltdJjXK5HvC0CjTriaLpgzp0YY6iw9PkXVxveZok/KAyGQ9IeSFjA=="},"signatureData":["(request-target): post /nextcloud/index.php/ocm/shares","content-length: 584","date: Sat, 21 Feb 2026 23:35:10 GMT","digest: SHA-512=yFJX4BLD5yzv2YEk+fIdyaD3ZyEkdl1IqT/XYIUNoHBmVTOw4ujL6OT1GZUK7vGQikOO3T5i+iiwPQ+36K6ybQ==","host: www.my-domain.com"],"signature":"K8WXSSF/8vpyluCGpiOSUcdikEg0sXN9GH4GsCdRzbM3oYpalvzt3kkEV+GxpGcD+YWIuzunywFHS9j7U3Td6/wH7m4Ugeft+yAT3PVFRTaVZ9o8lzmRDKIQE6bskmIr79lrZegVh9Qgdxj2Hz8VO57QCkk1ujnAXMwtZaf+dkeBDA4y5QTrnRnBJx0TAJEcUex4pOdZcyQkpPCME2bl8O0LHvj0SL3SagAXh4YveVBUKEHa/7WteJXOAi/Tkok1nxbELJxaBfiC2zXd40IXvqCzKnqhxPP/xltdJjXK5HvC0CjTriaLpgzp0YY6iw9PkXVxveZok/KAyGQ9IeSFjA==","signatory":false,"options":{"algorithm":"rsa-sha512","digestAlgorithm":"SHA-512","extraSignatureHeaders":[],"ttl":300,"dateHeader":"D, d M Y H:i:s T","ttlSignatory":259200,"bodyMaxSize":50000},"origin":"cloud.vpn.my-domain.com"},"signatoryManager":"OC\\OCM\\OCMSignatoryManager","CustomMessage":"signature could not be verified"},"id":"699a46ca6e0ea"}
{"reqId":"tE7zYnOIjXVvpuTjBDOY","level":2,"time":"2026-02-21T23:35:10+00:00","remoteAddr":"2a00:1169:11c:af60::","user":"--","app":"no app in context","method":"POST","url":"/nextcloud/index.php/ocm/shares","scriptName":"/nextcloud/index.php","message":"fail to get remote signatory","userAgent":"Nextcloud Server Crawler","version":"32.0.6.1","exception":{"Exception":"OCP\\OCM\\Exceptions\\OCMProviderException","Message":"error while requesting remote ocm provider","Code":0,"Trace":[{"file":"/var/www/nextcloud-extern/lib/private/OCM/OCMDiscoveryService.php","line":70,"function":"discover","class":"OC\\OCM\\OCMDiscoveryService","type":"->"},{"file":"/var/www/nextcloud-extern/lib/private/OCM/OCMSignatoryManager.php","line":149,"function":"discover","class":"OC\\OCM\\OCMDiscoveryService","type":"->"},{"file":"/var/www/nextcloud-extern/lib/private/Security/Signature/SignatureManager.php","line":303,"function":"getRemoteSignatory","class":"OC\\OCM\\OCMSignatoryManager","type":"->"},{"file":"/var/www/nextcloud-extern/lib/private/Security/Signature/SignatureManager.php","line":155,"function":"getSaneRemoteSignatory","class":"OC\\Security\\Signature\\SignatureManager","type":"->"},{"file":"/var/www/nextcloud-extern/lib/private/Security/Signature/SignatureManager.php","line":108,"function":"confirmIncomingRequestSignature","class":"OC\\Security\\Signature\\SignatureManager","type":"->"},{"file":"/var/www/nextcloud-extern/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php","line":460,"function":"getIncomingSignedRequest","class":"OC\\Security\\Signature\\SignatureManager","type":"->"},{"file":"/var/www/nextcloud-extern/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php","line":125,"function":"getSignedRequest","class":"OCA\\CloudFederationAPI\\Controller\\RequestHandlerController","type":"->"},{"file":"/var/www/nextcloud-extern/lib/private/AppFramework/Http/Dispatcher.php","line":204,"function":"addShare","class":"OCA\\CloudFederationAPI\\Controller\\RequestHandlerController","type":"->"},{"file":"/var/www/nextcloud-extern/lib/private/AppFramework/Http/Dispatcher.php","line":118,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud-extern/lib/private/AppFramework/App.php","line":153,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud-extern/lib/private/Route/Router.php","line":321,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud-extern/lib/base.php","line":1091,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud-extern/index.php","line":25,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud-extern/lib/private/OCM/OCMDiscoveryService.php","Line":152,"message":"fail to get remote signatory","exception":[],"remote":"cloud.vpn.my-domain.com","CustomMessage":"fail to get remote signatory"},"id":"699a46ca6e102"}
{"reqId":"tE7zYnOIjXVvpuTjBDOY","level":2,"time":"2026-02-21T23:35:10+00:00","remoteAddr":"2a00:1169:11c:af60::","user":"--","app":"no app in context","method":"POST","url":"/nextcloud/index.php/ocm/shares","scriptName":"/nextcloud/index.php","message":"error while discovering ocm provider","userAgent":"Nextcloud Server Crawler","version":"32.0.6.1","exception":{"Exception":"GuzzleHttp\\Exception\\ClientException","Message":"Client error: `GET http://cloud.vpn.my-domain.com/ocm-provider` resulted in a `404 Not Found` response:\n<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found (truncated...)\n","Code":404,"Trace":[{"file":"/var/www/nextcloud-extern/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":72,"function":"create","class":"GuzzleHttp\\Exception\\RequestException","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud-extern/3rdparty/guzzlehttp/promises/src/Promise.php","line":209,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud-extern/3rdparty/guzzlehttp/promises/src/Promise.php","line":158,"function":"callHandler","class":"GuzzleHttp\\Promise\\Promise","type":"::"},{"file":"/var/www/nextcloud-extern/3rdparty/guzzlehttp/promises/src/TaskQueue.php","line":52,"function":"GuzzleHttp\\Promise\\{closure}","class":"GuzzleHttp\\Promise\\Promise","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud-extern/3rdparty/guzzlehttp/promises/src/Promise.php","line":251,"function":"run","class":"GuzzleHttp\\Promise\\TaskQueue","type":"->"},{"file":"/var/www/nextcloud-extern/3rdparty/guzzlehttp/promises/src/Promise.php","line":227,"function":"invokeWaitFn","class":"GuzzleHttp\\Promise\\Promise","type":"->"},{"file":"/var/www/nextcloud-extern/3rdparty/guzzlehttp/promises/src/Promise.php","line":272,"function":"waitIfPending","class":"GuzzleHttp\\Promise\\Promise","type":"->"},{"file":"/var/www/nextcloud-extern/3rdparty/guzzlehttp/promises/src/Promise.php","line":229,"function":"invokeWaitList","class":"GuzzleHttp\\Promise\\Promise","type":"->"},{"file":"/var/www/nextcloud-extern/3rdparty/guzzlehttp/promises/src/Promise.php","line":69,"function":"waitIfPending","class":"GuzzleHttp\\Promise\\Promise","type":"->"},{"file":"/var/www/nextcloud-extern/3rdparty/guzzlehttp/guzzle/src/Client.php","line":189,"function":"wait","class":"GuzzleHttp\\Promise\\Promise","type":"->"},{"file":"/var/www/nextcloud-extern/lib/private/Http/Client/Client.php","line":206,"function":"request","class":"GuzzleHttp\\Client","type":"->"},{"file":"/var/www/nextcloud-extern/lib/private/OCM/OCMDiscoveryService.php","line":117,"function":"get","class":"OC\\Http\\Client\\Client","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud-extern/lib/private/OCM/OCMDiscoveryService.php","line":70,"function":"discover","class":"OC\\OCM\\OCMDiscoveryService","type":"->"},{"file":"/var/www/nextcloud-extern/lib/private/OCM/OCMSignatoryManager.php","line":149,"function":"discover","class":"OC\\OCM\\OCMDiscoveryService","type":"->"},{"file":"/var/www/nextcloud-extern/lib/private/Security/Signature/SignatureManager.php","line":303,"function":"getRemoteSignatory","class":"OC\\OCM\\OCMSignatoryManager","type":"->"},{"file":"/var/www/nextcloud-extern/lib/private/Security/Signature/SignatureManager.php","line":155,"function":"getSaneRemoteSignatory","class":"OC\\Security\\Signature\\SignatureManager","type":"->"},{"file":"/var/www/nextcloud-extern/lib/private/Security/Signature/SignatureManager.php","line":108,"function":"confirmIncomingRequestSignature","class":"OC\\Security\\Signature\\SignatureManager","type":"->"},{"file":"/var/www/nextcloud-extern/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php","line":460,"function":"getIncomingSignedRequest","class":"OC\\Security\\Signature\\SignatureManager","type":"->"},{"file":"/var/www/nextcloud-extern/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php","line":125,"function":"getSignedRequest","class":"OCA\\CloudFederationAPI\\Controller\\RequestHandlerController","type":"->"},{"file":"/var/www/nextcloud-extern/lib/private/AppFramework/Http/Dispatcher.php","line":204,"function":"addShare","class":"OCA\\CloudFederationAPI\\Controller\\RequestHandlerController","type":"->"},{"file":"/var/www/nextcloud-extern/lib/private/AppFramework/Http/Dispatcher.php","line":118,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud-extern/lib/private/AppFramework/App.php","line":153,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud-extern/lib/private/Route/Router.php","line":321,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud-extern/lib/base.php","line":1091,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud-extern/index.php","line":25,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud-extern/3rdparty/guzzlehttp/guzzle/src/Exception/RequestException.php","Line":111,"message":"error while discovering ocm provider","exception":[],"remote":"http://cloud.vpn.my-domain.com","CustomMessage":"error while discovering ocm provider"},"id":"699a46ca6e123"}

Additional info

No response

Activity

  1. added
    0. Needs triagePending check for reproducibility or if it fits our roadmap
    on Feb 22, 2026
  2. added theissue type on Feb 22, 2026
  3. joshtrichards commented on Feb 22, 2026

    @joshtrichards
    Member

    "Message":"Client error: GET http://cloud.vpn.my-domain.com/ocm-provider` resulted in a `404 Not Found``

    This would seem to be the culprit.

    The URL http[s]://cloud.vpn.my-domain.com/ocm-provider needs to be accessible on the remote instance.

    (I don't know how to re-enable integrity check, if it was once disabled)

    Drop this line from your config:

             "integrity.check.disabled": true,
  4. changed the title [-][Bug]: Sharing between NC instances (federation) fails since v32[/-] [+][Bug]: Sharing between NC instances (federation) fails since v32 if instances use URL prefixes[/+] on Feb 22, 2026
  5. bjoernv commented on Feb 22, 2026

    @bjoernv
    Author

    joshtrichards

    "Message":"Client error: GET [http://cloud.vpn.my-domain.com/ocm-provider](http://cloud.vpn.my-domain.com/ocm-provider%60) resulted in a 404 Not Found``

    This would seem to be the culprit.

    The URL http[s]://cloud.vpn.my-domain.com/ocm-provider needs to be accessible on the remote instance.

    Both NC instances see can access each other. The problem is, that the new Signature-Manager in version 32 constructs incorrect remote URLs. https://cloud.vpn.my-domain.com/ocm-provider is incorrect. It should be https://cloud.vpn.my-domain.com/nextcloud/ocm-provider

    Also https://www.my-domain.com/ocm-provider is incorrectly generated by the Signature-Manager. It must be https://www.my-domain.com/nextcloud/ocm-provider

  6. bjoernv commented on Feb 22, 2026

    @bjoernv
    Author

    joshtrichards

    (I don't know how to re-enable integrity check, if it was once disabled)

    Drop this line from your config:

         "integrity.check.disabled": true,
    

    Thanks. This worked.

  7. joshtrichards commented on Feb 23, 2026

    @joshtrichards
    Member

    Does the problem go away if you specify the appropriateoverwritewebroot in the config of your cloud.vpn.my-domain.com instance?

  8. bjoernv commented on Feb 23, 2026

    @bjoernv
    Author

    @joshtrichards

    Does the problem go away if you specify the appropriateoverwritewebroot in the config of your cloud.vpn.my-domain.com instance?

    I already had
    'overwrite.cli.url' => 'https://www.my-domain.com/nextcloud'
    and
    'overwrite.cli.url' => 'https://cloud.vpn.my-domain.com/nextcloud'
    defined in the matching instances over years.

    Everything worked fine until Nextcloud 31. But Nextcloud 32 upgrade broke remote sharing when URL prefixes are used.

    I do not really know how to debug this problem. I already tried "git bisect" between the stable31 and stable32 branches. But probably I made an mistake. "git bisect" showed me at the end 9e1a806a1e213618d3aba9f8092056a66c0bcc3d was both good and bad.

  9. bjoernv commented on Feb 23, 2026

    @bjoernv
    Author

    Here are some more detailed instructions to reproduce the issue:

    1. Install Apache and PHP
    2. Install Let's Encrypt or other valid certificates (otherwise guzzlehttp from Nextcloud may not connect between instances)
    3. Find the webroot (/srv/www/htdocs in my case)
    4. Unpack Nextcloud to /srv/www/htdocs/nextcloud1 and /srv/www/htdocs/nextcloud2
    5. Configure the correct Apache settings (an example is shown below)
    6. Finish Nextcloud setup via browser (to speed up I used sqlite3 for testing, the production server uses MySQL)
    7. Verify, if 'overwrite.cli.url' => 'https://www.my-domain.com/nextcloudX' is correct in config/config.php (X=1 or 2)
    8. Add 'allow_local_remote_servers' => true on both instances (config/config.php)
    9. Increase logging on both instances: sudo -u wwwrun php occ log:manage --level=info
    10. Update the .htaccess file within nextcloud1/nextcloud2: sudo -u wwwrun touch .htaccess; sudo -u wwwrun php occ maintenance:update:htaccess
    11. Add the Nextcloud servers as "Trusted servers" in Administration → Sharing in the form https://www.my-domain.com/nextcloudX (X=1 for Nextcloud 2 or 2 for Nextcloud 1)
    12. Add a folder "sharetest" on Nextcloud 1
    13. Share this folder with admin@www.my-domain.com/nextcloud2 on Nextcloud 1
    14. Do some cron runs: curl https://www.my-domain.com/nextcloud1/cron.php; curl https://www.my-domain.com/nextcloud2/cron.php
    15. Check on Nextcloud 2 if the shared folder "sharetest" is shown
    16. If not, go to Logging on Nextcloud 2For me this works correctly with nextcloud-31.0.14, but fails with nextcloud-32.0.6.My Apache settings for Nextcloud (nextcloud1 is shown)
    <Directory "/srv/www/htdocs/nextcloud1">
        Options +FollowSymLinks
        AllowOverride All
    
        <IfModule mod_dav.c>
          Dav off
        </IfModule>
    
        <IfModule mod_headers.c>
          Header always set Referrer-Policy no-referrer
        </IfModule>
    
        <IfModule deflate_module>
            AddOutputFilterByType DEFLATE text/plain
            AddOutputFilterByType DEFLATE text/html
            AddOutputFilterByType DEFLATE text/css
            AddOutputFilterByType DEFLATE image/svg+xml
            AddOutputFilterByType DEFLATE application/x-javascript
            AddOutputFilterByType DEFLATE application/json
            Header append Vary Accept-Encoding
        </IfModule>
    
        SetEnv HOME /srv/www/htdocs/nextcloud1
        SetEnv HTTP_HOME /srv/www/htdocs/nextcloud1
    </Directory>
    
    <Directory /srv/www/htdocs/nextcloud1/>
        SetEnv no-gzip 1
    </Directory>
    
    <Directory "/srv/www/htdocs/nextcloud1/data/">
      # just in case if .htaccess gets disabled
      Require all denied
    </Directory>
    
  10. joshtrichards commented on Feb 23, 2026

    @joshtrichards
    Member

    I already had
    'overwrite.cli.url' => 'https://www.my-domain.com/nextcloud'
    and
    'overwrite.cli.url' => 'https://cloud.vpn.my-domain.com/nextcloud'
    defined in the matching instances over years.

    I'm referring specifically to overwritewebroot and setting it to /nextcloud:

    https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#overwritewebroot

  11. 11 remaining items

  12. artlog commented on Oct 9, 2026

    @artlog

    I get same issues in 35.0.1 after upgrade / reinstall.
    I can share a folder from https://instance-a.tld/ to userb@instance-b.tld/nextcloud but sharing a folder of https://instance-b.tld/nextcloud/ with usera@instance-a.tld stays in Waiting forever.
    It is clear that issuer == origin == host and then does not take subdirectory in account but keyID that identify the subject does.
    What is see is that DAV request propfind return entries with HTTP 200 for working one, and return and entry HTTP 404 that is default reply for the subdirectory one.

  13. artlog commented on Oct 9, 2026

    @artlog

    @Thorkel-dev i am using nginx and not apache, so .htaccess is not used.

  14. Thorkel-dev commented on Oct 9, 2026

    @Thorkel-dev

    In my case

    providerId = 127
            ↓
    resolveNotificationIdentity(...)
            ↓
    origin = null
            ↓
    RFC 9421 verification requires the sender origin
    

    Where the origin cannot be identified

  15. smartysmart34 commented on Oct 12, 2026

    @smartysmart34

    The lack of responses and support by the Nextcloud developers is really concerning here. Not a developer myself I tried to get some analysis done using Claude AI. I know, not a solid approach but the only way for me to move ahead here. I worked through logfiles, code excerpts and Firefox developer console to try and narrow things down. Most of that still on 34.04 and 34.02 for my instance and the one of a friend.
    Two things emerged:

    1. an additional rewrite which I did not verify yet:
    location ^~ /public.php/ {
        rewrite ^/public.php/(.*)$ /Nextcloud/public.php/$1 break;
        client_max_body_size 10G;
        proxy_request_buffering off;
        proxy_buffering off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Host $host;
        proxy_pass http://127.0.0.1:82;
    }
    
    1. A patched code file
    --- a/lib/private/AppFramework/Http/Request.php	2026-10-12 07:24:53.287121189 +0200
    +++ b/lib/private/AppFramework/Http/Request.php	2026-10-12 07:24:53.312109534 +0200
    @@ -645,8 +645,22 @@
     	#[\Override]
     	public function getRequestUri(): string {
     		$uri = isset($this->server['REQUEST_URI']) ? $this->server['REQUEST_URI'] : '';
    -		if ($this->config->getSystemValueString('overwritewebroot') !== '' && $this->isOverwriteCondition()) {
    -			$uri = $this->getScriptName() . substr($uri, \strlen($this->server['SCRIPT_NAME']));
    +		$overwriteWebRoot = $this->config->getSystemValueString('overwritewebroot');
    +		if ($overwriteWebRoot !== '' && $this->isOverwriteCondition()) {
    +			$scriptName = $this->server['SCRIPT_NAME'] ?? '';
    +			if ($scriptName !== '' && str_starts_with($uri, $scriptName)) {
    +				// URL contains the front controller (…/index.php/…):
    +				// replace the real script path by the overwritten one
    +				$uri = $this->getScriptName() . substr($uri, \strlen($scriptName));
    +			} else {
    +				// "pretty" URL without index.php (e.g. /Nextcloud/ocm/notifications):
    +				// swap only the real web root prefix for the overwritten one, so
    +				// the path is not cut at an arbitrary offset
    +				$realWebRoot = rtrim(\dirname($scriptName), '/');
    +				if ($realWebRoot === '' || $uri === $realWebRoot || str_starts_with($uri, $realWebRoot . '/')) {
    +					$uri = '/' . trim($overwriteWebRoot, '/') . substr($uri, \strlen($realWebRoot));
    +				}
    +			}
     		}
     		return $uri;
     	}
    

    Not sure this solves it entirely but maybe some more experienced Devs can have a look at that?

    Cheers,
    Martin

  16. artlog commented on Oct 12, 2026

    @artlog

    @smartysmart34 Does your changes make it work ?

    i am like you and trying to hack through it. I got a little further but end with funny results.
    Please note that i am not using any AI helper, all is pragmatic test and self-made.

    The main one was that server B issue a /nextcloud/remote.php/webdav request to A with share access_token to get list of shared directory content and received an empty list.

    I got this workaround here, that is to take in account OC::WEBROOT which is where code capture URL prefix.

    this is patched on A server

    diff --git a/apps/dav/appinfo/v1/publicwebdav.php b/apps/dav/appinfo/v1/publicwebdav.php
    index 4dbf058b..f2e984ef 100644
    --- a/apps/dav/appinfo/v1/publicwebdav.php
    +++ b/apps/dav/appinfo/v1/publicwebdav.php
    @@ -89,6 +89,14 @@ $requestUri = Server::get(IRequest::class)->getRequestUri();
     $linkCheckPlugin = new PublicLinkCheckPlugin();
     $filesDropPlugin = new FilesDropPlugin();
     
    +$webroot=OC::$WEBROOT;
    +if ( str_starts_with($requestUri,$webroot) ) {
    +  $requestUri = substr($requestUri, strlen($webroot), strlen($requestUri)-strlen($webroot));
    +}
    +if ( str_starts_with($baseuri,$webroot) ) {
    +  $baseuri = substr($baseuri, strlen($webroot), strlen($baseuri)-strlen($webroot));
    +}
    +
     /** @var string $baseuri defined in public.php */
     $server = $serverFactory->createServer(
            true,
    

    Still there is another issue in B server that mess the names of nodes within shared folder.

    my sub directory 'ApresURlchange' becomes 'ange' and my directory 'voyonscommentfinicetructractrick' becomes 'entfinicetructractrick'.

    so there is an issue in rewritting names of resources for the B server as DAV proxy, i thing i have an idea where it is, investigation is going on.

  17. artlog commented on Oct 12, 2026

    @artlog

    So i get an interesting hint for the rewritting issue in B server, i did change application webroot from /nexcloud to /nc1, this is really easy in my yyunohost admin panel, and got longer messed names.
    'voyonscommentfinicetructractrick' becomes 'nscommentfinicetructractrick' , so here it is clear that this is A webroot length that is suppressed somewhere while not checking it was starting with it.

  18. artlog commented on Oct 12, 2026

    @artlog

    got final word , this is in DAV proxy where we blindly remove root without checking it really starts with root.

    diff --git a/lib/private/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php
    index efcceba7..1bea591a 100644
    --- a/lib/private/Files/Storage/DAV.php
    +++ b/lib/private/Files/Storage/DAV.php
    @@ -1204,7 +1204,9 @@ class DAV extends Common {
     
                            foreach ($responses as $file => $response) {
                                    $file = rawurldecode($file);
    -                               $file = substr($file, strlen($this->root));
    +                               if (str_starts_with($file,$this->root)) {
    +                                  $file = substr($file, strlen($this->root));
    +                               }
                                    $file = $this->cleanPath($file);
                                    $this->statCache->set($file, $response);
                                    yield $this->getMetaFromPropfind($file, $response);
    
  19. artlog commented on Oct 12, 2026

    @artlog

    @joshtrichards my two comment are proof that there is a fix i get it working on my yunohost setup. still this does not mean that it is bulletproof.
    While playing with it before applying last fix, restarting redis and launching cron.php on B i got an interesting (near infinite) recursive call in {"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":411,"function":"scanChildren","class":"OC\Files\Cache\Scanner","type":"->"} involving sending endless requests to A.

  20. artlog commented on Oct 12, 2026

    @artlog

    One comment : there is no need of overwritewebroot configuration entry that seems more to be CLI feature. OC::$WEBROOT is already correctly extracted in code.
    This is quite hard to know what url/url we are handling, what are their context, if it is relative internal or global, the second fix seems to indicate we are mixing root and webroot concept when acting as proxy, this is old code too.

  21. smartysmart34 commented on Oct 12, 2026

    @smartysmart34

    30. One comment : there is no need of overwritewebroot configuration entry that seems more to be CLI feature. OC::$WEBROOT is already correctly extracted in code.
    This is quite hard to know what url/url we are handling, what are their context, if it is relative internal or global, the second fix seems to indicate we are mixing root and webroot concept when acting as proxy, this is old code too.

    My Claude mentions your extraction of basuri will break hrefs in later server replies. It therfore suggests the following:

    --- a/apps/dav/lib/Connector/Sabre/ServerFactory.php	2026-10-12 14:21:21.876395978 +0200
    +++ b/apps/dav/lib/Connector/Sabre/ServerFactory.php	2026-10-12 14:21:21.923112580 +0200
    @@ -75,7 +75,9 @@
     		// /public.php/webdav/ shows the files in the share in the root itself
     		// and not under /public.php/webdav/files/{token} so we should keep
     		// compatibility for that.
    -		$needsSharesInRoot = $baseUri === '/public.php/webdav/';
    +		// $baseUri is built in public.php as \OC::$WEBROOT . '/public.php/webdav/',
    +		// so the web root of sub-directory installs (e.g. /Nextcloud) must be part of the comparison
    +		$needsSharesInRoot = $baseUri === \OC::$WEBROOT . '/public.php/webdav/';
     		$useCollection = $isPublicShare && !$needsSharesInRoot;
     		$debugEnabled = $this->config->getSystemValue('debug', false);
     		[$tree, $rootCollection] = $this->getTree($useCollection);
    
  22. artlog commented on Oct 12, 2026

    @artlog

    Well, does Claude operate two servers federated ?
    I confirm this is working.
    Good this $needsSharesInRoot was actualy the original culprit, since it prevented to answer with a list of entries ( $useCollection ).
    So this fix is better.
    fix in DAV should still be good perhaps just refusing entries if mismatching declared root, here code is blindly trusting potentialy incoherent input.

  23. artlog commented on Oct 13, 2026

    @artlog

    @joshtrichards this is reproduced and a fix is proposed, what more should be done ?

  24. smartysmart34 commented on Oct 13, 2026

    @smartysmart34

    @joshtrichards I am really not sure who owns this part of Nextcloud but the fact this issue has been sitting here being ignored for 8 months is ridiculous. Now two completely unrelated Non-Developers tried sorting this out but it is still not moving anywhere? Really?
    @artlog Thank you for your help here and for submitting the committ.

  25. smartysmart34 commented on Nov 4, 2026

    @smartysmart34

    @artlog It seems this fix is not wanted and possibly also not desired. Frustrating to observe this ignorance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions