Problems registering models via /api/2.0/mlflow/model-versions/create

unj1m
New Contributor III

Initially, I tried registering while logging a model from mlflow and got:

"Got an invalid source 'dbfs:/Volumes/compute_integration_tests/default/compute-external-table-tests-models/test_artifacts/1078d04b4d4b4537bdf7a4b5e94e9e7f/artifacts/model'. Only DBFS locations are currently supported."

WAT?

I got this when trying to log a model and supply a model name.  I can also reproduce by calling the REST API directly.

After some trial and error, I found that using the source: 

'dbfs:/dbfs/Volumes/compute_integration_tests/default/compute-external-table-tests-models/test_artifacts/1078d04b4d4b4537bdf7a4b5e94e9e7f/artifacts/model'

"worked".

But a new version never got created.

Also, the documentation doesn't mention the required run_id and source parameters.

Alberto_Umana
Databricks Employee
Databricks Employee

Hi @unj1m,

The path should be in the format dbfs:/Volumes/... without the extra /dbfs prefix. The correct path should be: dbfs:/Volumes/compute_integration_tests/default/compute-external-table-tests-models/test_artifacts/1078d04b4d4b4537bdf7a4b5e94e9e7f/artifacts/model

fmadeiro
Contributor II

The error happens because of how the source path is interpreted. Use the correct DBFS path format: dbfs:/Volumes/.... Avoid adding /dbfs redundantly, as it's already the DBFS root.

Key Fixes:

  1. New Version Not Created: Ensure each log_model call uses a unique run_id and updated model metadata to trigger versioning.
  2. Required Parameters: For REST API, include run_id (from the MLflow run) and source (DBFS path to the model artifact).

Example Payload:

 

{
"name": "my_model_name",
"source": "dbfs:/Volumes/my-model-path/model",
"run_id": "1234567890abcdef"
}

unj1m
New Contributor III

I know, right! 😉

Look at the error message I posted:

"Got an invalid source 'dbfs:/Volumes/compute_integration_tests/default/compute-external-table-tests-models/test_artifacts/1078d04b4d4b4537bdf7a4b5e94e9e7f/artifacts/model'. Only DBFS locations are currently supported."

Adding the /dbfs was necessary to make it work.