Skip to content

[Bug]: OCM shares from OpenCloud (reva) are unusable – detected as ownCloud via status.php (shareinfo 401 → share removed) and OCM webdav uri ignored #65770

Open

Description

@chodid

⚠️ 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

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:

  1. Provider detection via /status.php. remoteIsOwnCloud() only checks /status.php. OpenCloud answers it ownCloud-style, so getShareInfo() calls POST /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.
  2. The OCM uri is ignored. OpenCloud sends protocol.webdav with uri (https://cloud.example.org/dav/ocm/<share-id>) and sharedSecret. 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 with Authorization: Bearer <sharedSecret> against the uri works (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

  1. Fresh nextcloud:35.0.2-apache (Docker), Contacts app 8.9.2, occ config:app:set contacts ocm_invites_enabled --type=boolean --value=true.
  2. OpenCloud 7.2.4 with OC_ENABLE_OCM=true and this Nextcloud in its ocmproviders.json.
  3. Create an invitation in OpenCloud, accept it in Nextcloud Contacts – works, both sides list each other.
  4. Share a folder from OpenCloud to the Nextcloud user with edit rights – arrives as pending share.
  5. Accept the share and open it: PROPFIND /remote.php/dav/files/<user>/<folder>/ → 404, the share is gone.
  6. To check problem 2 separately, answer /index.php/apps/files_sharing/shareinfo on the OpenCloud side with {"status":"unsupported"} (test only): Nextcloud then sends PROPFIND 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 call shareinfo on non-Nextcloud providers (or does not delete the share when it fails).
  • For providers advertising webdav-uri / protocol-object, Nextcloud uses protocol.webdav.uri and sends the sharedSecret as 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?

  • 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". OCM: Send local webdav url instead of the remote #65480 (35.0.3) changes the detection to the protocol-object capability, which OpenCloud advertises – I will re-test after 35.0.3.
  • Drafted with AI assistance (Claude), reviewed by me.

Activity

  1. added theissue type on Oct 21, 2026
  2. added
    0. Needs triage
    on Oct 21, 2026
  3. added
    team: Files
    on Oct 23, 2026
  4. susnux commented on Dec 3, 2026

    @susnux
    Contributor

    Thanks for the clear analysis. Both points are still present on current master: remoteIsOwnCloud() only probes /status.php before calling shareinfo, and a 401/403 from shareinfo makes the availability check remove the share. The protocol.webdav.uri of an incoming share isn't stored either, so the WebDAV endpoint always comes from discovery, and Bearer auth is only used when an access token was obtained via the exchange-token capability.

  5. added
    1. to develop
    and removed
    0. Needs triage
    on Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    1. to develop35-feedbackbugfeature: federationteam: Files

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions