{"record":{"id":"09dc4079336b625d","repo":"passbolt/passbolt_api","slug":"could-not-delete-the-sso-settings","errorCode":null,"errorMessage":"Could not delete the SSO settings.","messagePattern":"Could not delete the SSO settings\\.","errorType":"exception","errorClass":"InternalErrorException","httpStatus":500,"severity":"critical","filePath":"plugins/PassboltEe/Sso/src/Service/SsoSettings/SsoSettingsDeleteService.php","lineNumber":68,"sourceCode":"            throw new BadRequestException(__('The SSO setting id should be a uuid.'));\n        }\n        $uac->assertIsAdmin();\n\n        $ssoSettingsTable = TableRegistry::getTableLocator()->get('Passbolt/Sso.SsoSettings');\n\n        try {\n            /** @var \\Passbolt\\Sso\\Model\\Entity\\SsoSetting $ssoSetting */\n            $ssoSetting = $ssoSettingsTable->find()->where(['id' => $id])->firstOrFail();\n        } catch (RecordNotFoundException $exception) {\n            throw new NotFoundException(__('The SSO setting does not exist.'), 404, $exception);\n        }\n\n        try {\n            $ssoSettingsTable->deleteQuery()\n                ->where(['id' => $id])\n                ->execute();\n        } catch (Exception $exception) {\n            throw new InternalErrorException(__('Could not delete the SSO settings.'), 500, $exception);\n        }\n\n        // Notify other administrators if an active policy was changed\n        if ($ssoSetting->status === SsoSetting::STATUS_ACTIVE) {\n            $event = new Event(\n                self::AFTER_DELETE_ACTIVE_SSO_SETTINGS_EVENT,\n                $this,\n                ['uac' => $uac, 'ssoSetting' => $ssoSetting]\n            );\n            $ssoSettingsTable->getEventManager()->dispatch($event);\n        }\n    }\n\n    /**\n     * Delete all draft settings\n     *\n     * @param string $id uuid\n     * @throws \\Cake\\Http\\Exception\\InternalErrorException if the settings could not be deleted","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltEe/Sso/src/Service/SsoSettings/SsoSettingsDeleteService.php#L50-L86","documentation":"Thrown when the deleteQuery()->execute() on SsoSettings fails with a generic exception inside delete(). It wraps the cause as InternalErrorException (500), meaning input was valid but the persistence layer failed.","triggerScenarios":"Database connection failure, lock wait timeout, FK constraint (e.g. dependent sso_states/auth tokens not cascading), or trigger errors during the DELETE.","commonSituations":"InnoDB lock timeouts under concurrent admin actions; missing migration leaving orphaned related rows blocking the delete; replica/disk issues.","solutions":["Check the wrapped previous exception in logs for the SQL error","Run pending migrations and verify cascading deletes on related SSO tables","Retry after resolving the database lock/outage"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { $service->delete($uac, $id); } catch (InternalErrorException $e) { Log::error($e->getPrevious()); // retry after DB recovery }","preventionTips":["Keep migrations current","Watch for lock contention on sso_settings","Verify FK cascade rules on related tables"],"tags":["sso","database","internal-error","passbolt"],"backgroundTag":"database-write-failed","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"}