cancel
Showing results for 
Search instead for 
Did you mean: 
Machine Learning
Dive into the world of machine learning on the Databricks platform. Explore discussions on algorithms, model training, deployment, and more. Connect with ML enthusiasts and experts.
cancel
Showing results for 
Search instead for 
Did you mean: 

Content Type error legacy serving

semsim
Contributor

Hi,

I have deployed an endpoint in Databricks using legacy serving. I am using the custom pyfunc in mlflow to deploy the custom code. This code uses Machine Learning to parse out the table of contents in some pdf files then returns the table of contents in a csv. Not your typical scoring/prediction model. While I was able to get the code deployed using legacy serving, I am having issues querying the endpoint. I receive the following error from the cluster log: 

AttributeError: 'NoneType' object has no attribute 'split'
2024/05/07 13:51:16 ERROR mlflow.pyfunc.scoring_server: Exception on /invocations [POST]
Traceback (most recent call last):
  File "/databricks/conda/envs/model-1/lib/python3.10/site-packages/flask/app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
  File "/databricks/conda/envs/model-1/lib/python3.10/site-packages/flask/app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/databricks/conda/envs/model-1/lib/python3.10/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
  File "/databricks/conda/envs/model-1/lib/python3.10/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
  File "/databricks/conda/envs/model-1/lib/python3.10/site-packages/mlflow/server/handlers.py", line 508, in wrapper
    return func(*args, **kwargs)
  File "/databricks/conda/envs/model-1/lib/python3.10/site-packages/mlflow/pyfunc/scoring_server/__init__.py", line 443, in transformation
    result = invocations(data, content_type, model, input_schema)
  File "/databricks/conda/envs/model-1/lib/python3.10/site-packages/mlflow/pyfunc/scoring_server/__init__.py", line 302, in invocations
    type_parts = list(map(str.strip, content_type.split(";")))
AttributeError: 'NoneType' object has no attribute 'split'

From what I understand of this error is that my content_type header appears to be a "none" object. When I try to query the model code via postman I have a content type of application/json. Also my request body is empty..any ideas?

0 REPLIES 0

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group