Internal logs subscription error

Hi,

I have websockets setup on infura, and I keep getting every once in a while an error thrown Internal logs subscription error… This started happening around 2 weeks ago, and i haven’t changed anything in my setup. Is there some update happening in the background? I’ve raised an issue with the dev on websockets and I think he is pointing me to this problem being from the infura server…

I have been running into this too! websocket: close 1011 (internal server error): Internal logs subscription error

whenever i leave a websocket connection open with infura for a few hours (that i regularly ping)

Hi @kaleb-keny and welcome to the Infura community, @sdan!

One thing to check is if your library supports automatic/manual Pong, and to make sure your context doesn’t cancel the client by timeout, particularly if you’re using Golang. If you can let us know what language you’re using, we can likely help find a more specific solution, but it sounds like the most likely cause is either the ping/pong isn’t set up correctly, or that something is being blocked by a firewall.

Hi Leiya,

yeah i’m using python websockets library and the main snippet of my script is pretty simply:

import json
import websockets
import asyncio
import nest_asyncio
nest_asyncio.apply()

async def wssSubscribe(payload):
    
    link,data=payload
     
    async with websockets.connect(link) as ws:
        #setup subscription
        await ws.send(data)
        message = await ws.recv()
        message = json.loads(message)
        subscriptionID = message["result"]

        async for message in ws:
            message = json.loads(message)["params"]["result"]
            dumpToSql(responses=message)
                

where
link = 'wss://mainnet.infura.io/ws/v3/XXXXXXXX'
and
data is the subscription topic

This has happened mostly I think during gas intense times… And it is a fairly recent issue, where it didn’t occur throughout the time I used it in the past. But so far since gas went down, maybe infura infrastructure became less burdoned with these request and the error decreased considerably. I have asked the author of the websockets library and he told me that it is mainly coming from the server: “Your connection handler is throwing an exception. The exception message is: Internal logs subscription error

Also getting the same using golang so interested to get a reply from the support team.

In my definitely not a context cancelation.

Using the geth WatchLogs binding.