{"record":{"id":"0619eb8ced04d15b","repo":"passbolt/passbolt_api","slug":"the-uuid-in-the-url-doesn-t-match-any-known-setting-record","errorCode":null,"errorMessage":"The uuid in the url doesn't match any known setting record.","messagePattern":"The uuid in the url doesn't match any known setting record\\.","errorType":"exception","errorClass":"Cake\\Http\\Exception\\NotFoundException","httpStatus":404,"severity":"error","filePath":"plugins/PassboltEe/Scim/src/Service/ScimSetSettingsService.php","lineNumber":88,"sourceCode":"        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\n        $settingsData = $form->getData();\n        $isTokenRotated = $this->isTokenRotated($rawSecretToken, $currentValue);\n        if (!$current || $isTokenRotated) {\n            $settingsData['expired'] = $this->computeExpiredDate();\n        } else {\n            $settingsData['expired'] = Hash::get($currentValue, 'expired');","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltEe/Scim/src/Service/ScimSetSettingsService.php#L70-L106","documentation":"saveSettings() guards updates against stale identifiers: when a current settings row exists and the $id from the URL differs from $current->id, it throws NotFoundException because the UUID in the URL doesn't reference the existing record. Since only one row can exist, any other UUID is by definition unknown.","triggerScenarios":"PUT /scim-settings/<uuid> where <uuid> is a valid UUID but not the id of the single row in scim_settings — e.g. an id from a previous configuration or a fabricated UUID.","commonSituations":"Clients holding a stale id after settings were deleted and recreated (new row = new UUID); copy-pasted ids from docs or another environment; testing against a fresh database with ids from production.","solutions":["Re-fetch GET /scim-settings to obtain the current id and retry the PUT with it.","If the settings were deleted and recreated, discard all cached ids and re-provision against the new record.","If no update is intended, verify you are not accidentally treating a create call as an update by passing a stale $id parameter."],"exampleFix":"// before\nawait api.put(`/scim-settings/${staleId}.json`, payload);\n// after\nconst { data } = await api.get('/scim-settings.json');\nawait api.put(`/scim-settings/${data.id}.json`, payload);","handlingStrategy":"validation","validationCode":"const { data: current } = await api.get('/scim-settings.json');\nif (current && current.id !== suppliedId) {\n  suppliedId = current.id; // refresh to the live record's UUID\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    await api.put(`/scim-settings/${data.id}.json`, payload);\n  }\n}","preventionTips":["Always resolve the id via GET /scim-settings immediately before PUT.","Invalidate cached settings ids after delete/recreate operations.","Never copy ids between environments — each install has its own row UUID."],"tags":["scim","php","not-found","stale-state"],"backgroundTag":"record-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"}