Gameserver assignment errors

When I attempt to connect to some spaces, I recieve the following error:

(node:53731) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
failed to fetch gameserver assignment: {"message":"gs fetch timed out","stack":"Error: gs fetch timed out\n    at Timeout._onTimeout (/.../node_modules/@gathertown/gather-game-client/dist/src/Utils.js:127:48)\n    at listOnTimeout (node:internal/timers:564:17)\n    at process.processTim

The attempt to connect times out repeatedly. I am able to use the same code to connect to other spaces successfully. My account (and API key) have full permissions on both sites.

Any insight into what might be causing this error, and how to fix it?
WS 37.0.1

Any updates on this? I have an event all next week that uses many features through the API, and this seems to be an intermittent issue.

I have also had issues where my avatar (same account as the API key) will be logged into a space, but the websocket connection hits a bunch of 1006 errors as it tries to connect. Just in case that is linked.

sorry for the delay – are there any spaces it always fails for? or is it even intermittent per space?

some level of failures is expected but it should just retry and be fine

where are you running the code from? same computer as where it works in the browser I assume?

the 1006 errors are expected occasionally but not persistently

can you please send me the output of game.getDebugHistory() after a string of these failures? that will help see exactly what’s going on internally

also as a side note: be careful using the API in a large event – the rate limit is 36 or so actions per 2 seconds, and once you exceed that your actions will start just being rejected (this is to protect the whole space from getting overloaded)

so might want to throttle yourself if you’re going to be doing lots of actions at once

I will see about getting the debug history if it starts up again. I am not at risk of rate limit issues for this particular set of tools, but I will keep that in mind.

There may also be some amount of mea culpa, as I also started having some issues connecting so specific (non-gather related) npm repositories. Ran across a comment about my local DNS maybe causing a conflict, and reset my wireless connection. Lo and behold, all the issues cleared up. So there may have been some sort of cache issue related to moving my computer from one wireless network to another.

If it happens again, and I can replicate the fix, Ill post about it.

sounds good, thanks

and side note for debugging purposes: what was the DNS issue? if it happened to you it could happen to others, would be good if we could automatically handle stuff like this

My assumption is that my computer had some sort of conflict between what node was referencing for dns and what my browser was referencing. Node appears to assume that the OS will properly cache and provide adequate DNS information, and does not force an update.

So by leaving node open and running a script (probably) while I changed Wifi networks, I was inadvertently causing both NPM and axios (and therefore the gameserver http API call) to use cached data.

By disabling/re-enabling my Wifi, I caused my OS and Node to both refresh that cache. Not sure if there is really a fix, but at least knowing the (theoretical) issue exists could help others.

hm ok that’s a pretty weird failure mode. seems like your local dns resolver may have even been timing out, since I think an invalid address would have just failed instead

either way, going to drop this since it seems like very much an edge case