{"record":{"id":"8fe1ebcb87589b33","repo":"mlflow/mlflow","slug":"resource-does-not-exist-8fe1eb","errorCode":"RESOURCE_DOES_NOT_EXIST","errorMessage":"Failed to download an \"MLMODEL\" model file from \"{model_uri}\"","messagePattern":"Failed to download an \"MLMODEL\" model file from \"(.+?)\"","errorType":"error_code","errorClass":"MlflowException","httpStatus":null,"severity":"error","filePath":"mlflow/models/signature.py","lineNumber":642,"sourceCode":"    )\n    resolved_uri = model_uri\n    if RunsArtifactRepository.is_runs_uri(model_uri):\n        resolved_uri = RunsArtifactRepository.get_underlying_uri(model_uri)\n    elif ModelsArtifactRepository._is_logged_model_uri(model_uri):\n        resolved_uri = ModelsArtifactRepository.get_underlying_uri(model_uri)\n    elif ModelsArtifactRepository.is_models_uri(model_uri):\n        raise MlflowException(\n            f\"Failed to set signature on {model_uri!r}. \"\n            \"Model URIs with the `models:/<name>/<version>` scheme are not supported.\",\n            INVALID_PARAMETER_VALUE,\n        )\n\n    try:\n        ml_model_file = _download_artifact_from_uri(\n            artifact_uri=append_to_uri_path(resolved_uri, MLMODEL_FILE_NAME)\n        )\n    except Exception as ex:\n        raise MlflowException(\n            f'Failed to download an \"{MLMODEL_FILE_NAME}\" model file from \"{model_uri}\"',\n            RESOURCE_DOES_NOT_EXIST,\n        ) from ex\n    model_meta = Model.load(ml_model_file)\n    model_meta.signature = signature\n    model_meta.save(ml_model_file)\n    _upload_artifact_to_uri(ml_model_file, resolved_uri)\n","sourceCodeStart":624,"sourceCodeEnd":650,"githubUrl":"https://github.com/mlflow/mlflow/blob/6a27f2decc0b76eb1b54af31849784addb357dbc/mlflow/models/signature.py#L624-L650","documentation":"`set_signature` must download the MLmodel file from the resolved artifact URI to attach the signature. If the download fails for any reason (missing artifact, bad URI, permissions, connectivity), it is wrapped as RESOURCE_DOES_NOT_EXIST with this message and the original exception chained as the cause.","triggerScenarios":"`set_signature(uri, ...)` where the URI does not point to a directory containing MLmodel (e.g. a run root instead of the model artifact directory), the artifact was deleted, or the artifact store is unreachable/misconfigured (bad S3 credentials, wrong bucket).","commonSituations":"Pointing set_signature at a run root rather than the logged model path; expired cloud credentials; typos in artifact_path; a `models:/<model_id>` whose backing artifacts were deleted.","solutions":["Verify the URI points at the exact directory containing the MLmodel file: `MlflowClient().list_artifacts(uri)` should show `MLmodel`.","Inspect `ex.__cause__` (the chained exception) to see the real download failure (auth, DNS, 404) and fix storage access/credentials.","Re-log the model if its artifacts were deleted, then set the signature.","Pass the signature at log time via `mlflow.log_model(..., signature=signature)` instead of patching after the fact."],"exampleFix":"// before\nset_signature(\"runs:/<run_id>\", signature)  # run root, no MLmodel\n// after\nset_signature(\"runs:/<run_id>/model\", signature)  # dir containing MLmodel","handlingStrategy":"try-catch","validationCode":"client = MlflowClient()\nfiles = [a.path for a in client.list_artifacts(resolved_uri)]\nif \"MLmodel\" not in files:\n    raise ValueError(f\"No MLmodel file under {resolved_uri}; got {files}\")","typeGuard":null,"tryCatchPattern":"try:\n    mlflow.models.set_signature(model_uri, signature)\nexcept MlflowException as e:\n    if e.error_code == \"RESOURCE_DOES_NOT_EXIST\":\n        logger.error(\"MLmodel download failed: %s\", e.__cause__)\n        raise\n    raise","preventionTips":["Point set_signature at the directory that directly contains the MLmodel file.","Verify storage credentials (S3/GCS/Azure) in the environment doing the patching.","Inspect `e.__cause__` to distinguish 404 (wrong path) from auth/network failures.","Prefer setting the signature at log time to avoid artifact rewriting entirely."],"tags":["signature","artifact-download","resource-missing"],"backgroundTag":"artifact-not-found","analyzedSha":"6a27f2decc0b76eb1b54af31849784addb357dbc","analyzedAt":"2026-08-29T20:54:51.419Z","schemaVersion":2},"datasetVersion":"2026-08-29T22:17:34.462Z"}