passbolt/passbolt_api · error · Cake\Http\Exception\NotFoundException
The Schema ` ` is invalid or not supported
Error message
The Schema `%s` is invalid or not supported
What it means
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.
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
Example fix
// before GET /scim/v2/<id>/Schemas/urn:ietf:params:scim:schemas:core:2.0:EnterpriseUser // after GET /scim/v2/<id>/Schemas // pick a supported schema from the returned list, e.g. GET /scim/v2/<id>/Schemas/urn:ietf:params:scim:schemas:core:2.0:User
Defensive patterns
Strategy: validation
Validate before calling
const SUPPORTED_SCHEMAS = ['urn:ietf:params:scim:schemas:core:2.0:User','urn:ietf:params:scim:schemas:core:2.0:Group'];
if (schemaId && !SUPPORTED_SCHEMAS.includes(schemaId)) throw new Error(`Unsupported schema: ${schemaId}`); Try / catch
try { await getScimSchema(settingId, schemaId); } catch (e) { if (e.status === 404) console.warn(`Schema ${schemaId} not supported, use discovery`); else throw e; } Prevention
- 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
When it happens
Trigger: 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).
Common situations: 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.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- The ResourceType ` ` is invalid or not supported
- The resource with id ` ` is already deleted
- The resource with id ` ` was not found
- The SCIM plugin is disabled.
- The SCIM setting does not exist.
AI-assisted analysis of passbolt/passbolt_api@31c1bbc10f (2026-09-17).
Data as JSON: /api/errors/ed4f3ab8ee07b1f6.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/PassboltEe/Scim/src/Controller/V2/ScimSchemasController.php:41
use Passbolt\Scim\Utility\Schemas;
class ScimSchemasController extends AbstractScimController
{
/**
* /Schemas SCIM Endpoint (Unauthenticated)
* - GET /Schemas return User and Group Schemas
* - GET /Schemas/urn:ietf:params:scim:schemas:core:2.0:User return User Schema
* - GET /Schemas/urn:ietf:params:scim:schemas:core:2.0:Group return Group Schema
*
* @param string $settingId Org Setting Id
* @param string|null $schemaId Schema Id
* @return void
*/
public function schemas(string $settingId, ?string $schemaId = null): void
{
try {
if ($schemaId && !Schemas::isValid($schemaId)) {
throw new NotFoundException(sprintf('The Schema `%s` is invalid or not supported', $schemaId));
}
if ($schemaId) {
$responseData = Schemas::build($schemaId);
} else {
$schemas = Schemas::getAll();
$responseData = new ListResponse($schemas, totalResults: count($schemas));
}
$this->processResponse($settingId, $responseData);
} catch (Exception $e) {
$this->processException($settingId, $e);
}
}
}
View on GitHub (pinned to 31c1bbc10f)