join gateway request failed AgoraRTCError WS_ABORT: websocket is not ready

你好,这个问题怎么解决?好像问题在 Agora 服务器那边。

每次都失败。Agora 开发者中心没有什么答案。有什么设置我应该用吗?

Agora-SDK [DEBUG]: [lock-client-leave-2] is created.
AgoraRTC_N-4.3.0.js:402 17:25:46:352 Agora-SDK [DEBUG]: [lock-client-publish-3] is created.
AgoraRTC_N-4.3.0.js:403 17:25:46:353 Agora-SDK [INFO]: [client-5c34b] Initializing AgoraRTC client v4.3.0 build: v4.3.0-0-g0586d79(1/27/2021, 4:10:54 PM), mode: rtc, codec: vp8
AgoraRTC_N-4.3.0.js:403 17:25:46:356 Agora-SDK [INFO]: [client-5c34b] start join channel Testing
AgoraRTC_N-4.3.0.js:403 17:25:46:356 Agora-SDK [INFO]: [client-5c34b] connection state change: DISCONNECTED -> CONNECTING
AgoraRTC_N-4.3.0.js:402 17:25:46:357 Agora-SDK [DEBUG]: [client-5c34b] new Session 4C77BA50491681F5C741E3EFFD2273EA
AgoraRTC_N-4.3.0.js:403 17:25:46:362 Agora-SDK [INFO]: start create microphone audio track with config {} trackId track-b26ad71e
AgoraRTC_N-4.3.0.js:402 17:25:46:362 Agora-SDK [DEBUG]: [track-b26ad71e] GetUserMedia {"audio":{}}
AgoraRTC_N-4.3.0.js:403 17:25:46:365 Agora-SDK [INFO]: start create camera video track with config {"encoderConfig":"480p_1"} trackId track-ad7c827a
AgoraRTC_N-4.3.0.js:402 17:25:46:366 Agora-SDK [DEBUG]: [track-ad7c827a] GetUserMedia {"video":{"width":640,"height":480,"frameRate":15}}
AgoraRTC_N-4.3.0.js:402 17:25:46:370 Agora-SDK [DEBUG]: [client-5c34b] Connect to choose_server: https://webrtc2-ap-web-1.agora.io/api/v1
AgoraRTC_N-4.3.0.js:402 17:25:46:371 Agora-SDK [DEBUG]: [client-5c34b] Connect to choose_server: https://webrtc2-ap-web-2.agoraio.cn/api/v1
AgoraRTC_N-4.3.0.js:402 17:25:46:422 Agora-SDK [DEBUG]: [lock-track-b26ad71e-4] is created.
AgoraRTC_N-4.3.0.js:403 17:25:46:422 Agora-SDK [INFO]: create audio context
AgoraRTC_N-4.3.0.js:403 17:25:46:438 Agora-SDK [INFO]: create microphone audio track success, trackId: track-b26ad71e
AgoraRTC_N-4.3.0.js:402 17:25:46:570 Agora-SDK [DEBUG]: [lock-track-ad7c827a-5] is created.
AgoraRTC_N-4.3.0.js:403 17:25:46:571 Agora-SDK [INFO]: create camera video success, trackId: track-ad7c827a
AgoraRTC_N-4.3.0.js:402 17:25:46:838 Agora-SDK [DEBUG]: [gateway-client-5c34b] start connect, url: wss://193-118-58-18.edge.agoraio.cn:4701
AgoraRTC_N-4.3.0.js:402 17:25:47:86 Agora-SDK [DEBUG]: [gateway-client-5c34b] websocket opened: wss://193-118-58-18.edge.agoraio.cn:4701
AgoraRTC_N-4.3.0.js:403 17:25:47:88 Agora-SDK [ERROR]: [client-5c34b] join gateway request failed AgoraRTCError WS_ABORT: websocket is not ready
log @ AgoraRTC_N-4.3.0.js:403
error @ AgoraRTC_N-4.3.0.js:401
(anonymous) @ AgoraRTC_N-4.3.0.js:682
Promise.catch (async)
(anonymous) @ AgoraRTC_N-4.3.0.js:681
emit @ AgoraRTC_N-4.3.0.js:588
set state @ AgoraRTC_N-4.3.0.js:656
websocket.onopen @ AgoraRTC_N-4.3.0.js:660
AgoraRTC_N-4.3.0.js:402 17:25:47:88 Agora-SDK [DEBUG]: [gateway-client-5c34b] reconnect is triggered initiative
AgoraRTC_N-4.3.0.js:402 17:25:47:88 Agora-SDK [DEBUG]: [gateway-client-5c34b] websocket close wss://193-118-58-18.edge.agoraio.cn:4701/, code: 9999, reason: SERVER_ERROR, current mode: tryNext
AgoraRTC_N-4.3.0.js:402 17:25:47:88 Agora-SDK [DEBUG]: [client-5c34b] renewSession 4C77BA50491681F5C741E3EFFD2273EA => CD0897A2E7812A23C13BC66C2EF9F53B
AgoraRTC_N-4.3.0.js:402 17:25:47:89 Agora-SDK [DEBUG]: [client-5c34b] start full reconnect
AgoraRTC_N-4.3.0.js:402 17:25:47:89 Agora-SDK [DEBUG]: [gateway-client-5c34b] wait 500ms to reconnect websocket, mode: tryNext
AgoraRTC_N-4.3.0.js:402 17:25:47:590 Agora-SDK [DEBUG]: [gateway-client-5c34b] websocket url length: 3 current index: 1
AgoraRTC_N-4.3.0.js:402 17:25:47:591 Agora-SDK [DEBUG]: [gateway-client-5c34b] start connect, url: wss://169-197-112-114.edge.agora.io:4707
AgoraRTC_N-4.3.0.js:402 17:25:47:850 Agora-SDK [DEBUG]: [gateway-client-5c34b] websocket opened: wss://169-197-112-114.edge.agora.io:4707
AgoraRTC_N-4.3.0.js:403 17:25:47:852 Agora-SDK [ERROR]: [client-5c34b] join gateway request failed AgoraRTCError WS_ABORT: websocket is not ready
log @ AgoraRTC_N-4.3.0.js:403
error @ AgoraRTC_N-4.3.0.js:401
(anonymous) @ AgoraRTC_N-4.3.0.js:682
Promise.catch (async)
(anonymous) @ AgoraRTC_N-4.3.0.js:681
emit @ AgoraRTC_N-4.3.0.js:588
set state @ AgoraRTC_N-4.3.0.js:656
websocket.onopen @ AgoraRTC_N-4.3.0.js:660
AgoraRTC_N-4.3.0.js:402 17:25:47:852 Agora-SDK [DEBUG]: [gateway-client-5c34b] reconnect is triggered initiative
AgoraRTC_N-4.3.0.js:402 17:25:47:852 Agora-SDK [DEBUG]: [gateway-client-5c34b] websocket close wss://169-197-112-114.edge.agora.io:4707/, code: 9999, reason: SERVER_ERROR, current mode: tryNext
AgoraRTC_N-4.3.0.js:402 17:25:47:853 Agora-SDK [DEBUG]: [client-5c34b] renewSession CD0897A2E7812A23C13BC66C2EF9F53B => C5FEE7D02C2643C91665AE4A0AFCFF5E
AgoraRTC_N-4.3.0.js:402 17:25:47:853 Agora-SDK [DEBUG]: [client-5c34b] start full reconnect
AgoraRTC_N-4.3.0.js:402 17:25:47:854 Agora-SDK [DEBUG]: [gateway-client-5c34b] wait 500ms to reconnect web

websocket is not ready
一般是网络质量低的时候的告警,看日志里有尝试进行重连

不是网络质量。

我们解决问题了。问题的原因是一个有点老的 JS library (vendors.min.js),那个 library 不能处理 JS Promise 句法。更新 library 以后就没问题了。不过,我们还觉得这个问题有点奇怪,不知道为什么 agora 和那个 JS library 有什么关系。

抱歉我的中文有点差,我是外国人,希望你能看懂我的中文

确实有些奇怪,之前使用的这个library的较老版本是多少,我们可以去测试下问题关联性

不好意思,我以为 vendors.min.js 是独立的。我发现了 vendors.min.js 其实是有几个其它 JS library

我们用的 vendors.min.js 里有这些 library:

这些lib和SDK应该是没有冲突的,可以看下是否有些已经不可用了