-
Notifications
You must be signed in to change notification settings - Fork 119
Description
🚨 Bug: GET request parameters not passed correctly on Windows – Model export fails (“Missing value for required parameter 'name'”)
Summary
When running model export on Windows, the mlflow-export-import tool fails on endpoints such as:
/api/2.0/mlflow/registered-models/get
with the following error:
INVALID_PARAMETER_VALUE: Missing value for required parameter 'name'.
Even though the client sends "name": "<model>", the MLflow server receives an empty body because GET request bodies are ignored by the MLflow REST API.
The root cause is that the internal HTTP client sends GET parameters using data= instead of params=, which breaks the request (especially on Windows).
Experiment export works fine; only model export endpoints fail.
Environment
- OS: Windows 11
- Python: 3.12
- MLflow: 2.x
- mlflow-export-import: latest from PyPI
- MLflow server: local (127.0.0.1:8080)
Steps to Reproduce
-
Install
mlflow-export-importon Windows. -
Run:
python export_demo_entities.py --export-full-model Demo_IrisModel
-
Observe the following error:
Missing value for required parameter 'name'
The request log shows:
GET /api/2.0/mlflow/registered-models/get
Body: {"name": "Demo_IrisModel"}
MLflow ignores GET request bodies → the parameter never reaches the server → API returns a 400 error.
Root Cause
In the file:
mlflow_export_import/client/http_client.py
the _get() method is implemented as:
rsp = requests.get(uri, headers=self._mk_headers(), data=params, timeout=_TIMEOUT)This is incorrect for GET requests because:
data=sends parameters in the body- MLflow REST API does not parse GET request bodies
- Required parameters like
"name"never reach the server
This leads to:
INVALID_PARAMETER_VALUE: Missing value for required parameter 'name'
Proposed Patch (Fix)
Replace the _get() method with:
def _get(self, resource, params=None):
uri = self._mk_uri(resource)
# Convert JSON string → dict
query = None
if params:
import json
query = json.loads(params)
# Correct GET request: parameters must be in the query string
rsp = requests.get(uri, headers=self._mk_headers(), params=query, timeout=_TIMEOUT)
return self._check_response(rsp, params)This ensures that:
- GET parameters are added as query string (
?name=ModelName) - MLflow server receives all required parameters
- Model export works on Windows and Linux
Result After Patch
Model export runs successfully:
Exporting model 'Demo_IrisModel' ...
... success!
No more “Missing value for required parameter 'name'”.
Request
Please update the library so that params= is used for all GET requests in the internal HTTP client.
Happy to submit a PR with the patch if helpful!