{"record":{"id":"ed4f3ab8ee07b1f6","repo":"passbolt/passbolt_api","slug":"the-schema-s-is-invalid-or-not-supported","errorCode":null,"errorMessage":"The Schema `%s` is invalid or not supported","messagePattern":"The Schema `(.+?)` is invalid or not supported","errorType":"exception","errorClass":"Cake\\Http\\Exception\\NotFoundException","httpStatus":404,"severity":"error","filePath":"plugins/PassboltEe/Scim/src/Controller/V2/ScimSchemasController.php","lineNumber":41,"sourceCode":"use Passbolt\\Scim\\Utility\\Schemas;\n\nclass ScimSchemasController extends AbstractScimController\n{\n    /**\n     * /Schemas SCIM Endpoint (Unauthenticated)\n     *  - GET /Schemas return User and Group Schemas\n     *  - GET /Schemas/urn:ietf:params:scim:schemas:core:2.0:User return User Schema\n     *  - GET /Schemas/urn:ietf:params:scim:schemas:core:2.0:Group return Group Schema\n     *\n     * @param string $settingId Org Setting Id\n     * @param string|null $schemaId Schema Id\n     * @return void\n     */\n    public function schemas(string $settingId, ?string $schemaId = null): void\n    {\n        try {\n            if ($schemaId && !Schemas::isValid($schemaId)) {\n                throw new NotFoundException(sprintf('The Schema `%s` is invalid or not supported', $schemaId));\n            }\n\n            if ($schemaId) {\n                $responseData = Schemas::build($schemaId);\n            } else {\n                $schemas = Schemas::getAll();\n                $responseData = new ListResponse($schemas, totalResults: count($schemas));\n            }\n            $this->processResponse($settingId, $responseData);\n        } catch (Exception $e) {\n            $this->processException($settingId, $e);\n        }\n    }\n}\n","sourceCodeStart":23,"sourceCodeEnd":56,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltEe/Scim/src/Controller/V2/ScimSchemasController.php#L23-L56","documentation":"NotFoundException thrown by ScimSchemasController::schemas when a specific schemaId is requested but Schemas::isValid() does not recognize it. Only the SCIM schemas this implementation defines (e.g. core user/group schemas) are valid; unknown URIs/ids are rejected.","triggerScenarios":"GET /scim/v2/<settingId>/Schemas/<schemaId> where <schemaId> is not one of the supported schema identifiers (wrong URI, typo, or schema from a different SCIM provider).","commonSituations":"SCIM client discovery references schemas (e.g. EnterpriseUser, custom extension schemas) that Passbolt does not implement; truncated or mangled schema URI in the client config.","solutions":["Request the full schema list first (omit the schemaId segment) and use an identifier from that response","Use the exact schema URI/id returned by the discovery endpoint","Remove unsupported schema references from the SCIM client configuration"],"exampleFix":"// before\nGET /scim/v2/<id>/Schemas/urn:ietf:params:scim:schemas:core:2.0:EnterpriseUser\n// after\nGET /scim/v2/<id>/Schemas\n// pick a supported schema from the returned list, e.g.\nGET /scim/v2/<id>/Schemas/urn:ietf:params:scim:schemas:core:2.0:User","handlingStrategy":"validation","validationCode":"const SUPPORTED_SCHEMAS = ['urn:ietf:params:scim:schemas:core:2.0:User','urn:ietf:params:scim:schemas:core:2.0:Group'];\nif (schemaId && !SUPPORTED_SCHEMAS.includes(schemaId)) throw new Error(`Unsupported schema: ${schemaId}`);","typeGuard":null,"tryCatchPattern":"try { await getScimSchema(settingId, schemaId); } catch (e) { if (e.status === 404) console.warn(`Schema ${schemaId} not supported, use discovery`); else throw e; }","preventionTips":["Fetch the schema list first and use identifiers verbatim from it","Do not assume third-party SCIM extension schemas exist on Passbolt","Keep the SCIM client's schema registry in sync with server discovery output"],"tags":["scim","not-found","schemas"],"backgroundTag":"invalid-enum-value","analyzedSha":"31c1bbc10f32808a607fa9bd81891e898779c0bc","analyzedAt":"2026-09-17T00:04:38.960Z","contentChangedAt":"2026-09-17T00:04:38.960Z","schemaVersion":2},"datasetVersion":"2026-09-21T09:17:21.228Z"}