passbolt/passbolt_api · critical · InternalErrorException
The metadata private key could not be updated. Please try…
Error message
The metadata private key could not be updated. Please try again later.
What it means
InternalErrorException (500) thrown when the save of the patched metadata private key returns false without entity validation errors, i.e. an unexpected persistence failure. The message tells the caller it is a transient server-side issue and to retry later.
Solutions
- Retry the request after a short delay, as the message suggests.
- Check server logs (cake error logs / database logs) for the underlying DB error.
- Verify database connectivity, credentials, and that migrations are up to date (`ddev refresh`).
- If persistent, inspect MetadataPrivateKeysTable beforeSave rules and DB constraints for hidden failures.
Defensive patterns
Strategy: retry
Try / catch
catch (InternalErrorException) { // 500
await delay(backoff++);
return retryUpdate(id, payload, maxRetries = 3);
} Prevention
- Implement exponential backoff retry for 500s
- Monitor server DB health and logs
- Keep schema migrations in sync with the server version
When it happens
Trigger: update() calls save() which returns false with no validation errors — e.g. database connection failure, lock timeout, transaction/trigger failure, or constraint violation not surfaced as a validation error.
Common situations: Database server overloaded or temporarily down; migration drift between server version and schema; DB user lacking write privileges; deadlock under concurrent updates.
Related errors
- Could not save the metadata key, please try again later.
- Could not save the metadata session key, please try again…
- Could not save the metadata session keys, please try again…
- Could not save the rbacs, please try again later.
- 500
AI-assisted analysis of passbolt/passbolt_api@31c1bbc10f (2026-09-17).
Data as JSON: /api/errors/bde8f46c12c63479.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/PassboltCe/Metadata/src/Service/MetadataPrivateKeysUpdateService.php:92
'modified_by' => $uac->getId(),
], [
'accessibleFields' => [
'data' => true,
'modified_by' => true,
],
]);
if (!empty($metadataPrivateKey->getErrors())) {
$this->handleValidationErrors($metadataPrivateKey, $metadataPrivateKeysTable);
}
$updated = $metadataPrivateKeysTable->save($metadataPrivateKey);
if ($updated === false) {
if (!empty($metadataPrivateKey->getErrors())) {
$this->handleValidationErrors($metadataPrivateKey, $metadataPrivateKeysTable);
}
$msg = __('The metadata private key could not be updated.') . ' ';
$msg .= __('Please try again later.');
throw new InternalErrorException($msg);
}
return $updated;
}
/**
* Handle validation or build rules failure
*
* @param \Passbolt\Metadata\Model\Entity\MetadataPrivateKey $entity that is failing the validation
* @param \Passbolt\Metadata\Model\Table\MetadataPrivateKeysTable $table table
* @throws \App\Error\Exception\ValidationException
* @return void
*/
public function handleValidationErrors(MetadataPrivateKey $entity, MetadataPrivateKeysTable $table): void
{
if (Configure::read('debug')) {
Log::error(json_encode($entity->getErrors()));
}View on GitHub (pinned to 31c1bbc10f)