{"record":{"id":"568ea21da9182549","repo":"passbolt/passbolt_api","slug":"the-scim-plugin-is-disabled","errorCode":null,"errorMessage":"The SCIM plugin is disabled.","messagePattern":"The SCIM plugin is disabled\\.","errorType":"exception","errorClass":"Cake\\Http\\Exception\\NotFoundException","httpStatus":404,"severity":"error","filePath":"plugins/PassboltEe/Scim/src/Service/ScimSetSettingsService.php","lineNumber":82,"sourceCode":"            }\n            $data['id'] = $id;\n        }\n\n        // Using this approach to avoid checking for setting_id duplicates on update\n        $validate = $id ? 'update' : 'extended';\n        if (!$form->execute($data, ['validate' => $validate])) {\n            throw new FormValidationException(\n                __('Could not validate the SCIM settings.'),\n                $form\n            );\n        }\n\n        /** @var \\Passbolt\\Scim\\Model\\Table\\ScimSettingsTable $scimSettingsTable */\n        $scimSettingsTable = $this->fetchTable('Passbolt/Scim.ScimSettings');\n        /** @var \\Passbolt\\Scim\\Model\\Entity\\ScimSetting|null $current */\n        $current = $scimSettingsTable->find()->first();\n        if (!$current && $id) {\n            throw new NotFoundException(__('The SCIM plugin is disabled.'));\n        }\n        if (!$id && $current) {\n            throw new BadRequestException(__('Please delete previous settings before creating again.'));\n        }\n        if ($current && $current->id !== $id) {\n            throw new NotFoundException(__('The uuid in the url doesn\\'t match any known setting record.'));\n        }\n\n        $currentValue = [];\n        $isDummyToken = $rawSecretToken === self::SCIM_SECRET_TOKEN_DUMMY;\n        if ($current) {\n            $currentValue = $this->decryptSettings($current);\n            $form->set('setting_id', Hash::get($currentValue, 'setting_id'));\n            if (!$form->getData('secret_token') || $isDummyToken) {\n                $form->set('secret_token', Hash::get($currentValue, 'secret_token'));\n            }\n        }\n","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltEe/Scim/src/Service/ScimSetSettingsService.php#L64-L100","documentation":"After form validation, saveSettings() loads the single current scim_settings row. If no row exists (plugin effectively not configured) but the client supplied an $id to update, it throws NotFoundException with the (somewhat confusing) message 'The SCIM plugin is disabled.' — the record being updated does not exist.","triggerScenarios":"PUT /scim-settings/<uuid> (or DELETE-style update flows) when the scim_settings table is empty — i.e., SCIM settings were never created or were already deleted.","commonSituations":"Client caching a settings id from a previous installation or after another admin deleted the settings; racing two admins where one deletes while the other updates; scripts replaying recorded PUT requests against a fresh instance.","solutions":["Call GET /scim-settings first; if it returns no settings, create them with POST instead of PUT.","Refresh the client's cached settings id after any deletion — the old UUID is permanently invalid.","Enable/configure the SCIM plugin if it was expected to be configured on this instance."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const settings = await (await fetch('/scim-settings.json')).json();\nif (!settings.data) {\n  // no settings row exists: use POST create, never PUT\n}","typeGuard":null,"tryCatchPattern":"try {\n  await api.put(`/scim-settings/${id}.json`, payload);\n} catch (e) {\n  if (e.response?.status === 404) {\n    const { data } = await api.get('/scim-settings.json');\n    if (!data) await api.post('/scim-settings.json', payload); // create instead\n  }\n}","preventionTips":["Re-fetch current settings before every update; never trust cached ids across sessions.","Check existence with GET before deciding PUT vs POST.","Handle concurrent admin deletes by treating 404 as 'create instead'."],"tags":["scim","php","not-found","rest"],"backgroundTag":"resource-not-found","analyzedSha":"31c1bbc10f32808a607fa9bd81891e898779c0bc","analyzedAt":"2026-09-17T00:04:38.960Z","contentChangedAt":"2026-09-17T00:04:38.960Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}