{"record":{"id":"35cc9f4698f2bcb6","repo":"nextcloud/server","slug":"class-msg","errorCode":null,"errorMessage":"$class: $msg","messagePattern":"\\$class: \\$msg","errorType":"exception","errorClass":"Sabre\\DAV\\Exception\\ServiceUnavailable","httpStatus":503,"severity":"critical","filePath":"apps/dav/lib/Connector/Sabre/Auth.php","lineNumber":122,"sourceCode":"\t\t}\n\t}\n\n\t/**\n\t * @return array{bool, string}\n\t * @throws NotAuthenticated\n\t * @throws ServiceUnavailable\n\t */\n\t#[\\Override]\n\tpublic function check(RequestInterface $request, ResponseInterface $response) {\n\t\ttry {\n\t\t\treturn $this->auth($request, $response);\n\t\t} catch (NotAuthenticated $e) {\n\t\t\tthrow $e;\n\t\t} catch (Exception $e) {\n\t\t\t$class = get_class($e);\n\t\t\t$msg = $e->getMessage();\n\t\t\tServer::get(LoggerInterface::class)->error($e->getMessage(), ['exception' => $e]);\n\t\t\tthrow new ServiceUnavailable(\"$class: $msg\");\n\t\t}\n\t}\n\n\t/**\n\t * Checks whether a CSRF check is required on the request\n\t */\n\tprivate function requiresCSRFCheck(): bool {\n\n\t\t$methodsWithoutCsrf = ['GET', 'HEAD', 'OPTIONS'];\n\t\tif (in_array($this->request->getMethod(), $methodsWithoutCsrf)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Official Nextcloud clients require no checks\n\t\tif ($this->request->isUserAgent([\n\t\t\tIRequest::USER_AGENT_CLIENT_DESKTOP,\n\t\t\tIRequest::USER_AGENT_CLIENT_ANDROID,\n\t\t\tIRequest::USER_AGENT_CLIENT_IOS,","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/Connector/Sabre/Auth.php#L104-L140","documentation":"Auth::check() lets NotAuthenticated pass through, but converts every other exception thrown inside the DAV authentication pipeline into ServiceUnavailable (HTTP 503) formatted \"<exceptionClass>: <message>\", after logging the original exception. The message therefore names the real failure inside auth (LDAP bind, token validation, custom backend); the request never authenticated. This is a server-side outage signature, not a client error.","triggerScenarios":"LDAP/AD backend unreachable or timing out during bind; user/session database errors inside token validation; exceptions thrown by a misconfigured or incompatible custom auth backend or SSO app; anything exploding during auth that is not a clean 'not authenticated' verdict.","commonSituations":"LDAP server down or certificate expired towards Active Directory; database locks during login storms; auth app updates that skip migrations or mismatch the server version.","solutions":["Open nextcloud.log: the original exception with trace is logged right before the 503; its class name identifies the failing component.","For LDAP backends, run occ ldap:test-config and verify server reachability, credentials, and certificates.","For auth apps, confirm version compatibility and that migrations ran (occ migrations:status).","Clients should treat the 503 as transient and retry with backoff once the backend is restored."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"for ($attempt = 1; $attempt <= 3; $attempt++) {\n    try {\n        return $client->request('PROPFIND', '/remote.php/dav/comments/files/123/', []);\n    } catch (ServiceUnavailable $e) { // 503 \"<class>: <msg>\" — auth backend failing\n        error_log('DAV auth backend failing: ' . $e->getMessage());\n        sleep(2 ** $attempt); // backoff; server-side outage, retry later\n    }\n}\nthrow new RuntimeException('DAV auth backend unavailable');","preventionTips":["Monitor LDAP/DB health so auth backends fail loudly before users notice.","Alert on clustered 503s from remote.php — they indicate backend trouble, not client mistakes.","Keep auth apps and their migrations in lockstep with the server version."],"tags":["dav","authentication","ldap","service-unavailable"],"backgroundTag":"authentication-backend-failure","analyzedSha":"ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3","analyzedAt":"2026-08-17T01:36:13.386Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}