{"record":{"id":"267e01fdcc36d817","repo":"apache/superset","slug":"dashboard-not-found-267e01","errorCode":null,"errorMessage":"Dashboard not found.","messagePattern":"Dashboard not found\\.","errorType":"exception","errorClass":"DashboardNotFoundError","httpStatus":404,"severity":"error","filePath":"superset/commands/dashboard/update.py","lineNumber":114,"sourceCode":"                self._model,\n                {k: v for k, v in self._properties.items() if k != \"json_metadata\"},\n            )\n            if json_metadata:\n                DashboardDAO.set_dash_metadata(\n                    dashboard,\n                    data=json.loads(json_metadata),\n                )\n        return dashboard\n\n    def validate(self) -> None:\n        exceptions: list[ValidationError] = []\n        slug: Optional[str] = self._properties.get(\"slug\")\n        tag_ids: Optional[list[int]] = self._properties.get(\"tags\")\n\n        # Validate/populate model exists\n        self._model = DashboardDAO.find_by_id(self._model_id)\n        if not self._model:\n            raise DashboardNotFoundError()\n        # Check editorship\n        try:\n            security_manager.raise_for_editorship(self._model)\n        except SupersetSecurityException as ex:\n            raise DashboardForbiddenError() from ex\n\n        # Validate slug uniqueness\n        if not DashboardDAO.validate_update_slug_uniqueness(self._model_id, slug):\n            exceptions.append(DashboardSlugExistsValidationError())\n\n        compute_subjects(self._model, self._properties, exceptions)\n\n        # validate tags\n        try:\n            validate_tags(ObjectType.dashboard, self._model.tags, tag_ids)\n        except ValidationError as ex:\n            exceptions.append(ex)\n","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/commands/dashboard/update.py#L96-L132","documentation":"DashboardNotFoundError raised in DashboardUpdateCommand.validate (update.py:114) when DashboardDAO.find_by_id(self._model_id) returns nothing — the dashboard id being updated does not exist (anymore) in the metadata DB.","triggerScenarios":"PUT /api/v1/dashboard/<id> where <id> was hard-deleted, never existed, or belongs to a different environment; also hit when a client holds a stale id after a workspace re-import.","commonSituations":"Two editors with the same dashboard open, one deletes it while the other saves; automated scripts using cached ids across environment rebuilds; typo'd or truncated id in a curl/script call.","solutions":["Verify the dashboard exists: GET /api/v1/dashboard/<id> (or filter by title: GET /api/v1/dashboard/?q=...).","If it was deleted, restore it from trash (POST /api/v1/dashboard/<id>/restore) or recreate it.","If ids came from an export/import, re-resolve ids in the target environment instead of reusing source-environment ids.","Handle 404 in the client and refresh the dashboard list shown to the user."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from superset.daos.dashboard import DashboardDAO\n\ndef dashboard_exists(model_id: int) -> bool:\n    return DashboardDAO.find_by_id(model_id) is not None","typeGuard":null,"tryCatchPattern":"from superset.commands.dashboard.exceptions import DashboardNotFoundError\n\ntry:\n    UpdateDashboardCommand(model_id, properties).run()\nexcept DashboardNotFoundError:\n    return ApiResponse.not_found()  # refresh client state; dashboard is gone","preventionTips":["GET-verify the dashboard id right before updating in scripts.","Handle 404 in editors: another user may have deleted the dashboard since it was opened.","Do not reuse dashboard ids across environments after export/import."],"tags":["dashboard","not-found","update","crud"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}