Websocket does not work anymore

Hi,

we’re getting these errors on an enterprise plan:

https://dpaste.org/Nmdd8

And this is some example codes which throws the error:

https://dpaste.org/ARx3Z

It seems to not work at all. Any idea what might be wrong? It’s definitely an issue with moralis, as it works fine without any errors when we swich to different RPC urls.

Hi,

You still have those errors with websockets?

yes, we still do unfortunately

I see a lot of 429 errors (Too many requests) for your speedy node url. When it was the last time when it worked?

Honestly I don’t know. The question is why are there 429 errors? Shouldni’t it just bill the overage? Or is it really excessive or something?

I’m not sure what is going on there.

Can you try separately with a simple script to see if it works with Moralis RPC url?

Is there any chance you have such a simple script? I am kinda debugging this on behalf of another dev me personally I’m not working that much on web3 stuff

This is a python example that prints latest block with a web socket connection, it will require web3 library:

from web3 import Web3
import time
import datetime

ws_url = 'wss://speedy-nodes-nyc.moralis.io/fasdf/234/432/ws'
web3 = Web3(Web3.WebsocketProvider(ws_url))

for i in range(2):
    block_number = web3.eth.block_number
    print(repr(block_number), datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
    time.sleep(1)

Yep, getting a 429 with your example as well.

See here:

Yep, getting a 429 with your example as well.

See here:

try to stop current process/script, or use a different RPC url, and then try with my example

maybe current process somehow does a lot of requests

I wouldn’t know what we have running with moralis, as we switched everything to another RPC provider to keep our production setup running…

Do you maybe have any insights where requests are coming from? Like IPs, methods etc.

I’ll send you some info in DM

I can also regenerate the speedy node url/token for your account in case that you think that it will help you. In this case, current scripts that use that token should stop working, or at least not to influence the rate limit.

ok yes, please re-generate them

the speedy node token/url was regenerated now

Hi,
we are again running into 429 errors. We are using the WSS URLs to listen to some events. It works 100% fine with other RPC URLs, we have 0 issues there. We don’t have that many requests…

Did this new URL work ever, as I’m not sure if I tested this one directly after you re-generated it.

Your python code example returns this with the new URL:
websockets.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 429

Maybe it’s something specific to the WSS?

Hi,

It looks like you started to use ~20 minutes ago the new speedy token, it looks like you still get 429 errors. I’ll send you in DM some stats.

Has this been fixed? I’ running into the same issue even on an upgraded plan with speedy node web socket. Is there a way to catch this error? i can implement rate-limiting , but how do i catch this error so it doesn’t kill my script all together?