passbolt/passbolt_api · critical · InternalErrorException
Could not ignore the record, please try again later.
Error message
Could not ignore the record, please try again later.
What it means
Thrown when the final $this->save() of the new DirectoryIgnore entity returns false despite validation and rules passing. This is an InternalErrorException: an unexpected persistence failure, not a client mistake — passbolt asks the caller to retry later.
Solutions
- Retry the request after a short delay, as the message suggests.
- Check database connectivity/health and server logs for the underlying SQL error.
- For the concurrency race, use createOrFail inside a transaction with try/catch and treat 'duplicate key' as already-ignored success, or check existence atomically.
- Verify the DB user has INSERT privileges on the directory_ignore table.
Example fix
// before
$ignore = $this->DirectoryIgnore->createOrFail('User', $userId);
// after
try {
$ignore = $this->DirectoryIgnore->createOrFail('User', $userId);
} catch (InternalErrorException $e) {
// retry once or surface 500 with correlation id
} Defensive patterns
Strategy: retry
Validate before calling
$dbUp = $this->DirectoryIgnore->getConnection()->isConnected(); // plus a cheap SELECT 1 health probe before batch operations
Try / catch
try {
$ignore = $this->DirectoryIgnore->createOrFail('User', $userId);
} catch (Cake\Http\Exception\InternalErrorException $e) {
// retry with backoff; on repeated failure check DB health and server logs
} Prevention
- Wrap ignore operations in a transaction to close the check-then-insert race
- Treat duplicate-key errors on retry as already-ignored success
- Monitor DB connectivity, disk space, and read-only state before sync jobs
- Retry transient save failures with exponential backoff
When it happens
Trigger: save() failing due to database-level issues: connection failure, lock timeout, a duplicate primary key inserted concurrently between the initial existence check and the save, or a database constraint violation not caught by validation.
Common situations: Two concurrent ignore requests for the same record (race on the existence check then duplicate PK on insert); MySQL/Postgres outage or replication lag; database in read-only mode; disk full on the DB server.
Related errors
- Could not delete the draft SSO settings.
- Could not delete the role, please try again later.
- Could not delete the SSO settings.
- Could not log secret access entry.
- Could not log secret access entry.
AI-assisted analysis of passbolt/passbolt_api@31c1bbc10f (2026-09-17).
Data as JSON: /api/errors/f68a95f11927d765.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/PassboltEe/DirectorySync/src/Model/Table/DirectoryIgnoreTable.php:217
[
'id' => $foreignKey,
'foreign_model' => $foreignModel,
],
[
'accessibleFields' => [
'id' => true,
'foreign_model' => true,
]]
);
if ($ignore->getErrors()) {
throw new ValidationException(__('This is not a valid record to ignore.'), $ignore, $this);
}
$this->checkRules($ignore);
if ($ignore->getErrors()) {
throw new ValidationException(__('This is not a valid record to ignore.'), $ignore, $this);
}
if (!$this->save($ignore, ['checkrules' => false])) {
throw new InternalErrorException('Could not ignore the record, please try again later.');
}
return $ignore;
}
/**
* Delete all association records where associated users entities are deleted
*
* @param string $entityType Users or Groups
* @param bool $dryRun false
* @return int number of affected records
*/
public function cleanupHardDeletedEntities(string $entityType, ?bool $dryRun = false): int
{
$query = $this->selectQuery()
->select(['id'])
->leftJoinWith($entityType)
->where(function ($exp, $q) use ($entityType) {View on GitHub (pinned to 31c1bbc10f)