{"record":{"id":"fb6b517f7f0f3868","repo":"apache/superset","slug":"a-semantic-view-with-name-name-and-the-same-co","errorCode":null,"errorMessage":"A semantic view with name '{name}' and the same configuration already exists in this semantic layer.","messagePattern":"A semantic view with name '(.+?)' and the same configuration already exists in this semantic layer\\.","errorType":"validation","errorClass":"ValueError","httpStatus":422,"severity":"error","filePath":"superset/commands/semantic_layer/update.py","lineNumber":86,"sourceCode":"\n        try:\n            security_manager.raise_for_editorship(self._model)\n        except SupersetSecurityException as ex:\n            raise SemanticViewForbiddenError() from ex\n\n        name = self._properties.get(\"name\", self._model.name)\n        layer_uuid = str(self._model.semantic_layer_uuid)\n        configuration = self._properties.get(\n            \"configuration\",\n            json.loads(self._model.configuration),\n        )\n        if not SemanticViewDAO.validate_update_uniqueness(\n            view_uuid=str(self._model.uuid),\n            name=name,\n            layer_uuid=layer_uuid,\n            configuration=configuration,\n        ):\n            raise ValueError(\n                f\"A semantic view with name '{name}' and the same \"\n                \"configuration already exists in this semantic layer.\"\n            )\n\n\nclass UpdateSemanticLayerCommand(BaseCommand):\n    def __init__(self, uuid: str, data: dict[str, Any]):\n        self._uuid = uuid\n        self._properties = data.copy()\n        self._model: SemanticLayer | None = None\n\n    @transaction(\n        on_error=partial(\n            on_error,\n            catches=(SQLAlchemyError, ValueError),\n            reraise=SemanticLayerUpdateFailedError,\n        )\n    )","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/commands/semantic_layer/update.py#L68-L104","documentation":"Raised by UpdateSemanticViewCommand.validate() (superset/commands/semantic_layer/update.py:86) as a ValueError when SemanticViewDAO.validate_update_uniqueness(view_uuid, name, layer_uuid, configuration) returns false. Uniqueness is enforced on update exactly as on create: no OTHER view in the same semantic layer may share the target name+configuration pair (the view's own uuid is excluded, so saving without changes is allowed). The effective name/configuration fall back to the model's current values when not supplied in the patch.","triggerScenarios":"PATCHing a view's name to one already used by another view in the same layer with an equivalent configuration; PATCHing only 'configuration' to a value that collides with a sibling view that shares the same name.","commonSituations":"Renaming a view to a 'friendly' name that already exists, copying a view's configuration into a second view with the same name, or save-as flows that keep the name.","solutions":["Before saving, list sibling views in the same semantic_layer_uuid and verify no other view has the target name+configuration pair","Rename the view to something unique within the layer","If you intend two identical views, differentiate at least the name or the configuration"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from superset.daos.semantic_layer import SemanticViewDAO\n\n# exclude self (view_uuid) exactly like the server does\nif not SemanticViewDAO.validate_update_uniqueness(\n    view_uuid=str(view.uuid), name=new_name,\n    layer_uuid=str(view.semantic_layer_uuid), configuration=new_config,\n):\n    raise ValueError(\"name+configuration collides with a sibling view\")","typeGuard":null,"tryCatchPattern":"try:\n    UpdateSemanticViewCommand(view_id, props).run()\nexcept ValueError as ex:\n    if \"already exists\" in str(ex):\n        # pick a different name or tweak configuration, then resubmit\n        ","preventionTips":["Check sibling views' names in the same layer before renaming","Remember the check falls back to current values for fields you omit"],"tags":["semantic-layer","semantic-view","uniqueness","update","validation"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}