passbolt/passbolt_api · error · ValidationException
It is not possible to save the SSO settings.
Error message
It is not possible to save the SSO settings.
What it means
After form validation, create() builds the SsoSetting entity and saves it via the table; if the entity has validation/application-rule errors or save() returns false, it throws ValidationException 'It is not possible to save the SSO settings.' carrying the entity's errors. This indicates persistence-level failure rather than form-level validation.
Solutions
- Read the entity errors attached to the ValidationException to identify the failing field or rule.
- Run pending migrations (ddev refresh / bin/cake migrations migrate) so the sso_settings schema is current.
- Resolve conflicting records (e.g. delete or complete an existing draft/active settings that violates uniqueness rules).
- Check database connectivity/health if save() fails without field errors (DB down, disk full, lock timeouts).
Example fix
// before $data = $form->getData(); // saved with stale duplicate draft present -> build rule fails // after $existing = $service->getDraftByIdOrFail($draftId); // complete/delete existing draft first $service->create($uac, $data);
Defensive patterns
Strategy: try-catch
Validate before calling
// check for conflicting existing records before saving $existingActive = $settingsTable->find()->where(['status' => 'active'])->count(); $duplicateDrafts = $settingsTable->find()->where(['status' => 'draft'])->all();
Try / catch
try { $service->create($uac, $data); } catch (ValidationException $e) { $entityErrors = $e->getEntity()->getErrors(); // fix rule violations or DB state } Prevention
- Run migrations after upgrading so the sso_settings schema is current
- Complete or delete stale drafts before creating new settings
- Inspect entity errors on the exception before retrying
- Monitor database health (connectivity, locks, disk) for unexplained save failures
When it happens
Trigger: Database constraint violations (e.g. uniqueness rules on active settings), build rules failing on the table, database connectivity/schema issues causing save() to return false with errors set.
Common situations: Another active SSO settings record conflicts with the one being saved; DB migration not run so columns are missing; duplicate concurrent draft creation by two admins; database in read-only/troubled state.
Related errors
- Could not save the SSO state, please try again later.
- Could not delete the draft SSO settings.
- Could not delete the SSO settings.
- Could not save permission history.
- Could not save the action.
AI-assisted analysis of passbolt/passbolt_api@31c1bbc10f (2026-09-17).
Data as JSON: /api/errors/ee0e72a84f8f8d50.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/PassboltEe/Sso/src/Service/SsoSettings/SsoSettingsSetService.php:91
'created_by' => $uac->getId(),
'modified_by' => $uac->getId(),
],
[
'accessibleFields' => [
'provider' => true,
'status' => true,
'data' => true,
'created_by' => true,
'modified_by' => true,
],
]
);
// Check for validation or build rules errors
$errors = $ssoSettingEntity->getErrors();
if (!empty($errors) || !$ssoSettingsTable->save($ssoSettingEntity)) {
$msg = __('It is not possible to save the SSO settings.');
throw new ValidationException($msg, $ssoSettingEntity, $ssoSettingsTable);
}
return new SsoSettingsDto($ssoSettingEntity, $data['data']);
}
/**
* @param string $provider provider name
* @param array $data provider configuration data
* @return string
*/
protected function serializeData(string $provider, array $data): string
{
$dataDto = SsoSettingsDto::ssoSettingsDataDtoFactory($provider, $data);
$result = json_encode($dataDto->toArray());
if (!$result) {
throw new InternalErrorException(__('It is not possible to save the SSO settings.'));
}View on GitHub (pinned to 31c1bbc10f)