Error while discovering ocm-provider

Hello,

I have a problem with my nextcloud installation. When I try to access my data using webdav from my Ubuntu Desktop, the file browser takes super long to load the contents of my server. When accessing the data via the Windows App or the webpage, this problem does not occur.

In the nextcloud logfile, I found that the following error messagen, which seem to be linked to the file access using webdav:

{
  "reqId": "aL1u4VIGE9Vw1fOhCuQRRAAAAEk",
  "level": 2,
  "time": "2025-09-07T11:39:19+00:00",
  "remoteAddr": "109.250.27.152",
  "user": "Nikolas",
  "app": "no app in context",
  "method": "PROPFIND",
  "url": "/remote.php/dav/files/nikolas/",
  "message": "error while discovering ocm provider",
  "userAgent": "davfs2/1.7.0 neon/0.33.0",
  "version": "31.0.8.1",
  "exception": {
    "Exception": "GuzzleHttp\\Exception\\RequestException",
    "Message": "cURL error 60: SSL: no alternative certificate subject name matches target host name 'nextcloudpi' (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://nextcloudpi/ocm-provider/",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php",
        "line": 205,
        "function": "createRejection",
        "class": "GuzzleHttp\\Handler\\CurlFactory",
        "type": "::",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php",
        "line": 157,
        "function": "finishError",
        "class": "GuzzleHttp\\Handler\\CurlFactory",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlHandler.php",
        "line": 47,
        "function": "finish",
        "class": "GuzzleHttp\\Handler\\CurlFactory",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php",
        "line": 142,
        "function": "__invoke",
        "class": "GuzzleHttp\\Handler\\CurlHandler",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php",
        "line": 109,
        "function": "GuzzleHttp\\{closure}",
        "class": "GuzzleHttp\\Middleware",
        "type": "::",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php",
        "line": 35,
        "function": "OC\\Http\\Client\\{closure}",
        "class": "OC\\Http\\Client\\DnsPinMiddleware",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php",
        "line": 31,
        "function": "__invoke",
        "class": "GuzzleHttp\\PrepareBodyMiddleware",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php",
        "line": 71,
        "function": "GuzzleHttp\\{closure}",
        "class": "GuzzleHttp\\Middleware",
        "type": "::",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php",
        "line": 66,
        "function": "__invoke",
        "class": "GuzzleHttp\\RedirectMiddleware",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php",
        "line": 75,
        "function": "GuzzleHttp\\{closure}",
        "class": "GuzzleHttp\\Middleware",
        "type": "::",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php",
        "line": 333,
        "function": "__invoke",
        "class": "GuzzleHttp\\HandlerStack",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php",
        "line": 169,
        "function": "transfer",
        "class": "GuzzleHttp\\Client",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php",
        "line": 189,
        "function": "requestAsync",
        "class": "GuzzleHttp\\Client",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/Http/Client/Client.php",
        "line": 206,
        "function": "request",
        "class": "GuzzleHttp\\Client",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/OCM/OCMDiscoveryService.php",
        "line": 82,
        "function": "get",
        "class": "OC\\Http\\Client\\Client",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/apps/files_sharing/lib/External/Storage.php",
        "line": 66,
        "function": "discover",
        "class": "OC\\OCM\\OCMDiscoveryService",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/Mount/MountPoint.php",
        "line": 145,
        "function": "__construct",
        "class": "OCA\\Files_Sharing\\External\\Storage",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/Mount/MountPoint.php",
        "line": 170,
        "function": "createStorage",
        "class": "OC\\Files\\Mount\\MountPoint",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/Mount/MountPoint.php",
        "line": 271,
        "function": "getStorage",
        "class": "OC\\Files\\Mount\\MountPoint",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/Config/UserMountCache.php",
        "line": 65,
        "function": "getStorageRootId",
        "class": "OC\\Files\\Mount\\MountPoint",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/SetupManager.php",
        "line": 606,
        "function": "registerMounts",
        "class": "OC\\Files\\Config\\UserMountCache",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/SetupManager.php",
        "line": 295,
        "function": "registerMounts",
        "class": "OC\\Files\\SetupManager",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/SetupManager.php",
        "line": 211,
        "function": "afterUserFullySetup",
        "class": "OC\\Files\\SetupManager",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/Filesystem.php",
        "line": 332,
        "function": "setupForUser",
        "class": "OC\\Files\\SetupManager",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Cache/File.php",
        "line": 37,
        "function": "initMountPoints",
        "class": "OC\\Files\\Filesystem",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Cache/File.php",
        "line": 158,
        "function": "getStorage",
        "class": "OC\\Cache\\File",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/base.php",
        "line": 876,
        "function": "gc",
        "class": "OC\\Cache\\File",
        "type": "->"
      },
      {
        "function": "{closure}",
        "class": "OC",
        "type": "::",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/Hooks/EmitterTrait.php",
        "line": 88,
        "function": "call_user_func_array"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Hooks/PublicEmitter.php",
        "line": 22,
        "function": "emit",
        "class": "OC\\Hooks\\BasicEmitter",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/User/Session.php",
        "line": 350,
        "function": "emit",
        "class": "OC\\Hooks\\PublicEmitter",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/User/Session.php",
        "line": 585,
        "function": "completeLogin",
        "class": "OC\\User\\Session",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/User/Session.php",
        "line": 307,
        "function": "loginWithPassword",
        "class": "OC\\User\\Session",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/User/Session.php",
        "line": 405,
        "function": "login",
        "class": "OC\\User\\Session",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php",
        "line": 80,
        "function": "logClientIn",
        "class": "OC\\User\\Session",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Backend/AbstractBasic.php",
        "line": 103,
        "function": "validateUserPass",
        "class": "OCA\\DAV\\Connector\\Sabre\\Auth",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php",
        "line": 191,
        "function": "check",
        "class": "Sabre\\DAV\\Auth\\Backend\\AbstractBasic",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php",
        "line": 105,
        "function": "auth",
        "class": "OCA\\DAV\\Connector\\Sabre\\Auth",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php",
        "line": 179,
        "function": "check",
        "class": "OCA\\DAV\\Connector\\Sabre\\Auth",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php",
        "line": 135,
        "function": "check",
        "class": "Sabre\\DAV\\Auth\\Plugin",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
        "line": 89,
        "function": "beforeMethod",
        "class": "Sabre\\DAV\\Auth\\Plugin",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 456,
        "function": "emit",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Server.php",
        "line": 49,
        "function": "invokeMethod",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/dav/lib/Server.php",
        "line": 401,
        "function": "start",
        "class": "OCA\\DAV\\Connector\\Sabre\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/dav/appinfo/v2/remote.php",
        "line": 21,
        "function": "exec",
        "class": "OCA\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/remote.php",
        "line": 145,
        "args": [
          "/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php",
    "Line": 276,
    "message": "error while discovering ocm provider",
    "exception": [],
    "remote": "https://nextcloudpi",
    "CustomMessage": "error while discovering ocm provider"
  },
  "id": "68bd6eeb2ff67"
}

On my Ubuntu Desktop, I am accessing nextcloud via the external url (cloud.[mydomain].com).
However, it looks like my nextcloud instance is trying to access the ocm-provider via the local hostname nextcloudpi. As my letsencrypt-certificate is only valid for my external url, this leads to the error. (at least from what I understand)

How can I make nextcloud use either http for the local ocm-access or force the external url, for which the certificate is valid?

Configuration

  • Nextcloud Server version : 31.0.8
  • Operating system and version: Debian 12
  • Web server and version: 2.4.65-1
  • PHP version : 8.3.21
  • Installation method: NCP
  • Are you using CloudfIare, mod_security, or similar?: No
<?php
$CONFIG = array (
  'passwordsalt' => '[REMOVED]',
  'secret' => '[REMOVED]',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    5 => 'nextcloudpi.local',
    8 => 'nextcloudpi.lan',
    3 => 'cloud.{MYDOMAIN].com'
  ),
  
  'overwritehost' => 'cloud.{MYDOMAIN].com',
  'datadirectory' => '/mnt/truenas/ncdata',
  'allow_local_remote_servers'=>true,
  'dbtype' => 'mysql',
  'version' => '31.0.8.1',
  'overwrite.cli.url' => 'cloud.{MYDOMAIN].com',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '[REMOVED]',
  'dbpassword' => '[REMOVED]',
  'installed' => true,
  'instanceid' => '[REMOVED]',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',

  'redis' => 
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => '[REMOVED],
  ),
  'tempdirectory' => '/opt/ncdata/data/tmp',
  'mail_smtpmode' => 'sendmail',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'admin',
  'mail_domain' => 'ownyourbits.com',
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'maintenance' => false,
  'logfile' => '/mnt/truenas/nextcloud_log/nextcloudpi.log',
  'trusted_proxies' => 
  array (
    11 => '127.0.0.1',
    12 => '::1',
    14 => '109.250.27.125',
  ),
  'theme' => '',
  'loglevel' => '2',
  'log_type' => 'file',
);

Thank you very much for your help :slight_smile:

You should remove

0 => 'localhost',
5 => 'nextcloudpi.local',
8 => 'nextcloudpi.lan',

from the ‘trusted_domains’ array and set your local DNS so that cloud.{MYDOMAIN].com points to your server’s local IP.

Please read this 101 tutorials:

h.t.h.

Much and good luck,


ernolf

In general you are right but IMHO I think ncp “magically” adds this trusted domains itself. But I think it doesn’t do any harm if you proper setup splitbraindns - this local trusted domains just remain unused..

That may be the case, but it’s simply wrong. It’s a relic from the days when Nextcloud could be run without TLS. If you use TLS (and the new server code absolutely relies on it to function corectly), then it simply doesn’t work anymore. So those “magically created errors” should be removed without magic. :wink:

Thank you very much for your answers.
I removed the unnecessary entries from the array.
After restarting the server, ‘nextcloudpi’ was automatically added again. I removed it and restarted just the apache-service, but the error still retains.
cloud.{myserver}.com is reachable from the public internet.

Could there be some other missconfiguration which leads to such an error?

Please double check your DNS and hosts - maybe you have added you public domain together with the local hostname there and for this reason dav client connects to the local name..