Azure Machine Learning Python Module failing to Execute Calls to Cognitive Services

Viewed 299

I have created a Pipeline in Azure ML which makes calls to Azure Cognitive Services Text Analytics using its Python API. When I run the code I have written locally, it executes without error, but when run it in the pipeline it fails to perform the Sentiment Analysis and Key Phrase Extraction calls with a strange error message:

Got exception when invoking script at line 243 in function azureml_main: 'ServiceRequestError: <urllib3.connection.HTTPSConnection object at 0x7ff4dc727588>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'.

Upon further testing, it appears that it is able to open the Text Analytics Client correctly (Or at least without throwing an error), but when it gets to the line that actually makes the call out using the Python API it throws the above error.

I wondered if it was an Open SSL issue, but when I checked the version it had access to TLS 1.2: OpenSSL 1.1.1k 25 Mar 2021

It does not appear to be a temporary issue; I started seeing the issue last week, and I have seen it over a number of environments and with different input datasets.

Has anyone seen a similar issue before? Any ideas on how it could be resolved?

1 Answers

After speaking with Microsoft Support, it turns out this error was a platform error introduced in a recent update of Azure ML. Their product team are currently investigating a solution.

As a temporary fix, if you see this issue, you can try switching between using your personal endpoint and the generic regional endpoint; In this case, the error was only introduced for using personal endpoints. The endpoints in question have the following formats:

  • Personal: https://<COGNITIVE-SERVICES-INSTANCE>.cognitiveservices.azure.com/
  • Regional: https://<REGION>.api.cognitive.microsoft.com/
Related