{"record":{"id":"617f4a524d282e95","repo":"passbolt/passbolt_api","slug":"the-password-expiry-setting-does-not-exist","errorCode":null,"errorMessage":"The password expiry setting does not exist.","messagePattern":"The password expiry setting does not exist\\.","errorType":"http","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"plugins/PassboltCe/PasswordExpiry/src/Service/Settings/PasswordExpiryDeleteSettingsService.php","lineNumber":48,"sourceCode":"\n    /**\n     * Deletes Password expiry settings.\n     *\n     * @param \\App\\Utility\\ExtendedUserAccessControl $uac UAC.\n     * @param string $id Setting ID.\n     * @return bool\n     * @throws \\Cake\\Http\\Exception\\NotFoundException When the ID is not found.\n     * @throws \\Cake\\ORM\\Exception\\PersistenceFailedException When the entity could not be deleted.\n     */\n    public function delete(UserAccessControl $uac, string $id): bool\n    {\n        /** @var \\Passbolt\\PasswordExpiry\\Model\\Table\\PasswordExpirySettingsTable $passwordExpirySettingsTable */\n        $passwordExpirySettingsTable = $this->fetchTable('Passbolt/PasswordExpiry.PasswordExpirySettings');\n\n        try {\n            $setting = $passwordExpirySettingsTable->get($id);\n        } catch (Throwable $exception) {\n            throw new NotFoundException(__('The password expiry setting does not exist.'));\n        }\n\n        $result = $passwordExpirySettingsTable->deleteOrFail($setting);\n\n        /** Dispatch settings updated event. */\n        $this->dispatchEvent(PasswordExpirySetSettingsService::EVENT_SETTINGS_UPDATED, compact('uac'), $setting);\n\n        return $result;\n    }\n}\n","sourceCodeStart":30,"sourceCodeEnd":59,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltCe/PasswordExpiry/src/Service/Settings/PasswordExpiryDeleteSettingsService.php#L30-L59","documentation":"NotFoundException thrown by PasswordExpiryDeleteSettingsService::delete when the PasswordExpirySettingsTable::get($id) call fails for any reason, meaning no password expiry setting row exists with the given UUID.","triggerScenarios":"Calling delete with a well-formed UUID that does not correspond to an existing password_expiry_settings row, or a database error during get (the Throwable is swallowed and converted to 404).","commonSituations":"Deleting a setting that was already deleted by another admin, stale ids cached in the UI, or a database connectivity problem misreported as not-found.","solutions":["Fetch the current setting id via GET /password-expiry/settings and retry with a valid id.","Check the database log to confirm the underlying Throwable was not a connection error being masked as 404.","Refresh the admin UI so it lists current settings rather than stale ids.","If the setting genuinely exists, inspect the password_expiry_settings table for the row."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"$exists = $table->exists(['id' => $id]); if (!$exists) { return; }","typeGuard":"function isValidUuid(string $v): bool { return (bool)preg_match('/^[0-9a-f-]{36}$/i', $v); }","tryCatchPattern":"try { $service->delete($uac, $id); } catch (NotFoundException $e) { // refetch setting id and retry }","preventionTips":["Refetch settings ids before each delete call.","Handle concurrent admin deletions idempotently (treat 404 as success).","Check DB logs to distinguish true not-found from connection errors."],"tags":["password-expiry","not-found","delete"],"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"}