Anyone else getting "504 Gateway Time-out" errors?

Game development with Board Game Arena Studio
User avatar
JonChambers
Posts: 97
Joined: 03 July 2021, 11:40

Anyone else getting "504 Gateway Time-out" errors?

Post by JonChambers »

I've been getting this error a lot lately. Did I cause it?

What makes things worse is, it's inconsistent. Sometimes everything goes through fine and fast, but most of the time it's timing out.

I don't even know how to start debugging this.

Any leads?
User avatar
paramesis
Posts: 398
Joined: 28 April 2020, 05:00

Re: Anyone else getting "504 Gateway Time-out" errors?

Post by paramesis »

It’s likely you have an infinite loop that is repeatedly accessing the database. See this thread for more info:
https://boardgamearena.com/forum/viewto ... 343#p76343
User avatar
JonChambers
Posts: 97
Joined: 03 July 2021, 11:40

Re: Anyone else getting "504 Gateway Time-out" errors?

Post by JonChambers »

paramesis wrote: 22 September 2021, 08:44 It’s likely you have an infinite loop that is repeatedly accessing the database. See this thread for more info:
https://boardgamearena.com/forum/viewto ... 343#p76343
That was my first guess, but I have a page that seems to load fine sometimes and 504 other times, just by hitting refresh. I don't have any random element being called on load, so the fact that it works sometimes puzzles me more than the fact that it doesn't most of the time.

And when it works, it works instantly.

I've got no idea.

I haven't made any "loopy" changes lately, so not sure how an infinite loop could have started.
User avatar
JonChambers
Posts: 97
Joined: 03 July 2021, 11:40

Re: Anyone else getting "504 Gateway Time-out" errors?

Post by JonChambers »

Some troubleshooting:
game.php

Code: Select all

    protected function getAllDatas()
    {
        throw new BgaVisibleSystemException("no dramas this far game.php");
        ....
view.php

Code: Select all

      function build_page( $viewArgs )
    {
        throw new BgaVisibleSystemException("no dramas this far view.php");
        ....
Those errors are throwing maybe 5% of the time. The rest of the time, 504.

So if it's not an infinite loop in getAllDatas or build_page... where else could I put an infinite loop?
User avatar
JonChambers
Posts: 97
Joined: 03 July 2021, 11:40

Re: Anyone else getting "504 Gateway Time-out" errors?

Post by JonChambers »

And... it disappeared. As mysteriously as it arrived.

I'm running the exact same code it was 504ing on, but now I cannot 504 it if I try.

If anyone with access to the logs can figure out what the heck just happened, use the timestamps of my posts. Something a couple of minutes before I posted this just started working. I'll sleep better at night once I know what it was.
User avatar
JonChambers
Posts: 97
Joined: 03 July 2021, 11:40

Re: Anyone else getting "504 Gateway Time-out" errors?

Post by JonChambers »

And... it's back.

I was just testing my game, playing against myself. Everything was running at amazing speed then... it stopped.

My only guess is server bottleneck.

Anyone got any better guesses?
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: Anyone else getting "504 Gateway Time-out" errors?

Post by Een »

Some other devs may have had an infinite loop then solved it. Many developers are working on the studio, and it's unfortunately not possible to completely containerize modules with separate ressources.
User avatar
JonChambers
Posts: 97
Joined: 03 July 2021, 11:40

Re: Anyone else getting "504 Gateway Time-out" errors?

Post by JonChambers »

Een wrote: 22 September 2021, 09:40 Some other devs may have had an infinite loop then solved it. Many developers are working on the studio, and it's unfortunately not possible to completely containerize modules with separate ressources.
Forgive my ignorance, but what you're saying is that maybe there's another dev, right now, having an infinite loop issue that's consumed all of the resources of the whole server?

I think the thrust of my question is, "Is it best to walk away and look for some housework to do, then come back later?"
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: Anyone else getting "504 Gateway Time-out" errors?

Post by Een »

Yes. That being said, server load is low at the moment, so any ongoing game dev issue has probably been solved.
User avatar
robinzig
Posts: 461
Joined: 11 February 2021, 18:23

Re: Anyone else getting "504 Gateway Time-out" errors?

Post by robinzig »

For what it's worth, I often find the studio is slow and spottily-responsive when working on my projects late at night - around mindight/1am-ish, UK time. It's generally OK before then (between say 8 and 12 - I don't often do much in the studio at other times of day or night so can't comment on that).

But by this I just mean that when making a move it takes forever to respond, and sometimes gives be the "are you connected to the server" red banner - ironically quite often the move registers and the interface updates just after that (but not always, sometimes I have to resend the move, not infrequently several times in a row). That's different from seeing a 504 error, which I've never noticed myself. So probably not the same thing at all.

Having said that, I'm concerned about @Een's responses, that a dev could basically bring down the whole Studio with malicious code (whether deliberately or accidentally malicious). Granted hackers probably won't bother with BGA studio, but then it seems that no "hacking" is actually involved - you would just have to register an account, start a project and stick in a "while (true) { }" in setUpNewGame, start a game and walk away. Granted it's probably easy for admins to spot and shut down obvious stuff like that but it's a bit worrying that it's so easy to kill the server.
Post Reply

Return to “Developers”