fbradyirl / webex_bot

Python package for a Webex Bot based on websockets.
MIT License
68 stars 44 forks source link

server rejected WebSocket connection: HTTP 404 (code = 1006, reason = [no reason]) #11

Closed eXTreMe-1337 closed 2 years ago

eXTreMe-1337 commented 3 years ago

Description

Describe what you were trying to get done. Tell us what happened, what went wrong, and what you expected to happen.

Server rejected websocket connection, don't know how to fix it, can you give me some advice? i replaced some phrases with "xxxxxx" in the following logs to hide some id's (because i'm not shure if they are access tokens or something like that).

2021-07-06 16:10:56 [INFO] [webex_websocket_client.root._connect_and_listen]:152 Opening websocket connection to wss://mercury-connection-partition0-a.wbx2.com/v1/apps/wx2/registrations/xxxxxxxxxxx/messages

2021-07-06 16:10:56 [DEBUG] [protocol.websockets.protocol.init]:244 client - state = CONNECTING

2021-07-06 16:10:56 [DEBUG] [protocol.websockets.protocol.connection_made]:1340 client - event = connection_made(<_ProactorSocketTransport fd=956>)

2021-07-06 16:10:56 [DEBUG] [protocol.websockets.protocol.data_received]:1412 client - event = data_received(<39 bytes>)

2021-07-06 16:10:56 [DEBUG] [client.websockets.client.write_http_request]:82 client > GET /v1/apps/wx2/registrations/xxxxxx/messages HTTP/1.1

2021-07-06 16:10:56 [DEBUG] [client.websockets.client.write_http_request]:83 client > Headers([('Host', 'mercury-connection-partition0-a.wbx2.com'), ('Upgrade', 'websocket'), ('Connection', 'Upgrade'), ('Sec-WebSocket-Key', 'ivFtcbfe+SeI0BHDHkZVDg=='), ('Sec-WebSocket-Version', '13'), ('Sec-WebSocket-Extensions', 'permessage-deflate; client_max_window_bits'), ('User-Agent', 'Python/3.8 websockets/8.0.2')])

2021-07-06 16:10:57 [DEBUG] [protocol.websockets.protocol.data_received]:1412 client - event = data_received(<1135 bytes>)

2021-07-06 16:10:57 [DEBUG] [client.websockets.client.read_http_response]:108 client < HTTP/1.1 404 Not Found

2021-07-06 16:10:57 [DEBUG] [client.websockets.client.read_http_response]:109 client < Headers([('TrackingID', 'ROUTER_60E46470-F3B4-01BB-256B-3E9C9709256B'), ('Cache-Control', 'no-cache, no-store'), ('Upgrade', 'websocket'), ('Connection', 'upgrade'), ('Sec-WebSocket-Accept', 'xxxxxxx'), ('Content-Type', 'text/html;charset=utf-8'), ('Content-Language', 'en'), ('Content-Length', '714'), ('Date', 'Tue, 06 Jul 2021 14:10:56 GMT'), ('Server', 'Redacted'), ('Strict-Transport-Security', 'max-age=63072000; includeSubDomains; preload')])

2021-07-06 16:10:57 [DEBUG] [protocol.websockets.protocol.fail_connection]:1257 client ! failing CONNECTING WebSocket connection with code 1006

2021-07-06 16:10:57 [DEBUG] [protocol.websockets.protocol.close_connection]:1203 client x closing TCP connection

2021-07-06 16:10:57 [DEBUG] [protocol.websockets.protocol.connection_lost]:1354 client - event = connection_lost(None)

2021-07-06 16:10:57 [DEBUG] [protocol.websockets.protocol.connection_lost]:1356 client - state = CLOSED

2021-07-06 16:10:57 [DEBUG] [protocol.websockets.protocol.connection_lost]:1361 client x code = 1006, reason = [no reason]

2021-07-06 16:10:57 [ERROR] [webex_websocket_client.root.run]:167 runException: server rejected WebSocket connection: HTTP 404

What I Did

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.

runException: server rejected WebSocket connection: HTTP 404
code = 1006, reason = [no reason]

Thank you very much!

gconklin commented 2 years ago

I just had the same happen. Something to do with the bot token id. Same code, same token was working just fine a few days ago, and now this 404/1006 error exit. Swapped out the bot id token and it works again. The bot token is valid, I can do api calls such as list room members or send messages, but can't be used for the websocket connection.

fbradyirl commented 2 years ago

Fixed in version 0.2.7