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

  1. Retry the request after a short delay, as the message suggests.
  2. Check database connectivity/health and server logs for the underlying SQL error.
  3. For the concurrency race, use createOrFail inside a transaction with try/catch and treat 'duplicate key' as already-ignored success, or check existence atomically.
  4. 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

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


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)