How to Read the Error an MLflow Model Server Returns
When an MLflow model server can't use a request, it says why: an HTTP status code, and, for problems with the data, a JSON body with an error_code and a message. Reading both tells a program, or you, what to fix. This guide sends three bad requests to a served model and reads each answer, with real output from MLflow 3.18.0.
Syntax
{"error_code": CODE, "message": TEXT, "sqlstate": STATE, "error_class": CLASS}
| Part | What it means |
|---|---|
| HTTP status | 400 Bad Request for data the model can't use; other codes for other problems, listed below |
error_code | MLflow's name for the problem, such as INVALID_PARAMETER_VALUE or BAD_REQUEST |
message | What went wrong; for a schema problem, the last sentence names the column |
sqlstate, error_class | A code and a class for the error; the class is more specific, such as SCHEMA_ENFORCEMENT_FAILED |
curl -i prints the status line with the body. In PowerShell, Invoke-RestMethod shows the body as an error.
Prerequisites
- An MLflow tracking server at
http://127.0.0.1:8080, such asmlflow server --port 8080. mlflowandscikit-learnin your project, for example withuv add mlflow scikit-learn pandas.
Step 1: Log a Model and Serve It
The example predicts a man's weight from his chin-ups, sit-ups and jumps, from scikit-learn's Linnerud dataset, so its signature has three columns: Chins, Situps and Jumps.

import mlflow
from sklearn.datasets import load_linnerud
from sklearn.linear_model import LinearRegression
mlflow.set_tracking_uri("http://127.0.0.1:8080")
mlflow.set_experiment("error-response-example")
linnerud = load_linnerud(as_frame=True)
X = linnerud.data.astype("float64") # Chins, Situps and Jumps
y = linnerud.target["Weight"]
model = LinearRegression().fit(X, y)
with mlflow.start_run():
info = mlflow.sklearn.log_model(model, name="model", input_example=X.head(3))
print("Model URI:", info.model_uri)
uv run python log_error_model.py
Model URI: models:/m-00ac13c87dea419cb9119a7ad83b6eae
Serve it on port 5001 in a second terminal, as in How to Serve an MLflow Model as a REST API with mlflow models serve:
uv run mlflow models serve -m "models:/m-00ac13c87dea419cb9119a7ad83b6eae" -p 5001 --env-manager uv
Step 2: A Missing Column
A row without Situps:
- macOS / Linux
- Windows (PowerShell)
curl -i http://127.0.0.1:5001/invocations -H "Content-Type: application/json" --data '{"dataframe_records": [{"Chins": 5, "Jumps": 60}]}'
HTTP/1.1 400 Bad Request
date: Thu, 26 Nov 2026 04:57:30 GMT
server: uvicorn
content-length: 400
content-type: application/json
{"error_code": "INVALID_PARAMETER_VALUE", "message": "Failed to predict data ' Chins Jumps\n0 5.0 60.0'. \nError: Failed to enforce schema of data ' Chins Jumps\n0 5.0 60.0' with schema '['Chins': double (required), 'Situps': double (required), 'Jumps': double (required)]'. Error: Model is missing inputs ['Situps'].", "sqlstate": "KAM01", "error_class": "SCHEMA_ENFORCEMENT_FAILED"}
Invoke-RestMethod http://127.0.0.1:5001/invocations -Method Post -ContentType "application/json" -Body '{"dataframe_records": [{"Chins": 5, "Jumps": 60}]}'
Invoke-RestMethod:
{
"error_code": "INVALID_PARAMETER_VALUE",
"message": "Failed to predict data \u0027 Chins Jumps\n0 5.0 60.0\u0027. \nError: Failed to enforce schema of data \u0027 Chins Jumps\n0 5.0 60.0\u0027 with schema \u0027[\u0027Chins\u0027: double (required), \u0027Situps\u0027: double (required), \u0027Jumps\u0027: double (required)]\u0027. Error: Model is missing inputs [\u0027Situps\u0027].",
"sqlstate": "KAM01",
"error_class": "SCHEMA_ENFORCEMENT_FAILED"
}
![curl -i's output in a terminal: HTTP/1.1 400 Bad Request and a JSON body with error_code INVALID_PARAMETER_VALUE, a message ending in Model is missing inputs ['Situps'], sqlstate KAM01 and error_class SCHEMA_ENFORCEMENT_FAILED.](https://strdewiridedevblogsprod.blob.core.windows.net/images/blog/ai/mlflow/2026/mlflow-error-response-02-missing.webp)
The message shows the data as the server read it, then the model's schema, 'Situps': double (required) among the three, and ends with the reason: Model is missing inputs ['Situps']. PowerShell writes each ' inside the message as \u0027, its JSON escape.
Step 3: Text Where a Number Should Be
- macOS / Linux
- Windows (PowerShell)
curl -i http://127.0.0.1:5001/invocations -H "Content-Type: application/json" --data '{"dataframe_records": [{"Chins": "five", "Situps": 162, "Jumps": 60}]}'
HTTP/1.1 400 Bad Request
date: Thu, 26 Nov 2026 04:57:30 GMT
server: uvicorn
content-length: 283
content-type: application/json
{"error_code": "BAD_REQUEST", "message": "Invalid input. Data is not compatible with model signature. Failed to convert column Chins to type 'float64'. Error: 'ValueError(\"could not convert string to float: 'five'\")'", "sqlstate": "KAM00", "error_class": "INVALID_PARAMETER_VALUE"}
Invoke-RestMethod http://127.0.0.1:5001/invocations -Method Post -ContentType 'application/json' -Body '{"dataframe_records": [{"Chins": "five", "Situps": 162, "Jumps": 60}]}'
Invoke-RestMethod:
{
"error_code": "BAD_REQUEST",
"message": "Invalid input. Data is not compatible with model signature. Failed to convert column Chins to type \u0027float64\u0027. Error: \u0027ValueError(\u0022could not convert string to float: \u0027five\u0027\u0022)\u0027",
"sqlstate": "KAM00",
"error_class": "INVALID_PARAMETER_VALUE"
}
A different error_code, BAD_REQUEST: the server couldn't turn "five" into the decimal the signature asks for, and the message names the column, Chins.
Step 4: No Layout Key
The values alone, without dataframe_records or another of the server's four keys:
- macOS / Linux
- Windows (PowerShell)
curl -i http://127.0.0.1:5001/invocations -H "Content-Type: application/json" --data '{"Chins": 5, "Situps": 162, "Jumps": 60}'
HTTP/1.1 400 Bad Request
...
{"error_code": "BAD_REQUEST", "message": "The input must be a JSON dictionary with exactly one of the input fields {'dataframe_split', 'instances', 'inputs', 'dataframe_records'}. Received dictionary with input fields: []. IMPORTANT: The MLflow Model scoring protocol has changed in MLflow version 2.0. ...", "sqlstate": "KAM00", "error_class": "INVALID_PARAMETER_VALUE"}
Invoke-RestMethod http://127.0.0.1:5001/invocations -Method Post -ContentType 'application/json' -Body '{"Chins": 5, "Situps": 162, "Jumps": 60}'
Invoke-RestMethod:
{
"error_code": "BAD_REQUEST",
"message": "The input must be a JSON dictionary with exactly one of the input fields {\u0027inputs\u0027, \u0027dataframe_records\u0027, \u0027dataframe_split\u0027, \u0027instances\u0027}. Received dictionary with input fields: []. IMPORTANT: The MLflow Model scoring protocol has changed in MLflow version 2.0. ...",
"sqlstate": "KAM00",
"error_class": "INVALID_PARAMETER_VALUE"
}
The server found none of its four keys. The message also says the request layout changed in MLflow 2.0, because MLflow 1 took a different one.
Other Answers You Can Get
These don't come with the JSON body above:
| Status | Body | When |
|---|---|---|
415 Unsupported Media Type | This predictor only supports the following content types: ... | The Content-Type isn't application/json, text/csv or application/vnd.apache.parquet |
405 Method Not Allowed | {"detail":"Method Not Allowed"} | A GET to /invocations, which takes only POST |
504 Gateway Timeout | Request processing time exceeded limit | The prediction took longer than the server's timeout: How to Set the Request Timeout of an MLflow Model Server |
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
| Reading only the first line of the message | It repeats the data, so the reason is at the end | Read the last sentence, after the final Error: |
Treating every 400 the same | INVALID_PARAMETER_VALUE and BAD_REQUEST point at different fixes | Check error_code and error_class |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Model is missing inputs [...]. Note that there were extra inputs: [...] | A column name has a typo, or a CSV file has no header | Use the names in the model's signature |
The answer has a stack_trace field | Some parsing errors, such as a bad CSV value, include the server's traceback, with its file paths | Don't show it to users, and don't expose the server to people you don't trust |
FAQ
Is the error body documented?
Not field by field in the serving guide. The server builds the body from MlflowException, MLflow's error class, so the fields are the ones above.
How does a Python program read it?
response.json()["error_code"] and response.json()["message"]: How to Call an MLflow Model Server from Python.
Conclusion
A missing Situps came back as 400 with INVALID_PARAMETER_VALUE, SCHEMA_ENFORCEMENT_FAILED and the reason at the end of the message; "five" in Chins as 400 with BAD_REQUEST; and a request without a layout key as 400 with a note that the protocol changed in 2.0.
Additional Resources
- Deploy MLflow Model as a Local Inference Server — the request layouts the server reads.
- Model signatures — what the server checks requests against.
