{"record":{"id":"63b090f472884ddb","repo":"apache/dolphinscheduler","slug":"model-key-must-start-with-runs-or-models","errorCode":null,"errorMessage":"model key must start with runs:/ or models:/ ","messagePattern":"model key must start with runs:/ or models:/ ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-mlflow/src/main/java/org/apache/dolphinscheduler/plugin/task/mlflow/MlflowParameters.java","lineNumber":131,"sourceCode":"\n    private void getParamsMapForAutoML(HashMap<String, String> paramsMap) {\n        paramsMap.put(\"automl_tool\", automlTool);\n        paramsMap.put(\"repo\", MlflowConstants.PRESET_AUTOML_PROJECT);\n        paramsMap.put(\"repo_version\", MlflowConstants.PRESET_REPOSITORY_VERSION);\n    }\n\n    public Boolean isCustomProject() {\n        return mlflowJobType.equals(MlflowConstants.JOB_TYPE_CUSTOM_PROJECT);\n    }\n\n    public String getModelKeyName(String tag) throws IllegalArgumentException {\n        String imageName;\n        if (deployModelKey.startsWith(\"runs:\")) {\n            imageName = deployModelKey.replace(\"runs:/\", \"\");\n        } else if (deployModelKey.startsWith(\"models:\")) {\n            imageName = deployModelKey.replace(\"models:/\", \"\");\n        } else {\n            throw new IllegalArgumentException(\"model key must start with runs:/ or models:/ \");\n        }\n        imageName = imageName.replace(\"/\", tag).toLowerCase();\n        return imageName;\n    }\n\n    public String getContainerName() {\n        return \"ds-mlflow-\" + getModelKeyName(\"-\");\n    }\n\n    public boolean getIsDeployDocker() {\n        if (StringUtils.isEmpty(deployType)) {\n            return false;\n        }\n        return deployType.equals(MlflowConstants.MLFLOW_MODELS_DEPLOY_TYPE_DOCKER);\n    }\n}\n","sourceCodeStart":113,"sourceCodeEnd":148,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-mlflow/src/main/java/org/apache/dolphinscheduler/plugin/task/mlflow/MlflowParameters.java#L113-L148","documentation":"MlflowParameters.getModelKeyName() builds a Docker image name from the MLflow model key. It only supports keys starting with 'runs:/' or 'models:/'; anything else throws IllegalArgumentException('model key must start with runs:/ or models:/ ').","triggerScenarios":"deployModelKey is set to a raw path (e.g. 'my/model', 's3://bucket/model', 'dbfs:/...') or a mistyped scheme/case such as 'run:/' or 'Runs:/'.","commonSituations":"User pastes an unsupported MLflow model URI (s3://, filesystem path) into the MLflow task; typo'd prefix; copying a model path from the MLflow UI without its runs:/ or models:/ prefix.","solutions":["Prefix the model key with 'runs:/' (run artifacts) or 'models:/' (registered model) in the MLflow task parameters.","Check the value for typos and exact case: it must start with 'runs:' or 'models:'.","For a registered model, register it in the MLflow Model Registry and use its 'models:/name/version' URI.","Convert filesystem/S3 paths into a supported MLflow URI or use a different task type."],"exampleFix":"// before\nmodelKey = \"s3://my-bucket/model\"\n// after\nmodelKey = \"models:/my-model/1\"  // or \"runs:/<run_id>/model\"","handlingStrategy":"validation","validationCode":"if (!(modelKey.startsWith(\"runs:/\") || modelKey.startsWith(\"models:/\"))) {\n    throw new IllegalArgumentException(\"model key must start with runs:/ or models:/\");\n}","typeGuard":"boolean isValidMlflowModelKey(String k) {\n    return k != null && (k.startsWith(\"runs:/\") || k.startsWith(\"models:/\"));\n}","tryCatchPattern":null,"preventionTips":["Always copy model URIs directly from MLflow including the scheme prefix.","Watch for typos and case: 'run:/' or 'Runs:/' are rejected.","Register models in the MLflow Model Registry to get stable models:/ URIs."],"tags":["mlflow","model-key","validation","argument"],"backgroundTag":"invalid-argument-value","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}