{"record":{"id":"d0b3524fbd567cd4","repo":"mlflow/mlflow","slug":"resource-does-not-exist-d0b352","errorCode":"RESOURCE_DOES_NOT_EXIST","errorMessage":"Failed to download artifacts from path {artifact_path!r}, please ensure that the path is correct.","messagePattern":"Failed to download artifacts from path (.+?), please ensure that the path is correct\\.","errorType":"error_code","errorClass":"MlflowException","httpStatus":null,"severity":"error","filePath":"mlflow/store/artifact/runs_artifact_repo.py","lineNumber":232,"sourceCode":"        except Exception:\n            _logger.debug(\n                f\"Failed to download artifacts from {self.artifact_uri}/{artifact_path}.\",\n                exc_info=True,\n            )\n\n        # If there are artifacts with the same name in the run and model, the model artifacts\n        # will overwrite the run artifacts.\n        model_out_path: str | None = None\n        try:\n            model_out_path = self._download_model_artifacts(artifact_path, dst_path=dst_path)\n        except Exception:\n            _logger.debug(\n                f\"Failed to download model artifacts from {self.artifact_uri}/{artifact_path}.\",\n                exc_info=True,\n            )\n        path = run_out_path or model_out_path\n        if path is None:\n            raise MlflowException(\n                f\"Failed to download artifacts from path {artifact_path!r}, \"\n                \"please ensure that the path is correct.\",\n                error_code=RESOURCE_DOES_NOT_EXIST,\n            )\n        return path\n\n    def _download_model_artifacts(self, artifact_path: str, dst_path: str) -> str | None:\n        \"\"\"\n        A run can have an associated model. If so, this method downloads the artifacts of the model.\n        \"\"\"\n        full_path = f\"{self.artifact_uri}/{artifact_path}\" if artifact_path else self.artifact_uri\n        run_id, rel_path = RunsArtifactRepository.parse_runs_uri(full_path)\n        if not rel_path:\n            # At least one part of the path must be present (e.g. \"runs:/<run_id>/<name>\")\n            return None\n        [model_name, *rest] = rel_path.split(\"/\", 1)\n        rel_path = rest[0] if rest else \"\"\n        if repo := self._get_logged_model_artifact_repo(run_id=run_id, name=model_name):","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/mlflow/mlflow/blob/6a27f2decc0b76eb1b54af31849784addb357dbc/mlflow/store/artifact/runs_artifact_repo.py#L214-L250","documentation":"download_artifacts in runs_artifact_repo tries a direct run-artifact download and then a model-registered-artifact fallback; if both return None it cannot locate anything at the requested path. It raises MlflowException with RESOURCE_DOES_NOT_EXIST, meaning the artifact_path does not exist in the run's artifacts (nor as a registered model version artifact).","triggerScenarios":"Calling download_artifacts(artifact_path) on a RunsArtifactRepository where the path does not exist in the run's artifact store and the model-version fallback also fails — e.g. typos in the path, or downloading from a run whose artifacts were deleted.","commonSituations":"Referring to artifacts from an old run whose artifact store was purged (e.g. S3 lifecycle policy); wrong run_id with a valid-looking path; using 'model' paths that only exist for model-version URIs, not plain runs.","solutions":["Run mlflow.artifacts.list_artifacts(run_id) (or client.list_artifacts) to confirm the exact path","Check the run_id is correct and the artifact store backend still holds the files","If the artifact was logged under a nested path, include the full run-relative path"],"exampleFix":"// before\nruns_repo.download_artifacts(\"model.pkl\")  # actual path is models/model.pkl\n// after\nruns_repo.download_artifacts(\"models/model.pkl\")","handlingStrategy":"validation","validationCode":"from mlflow import MlflowClient\nclient = MlflowClient()\ndef artifact_exists(run_id, path):\n    parts = path.split(\"/\")\n    dir, name = \"/\".join(parts[:-1]) or None, parts[-1]\n    return any(f.path == path for f in client.list_artifacts(run_id, dir))","typeGuard":null,"tryCatchPattern":"from mlflow.exceptions import MlflowException, RESOURCE_DOES_NOT_EXIST\ntry:\n    local = repo.download_artifacts(artifact_path)\nexcept MlflowException as e:\n    if e.error_code == RESOURCE_DOES_NOT_EXIST:\n        existing = [a.path for a in repo.list_artifacts()]\n        raise FileNotFoundError(f\"{artifact_path} not in run; have: {existing}\") from e","preventionTips":["List artifacts first with client.list_artifacts(run_id) to get exact paths","Beware artifact-store lifecycle policies that delete old run artifacts","Verify run_id and path come from get_run/list_artifacts, not from memory"],"tags":["mlflow","artifact-not-found","download"],"backgroundTag":"resource-not-found","analyzedSha":"6a27f2decc0b76eb1b54af31849784addb357dbc","analyzedAt":"2026-08-29T20:54:51.419Z","schemaVersion":2},"datasetVersion":"2026-08-29T22:17:34.462Z"}