{"record":{"id":"002058dd2221ca39","repo":"mlflow/mlflow","slug":"unable-to-download-model-artifacts-from-source-art","errorCode":null,"errorMessage":"Unable to download model artifacts from source artifact location '{source}' in order to upload them to Unity Catalog. Please ensure the source artifact location exists and that you can download from it via mlflow.artifacts.download_artifacts(). Original error: {e}","messagePattern":"Unable to download model artifacts from source artifact location '(.+?)' in order to upload them to Unity Catalog\\. Please ensure the source artifact location exists and that you can download from it via mlflow\\.artifacts\\.download_artifacts\\(\\)\\. Original error: (.+?)","errorType":"exception","errorClass":"MlflowException","httpStatus":null,"severity":"error","filePath":"mlflow/store/_unity_catalog/registry/rest_store.py","lineNumber":884,"sourceCode":"            raise MlflowException(\n                \"Failed to download the model weights from the HuggingFace hub and cannot register \"\n                \"the model in the Unity Catalog. Please ensure that the model was saved with the \"\n                \"correct reference to the HuggingFace hub repository and that you have access to \"\n                \"fetch model weights from the defined repository.\",\n                error_code=INTERNAL_ERROR,\n            ) from e\n\n    @contextmanager\n    def _local_model_dir(self, source, local_model_path):\n        if local_model_path is not None:\n            yield local_model_path\n        else:\n            try:\n                local_model_dir = mlflow.artifacts.download_artifacts(\n                    artifact_uri=source, tracking_uri=self.tracking_uri\n                )\n            except Exception as e:\n                raise MlflowException(\n                    f\"Unable to download model artifacts from source artifact location \"\n                    f\"'{source}' in order to upload them to Unity Catalog. Please ensure \"\n                    f\"the source artifact location exists and that you can download from \"\n                    f\"it via mlflow.artifacts.download_artifacts(). Original error: {e}\"\n                ) from e\n            try:\n                yield local_model_dir\n            finally:\n                # Clean up temporary model directory at end of block. We assume a temporary\n                # model directory was created if the `source` is not a local path\n                # (must be downloaded from remote to a temporary directory) and\n                # `local_model_dir` is not a FUSE-mounted path. The check for FUSE-mounted\n                # paths is important as mlflow.artifacts.download_artifacts() can return\n                # a FUSE mounted path equivalent to the (remote) source path in some cases,\n                # e.g. return /dbfs/some/path for source dbfs:/some/path.\n                if not os.path.exists(source) and not is_fuse_or_uc_volumes_uri(local_model_dir):\n                    shutil.rmtree(local_model_dir)\n","sourceCodeStart":866,"sourceCodeEnd":902,"githubUrl":"https://github.com/mlflow/mlflow/blob/6a27f2decc0b76eb1b54af31849784addb357dbc/mlflow/store/_unity_catalog/registry/rest_store.py#L866-L902","documentation":"Before uploading model artifacts to Unity Catalog, MLflow downloads them from the source artifact location via mlflow.artifacts.download_artifacts. If that download fails (missing source, no permissions, unsupported/incorrect URI), this error wraps the original exception.","triggerScenarios":"Creating a model version whose source artifact URI is nonexistent, deleted, in a different unreachable tracking server, or lacks read permissions; e.g. registering from an expired/deleted run or wrong storage credentials.","commonSituations":"Source run's artifacts deleted; cross-workspace registration without access; misconfigured S3/ADLS credentials; typo in source path.","solutions":["Verify mlflow.artifacts.download_artifacts(source) works manually and check the URI exists.","Fix storage credentials/permissions (cloud creds, instance profile, service principal) for the artifact location.","Register from the correct run/source URI of an existing run.","Copy artifacts to an accessible location and register from there."],"exampleFix":"// before\nclient.create_model_version(name, source=\"s3://wrong-bucket/model\")\n// after\nimport mlflow.artifacts\nlocal = mlflow.artifacts.download_artifacts(\"s3://correct-bucket/model\")  # verify first\nclient.create_model_version(name, source=\"s3://correct-bucket/model\")","handlingStrategy":"try-catch","validationCode":"import mlflow.artifacts\nlocal_dir = mlflow.artifacts.download_artifacts(artifact_uri=source)  # fail fast pre-registration","typeGuard":null,"tryCatchPattern":"try:\n    client.create_model_version(name, source=source, run_id=run_id)\nexcept MlflowException as e:\n    if \"Unable to download model artifacts\" in str(e):\n        print(\"Check source exists and creds:\", source, e)\n    raise","preventionTips":["Confirm storage credentials (S3/ADLS/GCS) are configured for the artifact root.","Avoid registering from deleted or expired runs; copy artifacts if needed.","Use the same tracking/registry workspace or grant cross-account read access."],"tags":["artifacts","unity-catalog","storage","permissions"],"backgroundTag":"artifact-download-failed","analyzedSha":"6a27f2decc0b76eb1b54af31849784addb357dbc","analyzedAt":"2026-08-29T20:54:51.419Z","schemaVersion":2},"datasetVersion":"2026-08-29T22:17:34.462Z"}