passbolt/passbolt_api · error · InternalErrorException
Could not retrieve the password policies.
Error message
Could not retrieve the password policies.
What it means
InternalErrorException thrown by PasswordPoliciesSettingsGetController::get when the underlying PasswordPoliciesGetSettingsService::get() throws any Throwable. The original error is logged, and a generic 500 is returned to the client.
Solutions
- Check the error log for the original Throwable message logged by the controller (Log::error).
- Initialize/save password policies via POST /password-policies/settings if none exist yet.
- Verify database connectivity and that migrations ran (bin/cake migrate).
- If the stored payload is corrupted, fix the organization_settings row or re-save valid policies.
Defensive patterns
Strategy: try-catch
Validate before calling
$res = await fetch('/password-policies/settings'); if (!res.ok) { checkServerLogsForOriginalError(); } Try / catch
try { await api.getPasswordPolicies(); } catch (HttpError e) { if (e.status === 500) { // read server log for root cause } } Prevention
- Save password policies once before relying on GET.
- Monitor server logs, since the client sees only a generic 500.
- Keep database connections healthy and migrations current.
When it happens
Trigger: GET /password-policies/settings when the service throws — e.g. no saved policies record found, malformed stored policy JSON, or a database error while reading organization settings.
Common situations: Password policies never configured (nothing to get), corrupted policy payload saved by an older version, or database connectivity problems on the instance.
Understand the failure class
Background: "invalid response format", "malformed payload", "missing data field": when an API returns 200 but the response shape is wrong — this error's family across 23 libraries.
Related errors
- Could not retrieve the user passphrase policies.
- Could not validate the password policies settings.
- The Email Notification Settings configs are invalid
- 500
- AccessToken should be an instance of BaseIdToken class.
AI-assisted analysis of passbolt/passbolt_api@31c1bbc10f (2026-09-17).
Data as JSON: /api/errors/097d077ccf909b1f.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/PassboltCe/PasswordPolicies/src/Controller/PasswordPoliciesSettingsGetController.php:41
use Passbolt\PasswordPolicies\Service\PasswordPoliciesGetSettingsInterface;
use Throwable;
class PasswordPoliciesSettingsGetController extends AppController
{
/**
* Returns passwords policies settings.
*
* @param \Passbolt\PasswordPolicies\Service\PasswordPoliciesGetSettingsInterface $passwordPoliciesGetSettingsService Service.
* @return void
*/
public function get(PasswordPoliciesGetSettingsInterface $passwordPoliciesGetSettingsService)
{
try {
$passwordPoliciesSettingsDto = $passwordPoliciesGetSettingsService->get();
$this->success(__('The operation was successful.'), $passwordPoliciesSettingsDto->toArray());
} catch (Throwable $error) {
Log::error($error->getMessage());
throw new InternalErrorException(__('Could not retrieve the password policies.'));
}
}
}
View on GitHub (pinned to 31c1bbc10f)