passbolt/passbolt_api · error · InternalErrorException

The tag metadata key data could not be updated.

Error message

The tag metadata key data could not be updated.

What it means

Thrown by MetadataRotateKeyTagsUpdateService::updateData: saveMany failures are mapped to a validation error via handleSaveManyValidationException, and any other Exception is wrapped as an InternalErrorException with the same user-facing message 'The tag metadata key data could not be updated.' The wrapped exception is attached so server logs contain the root cause.

Solutions

  1. Check the server error log for the wrapped original exception to see the real cause.
  2. Re-run the metadata rotation — the operation can be retried per batch.
  3. Check database health (connection limits, lock contention) if failures repeat.
  4. Reduce batch size or retry during low traffic if lock timeouts are the cause.
Defensive patterns

Strategy: retry

Try / catch

try { rotateKey(tags) } catch (InternalErrorException $e) { retryWithBackoff(); checkServerLogs(); }

Prevention

When it happens

Trigger: During metadata key rotation of tags: (a) saveMany throws a non-validation Exception (DB error, deadlock, connection loss), or (b) an unexpected Exception occurs mid-batch after per-entity checks passed.

Common situations: Database timeouts or lock waits while saving many tag rows at once; transient DB connectivity issues during rotation; disk/transaction failures.

Related errors


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

Appendix: source

Thrown at plugins/PassboltEe/Tags/src/Service/RotateKey/MetadataRotateKeyTagsUpdateService.php:90

                throw new CustomValidationException(__('The tag metadata key data could not be updated.'), $errors); // phpcs:ignore
            }

            $entities[$i] = $entity;
        }

        try {
            $tagsTable->saveManyOrFail($entities, [
                IsV4ToV5UpgradeAllowedRule::SKIP_RULE_OPTION => true,
                IsSharedMetadataKeyUniqueActiveRule::SKIP_RULE_OPTION => false,
            ]);
        } catch (PersistenceFailedException $exception) { // @phpstan-ignore-line
            $this->handleSaveManyValidationException(
                $exception,
                $entities,
                __('The tag metadata key data could not be updated.')
            );
        } catch (Exception $exception) {
            throw new InternalErrorException(
                __('The tag metadata key data could not be updated.'),
                null,
                $exception
            );
        }
    }
}

View on GitHub (pinned to 31c1bbc10f)