server
server copied to clipboard
[Bug]: OCM shares from OpenCloud (reva) are unusable – detected as ownCloud via status.php (shareinfo 401 → share removed) and OCM webdav uri ignored
⚠️ This issue respects the following points: ⚠️
- [x] This is not a troubleshooting question, general support matter, or webserver/proxy problem, but likely a bug (if unsure, ask the Community Help Forum).
- [x] This issue is not already reported on Github OR solved at the Community Help Forum (I've searched!).
- [x] I'm using a maintained major version of Nextcloud Server and tested against the latest patch level. (Supported major versions and current patch levels).
- [x] I agree to follow Nextcloud's Code of Conduct.
- [x] I've tried my best to provide clear reproduction steps that someone unfamiliar with this bug could use to reproduce it.
Bug description
Federated (OCM) shares received from an OpenCloud server (reva-based, advertises OCM apiVersion 1.2.0 with capabilities invites, webdav-uri, protocol-object) can be accepted, but never become usable, and Nextcloud removes them again. Two separate problems in apps/files_sharing/lib/External/Storage.php:
- Provider detection via
/status.php.remoteIsOwnCloud()only checks/status.php. OpenCloud answers it ownCloud-style, sogetShareInfo()callsPOST /index.php/apps/files_sharing/shareinfo?t=…– an ownCloud/Nextcloud-only endpoint. OpenCloud returns 401 →ForbiddenException→Auth error when getting remote share→ the share is removed. - The OCM
uriis ignored. OpenCloud sendsprotocol.webdavwithuri(https://cloud.example.org/dav/ocm/<share-id>) andsharedSecret. Nextcloud uses the discovered endpoint/dav/ocm/with Basic auth (secret as user name) instead. OpenCloud expects the share id in the path and the secret as Bearer token → 401 (OpenCloud log:mismatching ocm share id for existing secret). The same request withAuthorization: Bearer <sharedSecret>against theuriworks (PROPFIND 207, PUT 201, MOVE 201).
Related: #39001 (closed; asked about the shareinfo fallback), #57152 (Bearer for remote shares). A third problem (owner id format sent by OpenCloud) is reported to OpenCloud: opencloud-eu/opencloud#3783. I worked around it in a test setup to isolate the two problems above.
Steps to reproduce
- Fresh
nextcloud:35.0.2-apache(Docker), Contacts app 8.9.2,occ config:app:set contacts ocm_invites_enabled --type=boolean --value=true. - OpenCloud 7.2.4 with
OC_ENABLE_OCM=trueand this Nextcloud in itsocmproviders.json. - Create an invitation in OpenCloud, accept it in Nextcloud Contacts – works, both sides list each other.
- Share a folder from OpenCloud to the Nextcloud user with edit rights – arrives as pending share.
- Accept the share and open it:
PROPFIND /remote.php/dav/files/<user>/<folder>/→ 404, the share is gone. - To check problem 2 separately, answer
/index.php/apps/files_sharing/shareinfoon the OpenCloud side with{"status":"unsupported"}(test only): Nextcloud then sendsPROPFIND https://cloud.example.org/dav/ocm/with Basic auth → 401.
Expected behavior
- Nextcloud recognises OCM providers by their discovery data (
/.well-known/ocm, capabilities) instead of/status.php, and does not callshareinfoon non-Nextcloud providers (or does not delete the share when it fails). - For providers advertising
webdav-uri/protocol-object, Nextcloud usesprotocol.webdav.uriand sends thesharedSecretas Bearer token, as described in the OCM specification.
Nextcloud Server version
35
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.5
Web server
Apache (supported)
Database engine version
SQlite
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?
- [x] Default user-backend (database)
- [ ] LDAP/ Active Directory
- [ ] SSO - SAML
- [ ] Other
Configuration report
{
"system": {
"overwrite.cli.url": "https://nc.example.org",
"overwriteprotocol": "https",
"overwritehost": "nc.example.org",
"trusted_proxies": ["172.16.0.0/12"],
"allow_local_remote_servers": true,
"version": "35.0.2.2"
},
"apps": {
"contacts": { "ocm_invites_enabled": "1", "ocm_invites_optional_mail": "1" }
}
}
List of activated Apps
Default apps of nextcloud:35.0.2-apache plus contacts 8.9.2
Nextcloud Signing status
Nextcloud Logs
{"app":"no app in context","message":"Failed to fetch share info","exception":{"Exception":"GuzzleHttp\\Exception\\ClientException","Message":"Client error: `POST https://cloud.example.org/index.php/apps/files_sharing/shareinfo?t=…` resulted in a `401 Unauthorized` response"}}
{"app":"webdav","message":"Auth error when getting remote share","exception":{"Exception":"OCP\\Files\\StorageInvalidException"}}
{"level":0,"message":"sending dav PROPFIND request to external storage: https://cloud.example.org/dav/ocm/"}
Additional info
- The opposite direction (Nextcloud → OpenCloud) fails too: Nextcloud sends
protocol.options.sharedSecret(OCM 1.0 format), OpenCloud answers 400 "protocol options not supported". #65480 (35.0.3) changes the detection to theprotocol-objectcapability, which OpenCloud advertises – I will re-test after 35.0.3. - Drafted with AI assistance (Claude), reviewed by me.