Azure-docs: Timeout when calling Azure Webservice

Created on 6 Feb 2019  Â·  20Comments  Â·  Source: MicrosoftDocs/azure-docs

I followed the code template here: https://docs.microsoft.com/en-us/azure/machine-learning/service/tutorial-train-models-with-aml
I changed it for my dataset.
I can create image successfully. ACI deployment works fine too.
But when I call the API, it times out after almost a minute with this error. I know my code will take a few minutes to run.

WebserviceException: Received bad response from service:
Response Code: 504
Headers: {'X-Ms-Request-Id': 'c58d065b-ff71-42df-b18e-1caaf23a7f10', 'Date': 'Wed, 06 Feb 2019 00:21:46 GMT', 'Content-Length': '109', 'Content-Type': 'text/plain; charset=utf-8'}
Content: b'Post http://localhost:5001/score: net/http: request canceled (Client.Timeout exceeded while awaiting headers)'

How can I change this timeout?

Thanks!


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri1 cxp machine-learninsvc product-question triaged

All 20 comments

@blitzprecision
Thanks for the feedback. We are investigating into the issue and will update you shortly.

@blitzprecision Could you please let us know if you are able to test the model successfully locally before deploying it as a service?

Yes, it ran fine locally. I also logged in into the docker image and could execute it there as well using the terminal. I thought there was a default 1 hour timeout. But it turns out that I am facing a 1 minute default timeout.

I have run the notebooks mentioned in the tutorial and the was able to hit the service without any timeout. There are a couple of things I would suggest to check for your model:

1) I am sure you must have changed the input data format and header to match your model but I see in the error the header for Content-Type is 'text-plain', this tutorial uses JSON data as input and would fail if 'application/json' is not passed as header when input it JSON
2) The tutorial uses default core of 1 and RAM of 1 GB. If your image needs higher values could you please update aciconfig in your configuration file, then register and redeploy your service?
3) If you need a model that needs scalable deployments we recommend using AKS instead of ACI
4) Could you please check the container logs when you hit the scoring URI for more details on the error?
I have noticed the timeout value is set correctly to 3600 from the logs

Navigate to your resource group -> -> Settings -> Containers ->