mlflow: [BUG] Submitting a long param value triggers 5xx code instead of 4xx (bad request)

System information

  • Have I written custom code (as opposed to using a stock example script provided in MLflow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 16.04
  • MLflow installed from (source or binary): 1.2
  • MLflow version (run mlflow --version):
  • Python version: 3.6
  • Exact command to reproduce:

Describe the problem

I am trying to create a run and submit a param with a really long value (251 or higher)

I expect to have 200 response or 4xx (the param value is too long) What I get is 500 2019/09/23 14:44:09 ERROR mlflow.utils.rest_utils: API request to https://xxx/api/2.0/mlflow/runs/log-parameter failed with code 500 != 200, retrying up to 0 more times. API response body: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<title>500 Internal Server Error</title>

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

Code to reproduce issue

from mlflow.tracking import MlflowClient client = MlflowClient() client.create_run(0) client.log_param(run.info.run_id, “param251”, “x”*251)

Other info / logs

I already grepped mlflow source code and noticed there is a limit on the length of a param which is 250 and it is pretty reasonable. What I did not expect is to get 5xx error

I think it would improve user experience to return 4xx with an explanation of the problem

What do you think?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 15 (6 by maintainers)

Most upvoted comments

If there hasn’t been any progress on the issue, I’m willing to take it up.

This has been fixed in https://github.com/mlflow/mlflow/pull/6358 and can be closed.

with mlflow.start_run() as run:
  mlflow.log_param("test", "x"*501)

>>> MlflowException: INVALID_PARAMETER_VALUE: Param value for run id 2ee8cab33bfd4fdab8557b9caf577c71, 
exceeds size threshold 500 bytes. Key is test, value is 
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

Thanks @pankajrandhe! If you need any help with working on the issue from us, please feel free to ask!