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

Websocket randomly exits with Error 1006 #368

Open
jmvsrules opened this issue Jul 7, 2023 · 4 comments
Open

Websocket randomly exits with Error 1006 #368

jmvsrules opened this issue Jul 7, 2023 · 4 comments

Comments

@jmvsrules
Copy link

Hey,

I recently noticed that my Solana.py websocket sometimes just randomly disconnects from the RPC server I am currently using. The websocket logging gave following result:

% sending keepalive ping
> PING 28 cc ef 76 [binary, 4 bytes]
< PONG 28 cc ef 76 [binary, 4 bytes]
% received keepalive pong
< PING '' [0 bytes]
> PONG '' [0 bytes]
= connection is CLOSED
! failing connection with code 1006
x closing TCP connection

Is there anything I can do to prevent these from happening and breaking? I don't know if it's an error by the RPC provider or from my side and I really would like to prevent these from happening.
I am using solana v0.30.2 (from pip) and therefore websockets v11.0.3.

Thanks for your help!

@jmvsrules
Copy link
Author

jmvsrules commented Jul 9, 2023

Some more information as I just saw I didn't include it.

I'm using the
async with connect() as websocket and then the
for idx, msg in asyncstdlib.enumerate(websocket) method.

I'm using the Alchemy websocket, it may also be an error on their side, I am not 100% sure about it.

@kevinheavey
Copy link
Collaborator

The websocket functionality is a wrapper around https://github.com/python-websockets/websockets

If possible, would be great if you can try recreate it with that library so we know if there's a problem on the solana-py side specifically

@jmvsrules
Copy link
Author

Hey, yeah I can try it although I'll need to look a bit into that library. As stated earlier, it might also just be that the RPC provider messes up after some time. I'll come back with updates as soon as I got them!

@jmvsrules
Copy link
Author

Hey, I just checked and it appears also when using the websockets library. I also tried it with an other RPC provider (Quicknode) and the same error happened. So I guess it just is something that occasionally happens and is not Solana.py-related. Do you know though if there is something to avoid this?

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

2 participants