passbolt/passbolt_api · error · InternalErrorException

Could not save the rbacs, please try again later.

Error message

Could not save the rbacs, please try again later.

What it means

Generic fallback thrown by CreateRbacsOnRoleCreateListener::createRbacsOnRoleCreate() as an InternalErrorException when saving the RBAC entities fails with any exception other than PersistenceFailedException (e.g. database connection failure, lock timeout). The original exception is chained for server-side inspection.

Solutions

  1. Check the application/database error logs for the chained exception ($e) to find the root cause.
  2. Verify database connectivity and that the rbacs table exists (run migrations).
  3. Retry the role creation once the transient database issue is resolved.
  4. If persistent, inspect database server health (locks, disk, max connections).
Defensive patterns

Strategy: retry

Validate before calling

if (!$schema = $connection->getSchemaCollection()->describe('rbacs')) {
    throw new RuntimeException('rbacs table missing; run migrations');
}

Try / catch

try {
    $rbacsTable->saveManyOrFail($entities);
} catch (PersistenceFailedException $e) {
    // validation path
} catch (Exception $e) {
    // transient DB issue: check connectivity, then retry with backoff
    Log::error('rbacs save failed: ' . $e->getMessage());
}

Prevention

When it happens

Trigger: Role-created event fires and $rbacsTable->saveManyOrFail() throws an unexpected exception — DB connection loss, query errors, table missing, transaction/lock issues.

Common situations: Database server down or unreachable during role creation, rbacs table missing due to unrun migrations, deadlock/lock wait timeout under concurrent load.

Understand the failure class

Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.

Related errors


AI-assisted analysis of passbolt/passbolt_api@31c1bbc10f (2026-09-17). Data as JSON: /api/errors/091e67d3d977f237. Report an issue: GitHub.

Appendix: source

Thrown at plugins/PassboltCe/Rbacs/src/Event/CreateRbacsOnRoleCreateListener.php:108

                    'created' => true,
                    'modified' => true,
                    'created_by' => true,
                    'modified_by' => true,
                ]]
            );
        }

        try {
            $rbacsTable->saveManyOrFail($entities);
        } catch (PersistenceFailedException $e) {
            $errors = $e->getEntity()->getErrors();

            throw new CustomValidationException(
                __('The rbacs could not be saved.'),
                $errors
            );
        } catch (Exception $e) {
            throw new InternalErrorException(__('Could not save the rbacs, please try again later.'), null, $e);
        }
    }
}

View on GitHub (pinned to 31c1bbc10f)