Timeout error for no apparent reason.
import asyncio
from dotenv import load_dotenv
import os
from opengsq.protocols import Source
load_dotenv()
async def main():
source = Source(host=os.getenv("HOST_IP"), port=os.getenv("QUERY_PORT"))
info = await source.get_info()
print(info)
asyncio.run(main())
I keep getting timeout error for no reason, no matter what server. Tested on 4 machines with same results.
After 3 days of constant timeout errors for no reason, just now it decided to work again with no changes to the code or environment. I also want to add that querying the server worked fine when using JS. The JS script was tested on 3 machines to make sure and worked fine on all 3.
Is the issue being resolved?
It's very inconsistent. It is no longer constantly timing out, but it will randomly stop working, and take anywhere between 1–5 tries to get a response.
This might be the problem of rate limiting issue. Your game server or firewall might rate-limit the query. You might need to whitelist the query server IP.
I doubt that because it works fine in JS and online query websites. And I'm not querying the server that often.
Can you please provide more info, like game server IP, and port if possible thanks.
176.57.168.179:29015
the server gets queried every 10 seconds.
Your server is unreachable sometimes.
The issue is either your server internet is unstable or the firewall rule is too strict.
How come when I query it in JS using gamedig and use a website like https://cmsminecraftshop.com/en/query/ it works fine? Do you know how I can fix this?
It is based on how your game server's internet is set up, it is hard to have an easy solution for that.
Alright, well, thank you for looking into it. I will keep looking for a fix.