-
Notifications
You must be signed in to change notification settings - Fork 134
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
WebSocketTimeoutException #219
Comments
Same problem on CentOS |
Same problem on Ubuntu 22.04 def subscribe(symbol):
ws = WebSocket(
testnet=False,
channel_type="linear",
trace_logging=True,
)
def handle_socket_message(msg):
print(msg)
ws.orderbook_stream(depth=1, symbol=symbol, callback=handle_socket_message)
while True:
time.sleep(0.1)
Setting def subscribe(symbol):
ws = WebSocket(
testnet=False,
channel_type="linear",
trace_logging=False,
)
def handle_socket_message(msg):
print(msg)
ws.orderbook_stream(depth=1, symbol=symbol, callback=handle_socket_message)
while True:
time.sleep(0.1)
|
I'm unable to reproduce this. The only thing I can suggest is that it is down to network problems. This may be an unsatisfactory answer but as I can't reproduce it... Try running the same code with the same pybit version on a headless server, or if already doing that with another provider/location, and see if you still see the same results with that different network setting. |
Dear @dextertd I narrowed it down to two issues. In both of these cases, the socket will be closed unexpectedly. |
Hey there, I am using the Kline subscribe example (Python) from the quickstart examples:
https://github.com/bybit-exchange/pybit/blob/master/examples/websocket_example_quickstart.py
I get the following error:
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pybit/_websocket_stream.py", line 177, in _connect
raise websocket.WebSocketTimeoutException(
websocket._exceptions.WebSocketTimeoutException: WebSocket Unified V5 (wss://stream.bybit.com/v5/public/linear) connection failed. Too many connection attempts. pybit will no longer try to reconnect.
Any help on this error would be appreciated. I am on Mac. Python 3.11.5. pybit 5.7.0.
The text was updated successfully, but these errors were encountered: