{"record":{"id":"600f34cbfb137c36","repo":"passbolt/passbolt_api","slug":"the-tag-metadata-key-data-could-not-be-updated","errorCode":null,"errorMessage":"The tag metadata key data could not be updated.","messagePattern":"The tag metadata key data could not be updated\\.","errorType":"http","errorClass":"InternalErrorException","httpStatus":500,"severity":"error","filePath":"plugins/PassboltEe/Tags/src/Service/RotateKey/MetadataRotateKeyTagsUpdateService.php","lineNumber":90,"sourceCode":"                throw new CustomValidationException(__('The tag metadata key data could not be updated.'), $errors); // phpcs:ignore\n            }\n\n            $entities[$i] = $entity;\n        }\n\n        try {\n            $tagsTable->saveManyOrFail($entities, [\n                IsV4ToV5UpgradeAllowedRule::SKIP_RULE_OPTION => true,\n                IsSharedMetadataKeyUniqueActiveRule::SKIP_RULE_OPTION => false,\n            ]);\n        } catch (PersistenceFailedException $exception) { // @phpstan-ignore-line\n            $this->handleSaveManyValidationException(\n                $exception,\n                $entities,\n                __('The tag metadata key data could not be updated.')\n            );\n        } catch (Exception $exception) {\n            throw new InternalErrorException(\n                __('The tag metadata key data could not be updated.'),\n                null,\n                $exception\n            );\n        }\n    }\n}\n","sourceCodeStart":72,"sourceCodeEnd":98,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltEe/Tags/src/Service/RotateKey/MetadataRotateKeyTagsUpdateService.php#L72-L98","documentation":"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.","triggerScenarios":"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.","commonSituations":"Database timeouts or lock waits while saving many tag rows at once; transient DB connectivity issues during rotation; disk/transaction failures.","solutions":["Check the server error log for the wrapped original exception to see the real cause.","Re-run the metadata rotation — the operation can be retried per batch.","Check database health (connection limits, lock contention) if failures repeat.","Reduce batch size or retry during low traffic if lock timeouts are the cause."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { rotateKey(tags) } catch (InternalErrorException $e) { retryWithBackoff(); checkServerLogs(); }","preventionTips":["Run rotation during low-traffic windows","Ensure DB connection stability","Batch tags in smaller groups","Monitor DB lock/wait metrics"],"tags":["database","tags","metadata-key-rotation","internal-error"],"backgroundTag":"database-write-failed","analyzedSha":"31c1bbc10f32808a607fa9bd81891e898779c0bc","analyzedAt":"2026-09-17T00:04:38.960Z","contentChangedAt":"2026-09-17T00:04:38.960Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}