{"record":{"id":"1e09e049ba38bc6f","repo":"apache/superset","slug":"tag-parameters-are-invalid-1e09e0","errorCode":null,"errorMessage":"Tag parameters are invalid.","messagePattern":"Tag parameters are invalid\\.","errorType":"validation","errorClass":"TagInvalidError","httpStatus":422,"severity":"error","filePath":"superset/commands/tag/delete.py","lineNumber":92,"sourceCode":"                    )\n                )\n            else:\n                # Validate user has access to the target object\n                self._validate_object_access(object_type, self._object_id, exceptions)\n\n                tagged_object = TagDAO.find_tagged_object(\n                    object_type=object_type, object_id=self._object_id, tag_id=tag.id\n                )\n                if tagged_object is None:\n                    exceptions.append(\n                        TaggedObjectNotFoundError(\n                            object_id=self._object_id,\n                            object_type=object_type.name,\n                            tag_name=self._tag,\n                        )\n                    )\n        if exceptions:\n            raise TagInvalidError(exceptions=exceptions)\n\n    def _validate_object_access(\n        self, object_type: ObjectType, object_id: int, exceptions: list[Any]\n    ) -> None:\n        \"\"\"Validate that the current user has access to the target object.\"\"\"\n        # Skip base filter so we can distinguish \"not found\" from \"no access\"\n        target_object = to_object_model(object_type, object_id, skip_base_filter=True)\n        if not target_object:\n            # Allow operation on stale references; no object to authorize against\n            return\n\n        try:\n            if object_type == ObjectType.dashboard:\n                security_manager.raise_for_access(dashboard=target_object)\n            elif object_type == ObjectType.chart:\n                security_manager.raise_for_access(chart=target_object)\n            elif object_type == ObjectType.query:\n                security_manager.raise_for_access(query=target_object)","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/commands/tag/delete.py#L74-L110","documentation":"DeleteTaggedObjectCommand.validate() collects problems — missing object_id/object_type, unknown tag name, missing _validate_object_access failure, or a tagged-object row not found (TaggedObjectNotFoundError) — and raises TagInvalidError(exceptions=exceptions) when any are present (delete.py:92). 'Tag parameters are invalid.' here means the delete-tagged-object request parameters failed validation.","triggerScenarios":"DELETE /api/v1/tag/... with an empty object_id or object_type; a tag name that does not exist (TagDAO.find_by_name returns nothing); the (object_type, object_id, tag) combination has no TaggedObject row; or the user lacks access to the target object.","commonSituations":"UI attempting to remove a tag that was already deleted elsewhere (race with another user); stale client state after tag management in another tab; API scripts deleting by guessed ids.","solutions":["Check the nested exceptions to identify the concrete failure (missing arg vs tag not found vs tagged object not found vs access)","Confirm the tag name exists and is applied to that exact object before deleting; refresh the UI state if it may be stale","Pass all required parameters with valid values (non-empty object_type and object_id)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from superset.daos.tag import TagDAO\nfrom superset.commands.tag.utils import to_object_type\n\ndef deletable(object_type: str, object_id: int, tag: str) -> bool:\n    ot = to_object_type(object_type)\n    if ot is None or not object_id:\n        return False\n    t = TagDAO.find_by_name(tag)\n    return t is not None and TagDAO.find_tagged_object(\n        object_type=ot, object_id=object_id, tag_id=t.id\n    ) is not None","typeGuard":null,"tryCatchPattern":"try:\n    DeleteTaggedObjectCommand(...).run()\nexcept TagInvalidError as ex:\n    if any(isinstance(e, TaggedObjectNotFoundError) for e in ex.exceptions):\n        treat_as_already_removed()  # idempotent no-op","preventionTips":["Refresh tag state before deleting to avoid stale names/ids","Treat tagged-object-not-found as success in idempotent automation","Check nested exceptions to distinguish missing params from missing rows"],"tags":["tags","api","validation","delete"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}