Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection failed (no connection to the remote host) WS_OPEN_ERROR_UNDERLYING_IO_OPEN_FAILED #1911

Closed
tianyi14 opened this issue Apr 10, 2023 · 29 comments

Comments

@tianyi14
Copy link

Describe the bug
Using the speech recognition text function, this error will be reported starting from April 7th

This is the error log

logspeech.txt

@tianyi14
Copy link
Author

Connection failed (no connection to the remote host). Internal error: 1. Error details: Failed with error: WS_OPEN_ERROR_UNDERLYING_IO_OPEN_FAILED
wss://eastasia.stt.speech.microsoft.com/speech/recognition/interactive/cognitiveservices/v1?language=en-us
X-ConnectionId: fbeac57c5c814e82bdbc9ca1d5336be5 SessionId: fbeac57c5c814e82bdbc9ca1d5336be5

@tianyi14
Copy link
Author

The client sdk used is 1.25.0 in Java language, running on Windows

@rhurey
Copy link
Member

rhurey commented Apr 10, 2023

Thanks for adding the SDK log, the underlying error from it was:
[912532]: 5075ms SPX_TRACE_ERROR: AZ_LOG_ERROR: socketio_win32.c:543 Socketio_Failure: Receiving data from endpoint: 10054.

Adn 10054 translates to:
WSAECONNRESET10054 | Connection reset by peer.
An existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the host is rebooted, the host or remote network interface is disabled, or the remote host uses a hard close (see setsockopt for more information on the SO_LINGER option on the remote socket). This error may also result if a connection was broken due to keep-alive activity detecting a failure while one or more operations are in progress. Operations that were in progress fail with WSAENETRESET. Subsequent operations fail with WSAECONNRESET.

So something between the client and the service reset the connection.

Can you connect using curl to download the list of supported languages?
curl https://eastasia.stt.speech.microsoft.com/api/v1.0/languages/recognition

Does the connection always fail?

@tianyi14
Copy link
Author

@tianyi14
Copy link
Author

oh,no, I just tried it for the first time and it was okay. After 20 minutes of testing, I was told that the SSL connection failed
飞书20230411-105352

@tianyi14
Copy link
Author

Running on server, error 443, connection timeout

@tianyi14
Copy link
Author

An error was reported while verifying the authorization token, as follows
1681198541054

@czkoko
Copy link

czkoko commented Apr 11, 2023

Windows 11 上存在一个已知问题,该问题可能会影响某些类型的安全套接字层 (SSL) 和传输层安全性 (TLS) 连接。 这些连接可能会出现握手失败。 对于开发人员,受影响的连接可能会在单个输入缓冲区中发送多个帧,然后发送大小小于 5 个字节的部分帧。 如果连接失败,你的应用将收到“USP 错误”、“连接关闭”、“服务超时”或“SEC_E_ILLEGAL_MESSAGE”等错误。
有一个适用于 Windows 11 的带外更新可以解决这些问题。 可以按照以下说明手动安装此更新:
Windows 11 21H2
Windows 11 22H2

@tianyi14
Copy link
Author

But my computer is Win10. Do I need to update to 11?

@tianyi14
Copy link
Author

Just now I re executed the code and found that the speech recognition text is working. I didn't do anything. After restarting my computer, I ran it again and found that an error was reported again. Since then, I have never been successful again

@tianyi14
Copy link
Author

@czkoko
Copy link

czkoko commented Apr 11, 2023

After testing, this is a network failure in China, and I can't connect to the eastasia server too (will connect by vpn).
Connect to https://eastus.stt.speech.microsoft.com/api/v1.0/languages/recognition for test, There should be no problem.

@tianyi14
Copy link
Author

But the audio synthesis function can be successfully called, and adding subtitles for voice to text is the only problem. Is the service accessed by the two different

@tianyi14
Copy link
Author

yes, Connect to https://eastus.stt.speech.microsoft.com/api/v1.0/languages/recognition,Sometimes it's possible, But even if the curl successfully responds, there are still issues with speech recognition execution

@czkoko
Copy link

czkoko commented Apr 11, 2023

Turn on the vpn for test, or create a new Subscription-Key for other regions.

@rhurey
Copy link
Member

rhurey commented Apr 11, 2023

Speech Synthesis and Speech Recognition use different endpoints.

@tianyi14
Copy link
Author

If it is due to network issues, audio synthesis is possible, but audio recognition failed. Although it is two endpoints, I still feel a bit strange

@tianyi14
Copy link
Author

And even though I switched to Japan using VPN, I still reported the same error. I don't understand what caused it. This is the log of my VPN switching to Japan

logspeech2.txt

@tianyi14
Copy link
Author

My system is Win10, JDK 17, language Java, SDK is 1.25.0, and I have tried both 1.26.0 and 1.27.0, but the same problem,

@rhurey
Copy link
Member

rhurey commented Apr 12, 2023

Thanks for the additional log, it's still the same error of a peer reset happening.

Unfortunately, it's typically difficult to determine which component is resetting connections unless it's killing a lot of them, and there's usually a good number of devices between data centers.

At this point the usual path is to take a WireShark trace, find the TCP RST packets that are coming back and compare their TTL numbers to a traceroute to the service and see if we can match up a device.

@tianyi14
Copy link
Author

I don't know if this information contains the data you need. Could you please take a look
b51f3fa1d987f7ec6cd7b62f8f17999
fbe6295ea226fa8dbb42f3266c9e64a

@tianyi14
Copy link
Author

Today, I encountered a situation where I successfully called speech recognition for the first time, but when I called it again after a minute, it failed and seemed very unstable. Since then, there have been more and more failures, and I have never called it again successfully.Captioning () is a function that I encapsulate, but it is actually internally provided by Microsoft

2ebf77fe19b32655c25e5733b2975f5
b4da1ae1407cea8fd41f2203605e95b

@czkoko
Copy link

czkoko commented Apr 13, 2023

I can tell you clearly that the server you are using is in Hong Kong and has been blocked.
https://www.racent.com/query-access-domain?q=eastasia.stt.speech.microsoft.com

@rhurey
Copy link
Member

rhurey commented Apr 13, 2023

If 198.18.9.179 is the device resetting the connection it's a device in a private network address space. Perhaps a proxy between the client and the internet?

Have you tried using a China region?

@leongj
Copy link

leongj commented Apr 14, 2023

I've just started with Text-to-Speech and the Express.js example works fine for me.

But the Python example gives me the error:

Error details: Connection failed (no connection to the remote host). Internal error: 1. Error details: Failed with error: WS_OPEN_ERROR_UNDERLYING_IO_OPEN_FAILED
wss://eastus.tts.speech.microsoft.com/cognitiveservices/websocket/v1
X-ConnectionId: 56a0d61ec89f4723931b6294e3a8fa19 USP state: Sending. Received audio size: 0 bytes.

This is on the exact same subscription_key and region as the JS demo, which is working fine.

Environment is:

  • Windows 11
  • WSL2
  • Ubuntu 22.04
  • Python 3.10.6
  • azure-cognitiveservices-speech 1.27.0
  • and I did the additional SDK install and installed libssl1.1_1.1.1f-1ubuntu2.17_amd64.deb

As you can see I am using EastUS region. I am in Australia. UPDATE, just created a speech service in AustraliaEast and got the exact same results.

SDK Log attached
log-speechsdk-2023_04_14-051938.log

UPDATE: I fixed this -- my WSL2 clock was out of sync with real time (and yeah this isn't fixed properly).

@tianyi14
Copy link
Author

We have solved this problem due to network proxies. Currently, there are issues with the Chinese network, and we have applied for a new secret key using Southeast Asia in the future

@alex-pythonista
Copy link

@tianyi14 Hello there, I am currently facing this issue with the centralindia region. How did you solve the problem?

@Sirorezka
Copy link

I had same problem when running 'speech sdk' through gunicorn. This error may be triggered when sdk can't find certificates path. What you should try to do:

  1. Check that you've installed OpenSSL v1.x as it is described setup_guide
  2. check that you have SSL_CERT_DIR env variable configured as it described in setup_guide
  3. if starting server-side process as another user (using sudo ... or sudo -u username) set env variable SSL_CERT_DIR directly in the code to be sure that this user have the env variable correctly configured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants