{"record":{"id":"a1255aeff7930977","repo":"apache/superset","slug":"semantic-view-does-not-exist-a1255a","errorCode":null,"errorMessage":"Semantic view does not exist","messagePattern":"Semantic view does not exist","errorType":"exception","errorClass":"SemanticViewNotFoundError","httpStatus":404,"severity":"error","filePath":"superset/commands/semantic_layer/update.py","lineNumber":67,"sourceCode":"        self._properties = data.copy()\n        self._model: SemanticView | None = None\n\n    @transaction(\n        on_error=partial(\n            on_error,\n            catches=(SQLAlchemyError, ValueError),\n            reraise=SemanticViewUpdateFailedError,\n        )\n    )\n    def run(self) -> Model:\n        self.validate()\n        assert self._model\n        return SemanticViewDAO.update(self._model, attributes=self._properties)\n\n    def validate(self) -> None:\n        self._model = SemanticViewDAO.find_by_id(self._model_id)\n        if not self._model:\n            raise SemanticViewNotFoundError()\n\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        ):","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/commands/semantic_layer/update.py#L49-L85","documentation":"Raised by UpdateSemanticViewCommand.validate() (superset/commands/semantic_layer/update.py:67) when SemanticViewDAO.find_by_id(self._model_id) returns None. The update command must first load the existing semantic view row by integer id; if it does not exist, SemanticViewNotFoundError aborts before editorship and uniqueness checks run.","triggerScenarios":"PUT/PATCH on the semantic view endpoint with an integer id that was deleted; the row is gone due to a concurrent delete or the id came from a stale client cache.","commonSituations":"Editing a view in one tab while it is deleted in another; environments where the same view exists with different ids and the wrong one is used.","solutions":["GET the view by id before opening the edit form; treat 404 as 'reopen the list'","Refresh the client's copy of the view (and its id) before saving edits","Confirm you are using the integer id, not the UUID, for the update endpoint"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from superset.daos.semantic_layer import SemanticViewDAO\n\nif SemanticViewDAO.find_by_id(view_id) is None:\n    raise LookupError(f\"view {view_id} no longer exists; refresh the list\")","typeGuard":null,"tryCatchPattern":"try:\n    UpdateSemanticViewCommand(view_id, props).run()\nexcept SemanticViewNotFoundError:\n    # discard local edits, reload the collection view\n    ","preventionTips":["Optimistic-concurrency style: re-GET the view right before saving edits","Pass integer id, not uuid, to the update endpoint"],"tags":["semantic-layer","semantic-view","not-found","update"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}