passbolt/passbolt_api · critical · InternalErrorException

Could not save the UI action, try again later.

Error message

Could not save the UI action, try again later.

What it means

After validation and rules checks pass, UiActionsCreateService::create() calls UiActionsTable::save(). If save() returns false (the ORM could not persist the row despite checkRules being disabled), the service throws Cake\Http\Exception\InternalErrorException with 'Could not save the UI action, try again later.' — signaling an unexpected persistence failure, not a client input problem.

Solutions

  1. Run pending migrations (ddev refresh / bin/cake migrations migrate) to ensure the ui_actions schema exists.
  2. Check database connectivity and logs (error.log) for the underlying SQL error that made save() fail.
  3. Catch Cake\Http\Exception\InternalErrorException and surface a 500 to the client with retry guidance; the message explicitly says 'try again later'.
  4. For duplicate-name races, retry once after re-checking existence, or rely on the unique rule before save.
  5. Verify the database user has INSERT privileges on ui_actions.

Example fix

// before
try { $service->create($name); }
// after
try {
    $service->create($name);
} catch (\Cake\Http\Exception\InternalErrorException $e) {
    // inspect logs for the real DB failure, then retry or report 500
}
Defensive patterns

Strategy: retry

Validate before calling

if (!TableRegistry::getTableLocator()->get('Passbolt/Rbacs.UiActions')->getConnection()->isConnected()) { /* abort or reconnect */ }

Try / catch

try { $service->create($name); } catch (\Cake\Http\Exception\InternalErrorException $e) { \Cake\Log\Log::error($e->getMessage()); /* retry later or return 500 */ }

Prevention

When it happens

Trigger: $this->uiActionsTable->save($entity, ['checkRules' => false]) returns false or null — e.g. a database connection failure, a lock/timeout, a schema mismatch (migration not run so ui_actions table or columns are missing), or a unique-constraint race where another request inserted the same name between checkRules and save.

Common situations: Migrations not applied after upgrading (table missing), database down or read-only replica, concurrent insert of the same action name, disk full or DB connection dropped mid-request.

Related errors


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

Appendix: source

Thrown at plugins/PassboltCe/Rbacs/src/Service/UiActions/UiActionsCreateService.php:72

        ]]);

        // Check for validation errors
        if ($entity->getErrors()) {
            $msg = __('The UI actions data could not be validated.');
            throw new ValidationException($msg, $entity, $this->uiActionsTable);
        }

        // Check business rules
        $this->uiActionsTable->checkRules($entity);
        if ($entity->getErrors()) {
            $msg = __('The UI actions data could not be validated.');
            throw new ValidationException($msg, $entity, $this->uiActionsTable);
        }

        // Check for internal error on save
        $entity = $this->uiActionsTable->save($entity, ['checkRules' => false]);
        if (!$entity) {
            throw new InternalErrorException('Could not save the UI action, try again later.');
        }

        return $entity;
    }
}

View on GitHub (pinned to 31c1bbc10f)