none
The type 'JArray' is not supported RRS feed

  • Question

  • Hi,

    I am using Machine Learning Server version 9.3.0. I have published a service in R using mrsdeploy. The service has an input of type data.frame, and an output of the same type. When I try to call the service from my Python code using the DeployClient package. I get the following error: 

    400 Client Error: Bad Request for url: http://192.168.0.200:12800/api/calisto/1.0.0
    Traceback (most recent call last):
      File "C:\Program Files\Microsoft\ML Server\PYTHON_SERVER\lib\site-packages\azureml\common\http_client.py", line 266, in __send
        response.raise_for_status()
      File "C:\Program Files\Microsoft\ML Server\PYTHON_SERVER\lib\site-packages\requests\models.py", line 935, in raise_for_status
        raise HTTPError(http_error_msg, response=self)
    requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://192.168.0.200:12800/api/calisto/1.0.0

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "lending_club.py", line 43, in <module>
        result = svc.scoreCallisto(loanstoinvest_df)
      File "C:\Program Files\Microsoft\ML Server\PYTHON_SERVER\lib\site-packages\azureml\deploy\server\service.py", line 107, in scoreCallisto
        return self._consume(props)
      File "C:\Program Files\Microsoft\ML Server\PYTHON_SERVER\lib\site-packages\azureml\deploy\server\service.py", line 319, in _consume
        response = self._http_client.post(self._api, json=body).json()
      File "C:\Program Files\Microsoft\ML Server\PYTHON_SERVER\lib\site-packages\azureml\common\http_client.py", line 193, in post
        return self.__send('POST', resource_path, data=data, json=json, headers=headers, raw_response=raw_response, **kwargs)
      File "C:\Program Files\Microsoft\ML Server\PYTHON_SERVER\lib\site-packages\azureml\common\http_client.py", line 270, in __send
        raise HttpException(resp=response)
    azureml.common.http_client.HttpException: (400)
    Reason: Bad Request
    HTTP response headers: {'Date': 'Sat, 13 Oct 2018 22:10:21 GMT', 'x-ms-request-id': '503bac1b-acc3-430d-8513-4cfc922c41dc', 'Server': 'Kestrel', 'Content-Type': 'application/json', 'Content-Length': '140', 'X-Content-Type-Options': 'nosniff'}
    HTTP response body: {"Link":"https://go.microsoft.com/fwlink/?linkid=830136","Message":"The type 'JArray' is not supported","ExceptionType":"ArgumentException"} 

    Thanks in advance for your help.

    Saturday, October 13, 2018 10:24 PM

All replies

  • When you deploy a service via mrsdeploy, you should get a Swagger definition of the service and its methods. Wouldn't that definition show how to pass in the data?

    Also, when you pass in the data you have to pass it in column format, not row format. Look at Hoong Oi's answer here.

    Niels


    http://www.nielsberglund.com | @nielsberglund


    • Edited by nielsbMVP Monday, October 15, 2018 2:57 AM
    Monday, October 15, 2018 2:57 AM
  • Hi, 

    Thanks for your reply. I use pandas in Python to read a csv file in to a data frame (panads.read_csv), then I pass the data frame as an argument to the method of my web service. I don't use Swagger, I try to use DeployService package in my Python code to get hold of the service, and call its method. By the way I deployed the service using mrsdeploy in R.

    Thanks,
    Bruce

    Monday, October 15, 2018 12:11 PM