passbolt/passbolt_api · critical · InternalErrorException
Could not delete the draft SSO settings.
Error message
Could not delete the draft SSO settings.
What it means
deleteAllBut() removes every SSO settings row whose id differs from the kept $id (used after activating one policy to purge other drafts). Any exception in that bulk delete is wrapped as InternalErrorException 'Could not delete the draft SSO settings.'
Solutions
- Inspect the wrapped previous exception for the failing SQL/row
- Clear orphaned related rows (sso_states, auth tokens) then retry
- Run migrations and retry activation; consider chunked deletes for large tables
Defensive patterns
Strategy: try-catch
Try / catch
try { (new SsoSettingsDeleteService())->deleteAllBut($id); } catch (InternalErrorException $e) { Log::error($e->getPrevious()); // cleanup orphans, retry } Prevention
- Clean orphaned sso related rows regularly
- Keep table transactions short to avoid lock timeouts
- Run migrations before activation flows
When it happens
Trigger: Bulk DELETE ... WHERE id <> :id failing due to database errors, FK constraints on related sso tables, or connection loss — raised indirectly when activate() calls deleteAllBut().
Common situations: Orphaned rows referencing settings blocking the delete; long-running lock on the table from another transaction; schema drift after partial migrations.
Related errors
- Could not delete the SSO settings.
- Could not update the SSO settings.
- Could not delete the role, please try again later.
- Could not save the role, please try again later.
- Could not save the SSO state, please try again later.
AI-assisted analysis of passbolt/passbolt_api@31c1bbc10f (2026-09-17).
Data as JSON: /api/errors/8469c60b8ab0bf74.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/PassboltEe/Sso/src/Service/SsoSettings/SsoSettingsDeleteService.php:97
}
}
/**
* Delete all draft settings
*
* @param string $id uuid
* @throws \Cake\Http\Exception\InternalErrorException if the settings could not be deleted
* @return void
*/
public function deleteAllBut(string $id): void
{
try {
$ssoSettingsTable = TableRegistry::getTableLocator()->get('Passbolt/Sso.SsoSettings');
$ssoSettingsTable->deleteQuery()
->where(['id <>' => $id])
->execute();
} catch (Exception $exception) {
throw new InternalErrorException(__('Could not delete the draft SSO settings.'), 500, $exception);
}
}
}
View on GitHub (pinned to 31c1bbc10f)