How to fix ERROR: "message": "An unexpected error occurred in scoring script. Check the logs for more info."

Martin Orator 20 Reputation points
2024-03-27T20:19:17.2133333+00:00

I created autogenerated ML predictive model in Azure Machine Learning studio and trained the model on tabular data in CSV format.

Succeeded

Then I directly deployed model to the Endpoint

Succeeded.

But when I try to test the model by sending request via API I am getting error:

I am using Python in VSCode to send the request - that works well.

The request failed with status code: 424 server: azureml-frontdoor date: Wed, 27 Mar 2024 19:42:44 GMT content-type: application/json content-length: 92 x-ms-run-function-failed: True x-ms-server-version: azmlinfsrv/0.8.4.2 x-ms-request-id: 8b508eaa-914f-4c26-8764-1559cbbc5543 x-request-id: 8b508eaa-914f-4c26-8764-1559cbbc5543 ms-azureml-model-error-reason: model_error ms-azureml-model-error-statuscode: 500 azureml-model-deployment: blueflower-1 connection: close {"message": "An unexpected error occurred in scoring script. Check the logs for more info."}

I suspect I am sending request in wrong format. I can not find anywhere what is expected input to trigger successfuly the expected output from the model so I am trying to send same data as was the training dataset, just converted to JSON format. It seems there is no real sample input and output generated with the model so I am a bit blind as I can not find real exact expected format incl all details. Also can not find any detailed logs to understand what exactly is failing in scoring script besides the run function. Thank you.

This is the only thing I find on the endpoint tabs to test it, but when I run the test as is I am getting following error directly in the gui

: An unexpected error occurred in scoring script. Check the logs for more info. ID pro sledování : 546ccea3-e3a0-417e-b8a8-37a8e8912191

User's image

{
  "input_data": {}
}
Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,895 questions
{count} votes

Accepted answer
  1. dupammi 8,465 Reputation points Microsoft Vendor
    2024-03-28T00:33:15.7666667+00:00

    Hi @Martin Orator

    Thank you for using the Microsoft Q&A forum.

    To resolve the "HttpResponseError" with message "An unexpected error occurred in scoring script. Check the logs for more info." when invoking an online endpoint in Azure ML, I suggest checking the logs for more information about the error, verifying that the input data format matches the format used during training. Verify that the online endpoint is running and deployed correctly.

    If the problem still persists, I suggest you test the online endpoint from the Azure Machine Learning studio portal or POSTMAN tool, to verify if the endpoint is running correctly. Please also check the error logs from the portal, once the endpoint was hit in the portal with the required JSON, parametric values.

    I tried to repro an error randomly by removing one required parameter from my online endpoint JSON and received below error. This repro I have done just to show where to check the logs. Please see below: User's image

    By passing the required number of parameter values, I was able to successfully get the response from the online endpoint. Please see below User's image

    Please refer to Azure Machine Learning Studio documentation, and try providing a sample input format that matches the format used during training.

    I hope you understand.

    Thank you.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.