opengsq-python icon indicating copy to clipboard operation
opengsq-python copied to clipboard

Timeout error for no apparent reason.

Open SwozyWozy opened this issue 1 year ago • 12 comments

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.

SwozyWozy avatar Mar 03 '24 00:03 SwozyWozy

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.

SwozyWozy avatar Mar 03 '24 03:03 SwozyWozy

Is the issue being resolved?

BattlefieldDuck avatar Mar 08 '24 22:03 BattlefieldDuck

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.

SwozyWozy avatar Mar 09 '24 02:03 SwozyWozy

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.

BattlefieldDuck avatar Mar 09 '24 15:03 BattlefieldDuck

I doubt that because it works fine in JS and online query websites. And I'm not querying the server that often.

SwozyWozy avatar Mar 09 '24 15:03 SwozyWozy

Can you please provide more info, like game server IP, and port if possible thanks.

BattlefieldDuck avatar Mar 09 '24 15:03 BattlefieldDuck

176.57.168.179:29015

SwozyWozy avatar Mar 09 '24 15:03 SwozyWozy

image the server gets queried every 10 seconds.

SwozyWozy avatar Mar 09 '24 15:03 SwozyWozy

Your server is unreachable sometimes.

image

The issue is either your server internet is unstable or the firewall rule is too strict.

BattlefieldDuck avatar Mar 09 '24 23:03 BattlefieldDuck

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?

SwozyWozy avatar Mar 09 '24 23:03 SwozyWozy

It is based on how your game server's internet is set up, it is hard to have an easy solution for that.

BattlefieldDuck avatar Mar 09 '24 23:03 BattlefieldDuck

Alright, well, thank you for looking into it. I will keep looking for a fix.

SwozyWozy avatar Mar 09 '24 23:03 SwozyWozy