{"record":{"id":"940a78fa70de428a","repo":"mlflow/mlflow","slug":"unsupported-source-model-uri-src-model-uri-t","errorCode":null,"errorMessage":"Unsupported source model URI: '{src_model_uri}'. The `copy_model_version` API only copies models stored in the 'models:/' scheme.","messagePattern":"Unsupported source model URI: '(.+?)'\\. The `copy_model_version` API only copies models stored in the 'models:/' scheme\\.","errorType":"exception","errorClass":"MlflowException","httpStatus":null,"severity":"error","filePath":"mlflow/tracking/client.py","lineNumber":4798,"sourceCode":"\n            src_model_uri = f\"models:/my_workspace_model/1\"\n            uc_model_dst_name = \"mycatalog.myschema.my_uc_model\"\n            uc_migrated_copy = client.copy_model_version(src_model_uri, uc_model_dst_name)\n            print_model_version_info(uc_migrated_copy)\n\n        .. code-block:: text\n            :caption: Output\n\n            Name: RandomForestRegression-staging\n            Version: 1\n            Source: runs:/53e08bb38f0c487fa36c5872515ed998/sklearn-model\n            --\n            Name: RandomForestRegression-production\n            Version: 1\n            Source: models:/RandomForestRegression-staging/1\n        \"\"\"\n        if urllib.parse.urlparse(src_model_uri).scheme != \"models\":\n            raise MlflowException(\n                f\"Unsupported source model URI: '{src_model_uri}'. The `copy_model_version` API \"\n                \"only copies models stored in the 'models:/' scheme.\"\n            )\n        client = self._get_registry_client()\n        try:\n            src_name, src_version = get_model_name_and_version(client, src_model_uri)\n            src_mv = client.get_model_version(src_name, src_version)\n        except MlflowException as e:\n            raise MlflowException(\n                f\"Failed to fetch model version from source model URI: '{src_model_uri}'. \"\n                f\"Error: {e}\"\n            ) from e\n\n        if has_prompt_tag(src_mv._tags):\n            # Prompt should not be used as a model version\n            raise MlflowException(\n                f\"Model with uri '{src_model_uri}' not found\",\n                RESOURCE_DOES_NOT_EXIST,","sourceCodeStart":4780,"sourceCodeEnd":4816,"githubUrl":"https://github.com/mlflow/mlflow/blob/6a27f2decc0b76eb1b54af31849784addb357dbc/mlflow/tracking/client.py#L4780-L4816","documentation":"MlflowClient.copy_model_version only supports copying versions whose source URI uses the models:/ scheme (it resolves name/version from an existing registry entry). Any other URI scheme — a plain path, s3://, runs:/, etc. — raises this MlflowException. It fails at the very first validation (urllib scheme check) before contacting the registry.","triggerScenarios":"Calling copy_model_version(dst_registry_uri, src_model_uri) with src_model_uri like \"/path/to/model\", \"s3://bucket/model\", \"runs:/<id>/model\", or an http URL instead of \"models:/<name>/<version>\".","commonSituations":"Confusing copy_model_version with register/log_model flows that accept other URI schemes; passing a source path from a logged artifact instead of a registered model URI; building URIs by string concatenation that loses the models:/ prefix.","solutions":["Pass a models:/ URI of an existing registered model version, e.g. \"models:/RandomForestRegression-staging/1\".","If copying from a raw source path, first create a model version in the source registry (create_model_version / log_model), then copy it.","Resolve run-based URIs (runs:/...) to a registered model version before copying.","Validate the scheme in calling code with urllib.parse.urlparse(src_model_uri).scheme == \"models\"."],"exampleFix":"// before\nclient.copy_model_version(dst_uri, \"s3://bucket/models/m/1\")\n// after\nsrc = client.get_model_version_by_alias(\"m\", \"staging\")\nclient.copy_model_version(dst_uri, f\"models:/{src.name}/{src.version}\")","handlingStrategy":"validation","validationCode":"import urllib.parse\nif urllib.parse.urlparse(src_model_uri).scheme != \"models\":\n    raise ValueError(f\"src_model_uri must use models:/ scheme, got {src_model_uri!r}\")","typeGuard":"def is_models_uri(uri: str) -> bool:\n    import urllib.parse\n    return urllib.parse.urlparse(uri).scheme == \"models\"","tryCatchPattern":"from mlflow.exceptions import MlflowException\ntry:\n    mv = client.copy_model_version(dst_uri, src_model_uri)\nexcept MlflowException as e:\n    if \"Unsupported source model URI\" in str(e):\n        mv = register_then_copy(client, dst_uri, src_model_uri)\n    else:\n        raise","preventionTips":["Always construct source URIs as models:/<name>/<version> or models:/<name>@<alias>","Validate scheme with urllib.parse before calling copy_model_version","Resolve runs:/ or storage paths into registered model versions first, then copy"],"tags":["mlflow","model-registry","uri-scheme","invalid-parameter"],"backgroundTag":"invalid-uri-scheme","analyzedSha":"6a27f2decc0b76eb1b54af31849784addb357dbc","analyzedAt":"2026-08-29T20:54:51.419Z","schemaVersion":2},"datasetVersion":"2026-08-29T22:17:34.462Z"}