500 internal server error when posting

Found an issue with the phpBB system here at NESdev? Use this forum to report problems.

Moderator: Moderators

calima
Posts: 1015
Joined: Tue Oct 06, 2015 10:16 am

500 internal server error when posting

Post by calima » Fri Jul 26, 2019 11:24 pm

Today when posting, there's a minute long wait, then a 500 internal server error, but the post has gone through.

nocash
Posts: 1086
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: 500 internal server error when posting

Post by nocash » Sat Jul 27, 2019 12:56 pm

I get something like that, too.
Yesterday it was a long delay and nothing happened (or I didn't wait long enough).
Today it was a 1-2 minute delay, and the browser then said something about gateway timeout.
The posts were written to the forum thread though, only the message-sent-successfully confirmation screen didn't show up.
EDIT: However, this message was sent without problems. And, the preview feature works without problems.

lidnariq
Posts: 8765
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: 500 internal server error when posting

Post by lidnariq » Sat Jul 27, 2019 1:04 pm

I've found that PMs have been troubled, but for me public posts have been fine.

User avatar
koitsu
Posts: 4215
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: 500 internal server error when posting

Post by koitsu » Sat Jul 27, 2019 5:24 pm

I think this might just be a "something is broken but what breaks/when is chance" situation. I too just got one of these when attempting to respond to a PM, but there's nothing different in phpBB resource-wise for PMs vs. public posts, so I don't know why one would be more broken than the other. (But so far for me, PMs definitely trigger it.)

Edit: the timeout took exactly 100 seconds. The server is returning HTTP 504 Gateway Timeout, but shows a custom HTTP 5xx status page. Here's some details I was able to pull from Chrome when reproducing the problem when sending a PM, with private/critical stuff XXX'd out. The 38.141.52.251 IP address shown in the header is of forums.nesdev.com itself.

Code: Select all

General:
Request URL: http://forums.nesdev.com/ucp.php?i=pm&mode=compose&action=reply&sid=XXXXXXX&p=55401
Request Method: POST
Status Code: 504 Gateway Time-out
Remote Address: 38.141.52.251:80
Referrer Policy: no-referrer-when-downgrade

Response Headers:
Connection: keep-alive
Content-Length: 1252
Content-Type: text/html
Date: Sun, 28 Jul 2019 00:26:28 GMT
ETag: "57d6ebd5-4e4"
Keep-Alive: timeout=60
Server: nginx

Request Headers:
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en-GB;q=0.9,en;q=0.8
Cache-Control: max-age=0
Connection: keep-alive
Content-Length: 4861
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryXXX
Cookie: XXX
Host: forums.nesdev.com
Origin: http://forums.nesdev.com
Referer: http://forums.nesdev.com/ucp.php?i=pm&mode=compose&action=reply&sid=XXX&p=55401
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36
i: pm
mode: compose
action: reply
sid: XXX
p: 55401
You'll know when it's happening because your browser will sit there saying "Waiting for ..." for several seconds. If you see that happen, IMMEDIATELY copy the text you just wrote and paste it somewhere for safe keeping, otherwise when the error page kicks in you might not be able to click Back and get it (depends on situation/site/etc.).

Someone needs to track down WhoaMan to find out what's going on. I suspect strongly something on the back end, maybe MySQL, maybe PHP/nginx acting weird? Could be something like resource starvation due to another hosted site chewing things up (seen this before). The HTTP 504 response seems to imply there's reverse proxying going on, and that the back-end HTTP server (probably the one that runs PHP) is not responding within 100 seconds.

Also: the HTTP 500 response page is one I've never seen before, so I can't identify what software is returning it -- it is not phpBB/PHP natively, and it is not stock nginx or stock Apache's HTTP 5xx status page. Oh, and there's a typo in the <title> ("Sever" not "Server"), so maybe this is a custom HTTP 5xx page...

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
    <title>500 &mdash; Internal Sever Error</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="description" content="Sorry, something went wrong. Internal Server Error"/>
    <style type="text/css">
        body {font-size:14px; color:#777777; font-family:arial; text-align:center;}
        h1 {font-size:180px; color:#99A7AF; margin: 70px 0 0 0;}
        h2 {color: #DE6C5D; font-family: arial; font-size: 20px; font-weight: bold; letter-spacing: -1px; margin: -3px 0 39px;}
        p {width:320px; text-align:center; margin-left:auto;margin-right:auto; margin-top: 30px }
        div {width:320px; text-align:center; margin-left:auto;margin-right:auto;}
        a:link {color: #34536A;}
        a:visited {color: #34536A;}
        a:active {color: #34536A;}
        a:hover {color: #34536A;}
    </style>
</head>

<body>
    <p><a href="http://forums.nesdev.com/">forums.nesdev.com</a></p>

    <h1>500</h1>
    <h2>Internal Server Error</h2>
    <div>
        Sorry, something went wrong :(
    </div>
</body>

</html>

nocash
Posts: 1086
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: 500 internal server error when posting

Post by nocash » Sat Jul 27, 2019 11:19 pm

"Internal sever error" appears to be a very common error message, there are lots of search hits for that string.
Are those error pages (especially timeouts) generated by the server? Or by network exchange points?
I thought they were just generated by the browser.

User avatar
koitsu
Posts: 4215
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: 500 internal server error when posting

Post by koitsu » Sun Jul 28, 2019 1:42 am

Those response codes are generated by HTTP servers, not network devices** or clients/browsers.

In the case of nesdev I believe there are (at least) two HTTP servers involved -- we'll call them A and B. A sits in front of B, possibly injecting ads into things, "siphoning" the data from B back out to Internet-facing clients. B is the HTTP server which runs the phpBB PHP code. This model is called reverse proxying, which is pretty much commonplace/industry-norm at this point. This model is used for other things, such as load balancing a pool of back-end servers (e.g. A runs nginx and/or haproxy, with the back-end servers being B (lets pretend 8 boxes) running nginx+phpfpm). HTTP 504 would thus be returned by A when, for some reason, its unable to reach/contact B, or maybe where B takes too long to respond with full headers/payload. Which situation is happening is impossible for anyone here to determine, only WhoaMan would know.

But this thread is not for "lets learn how HTTP works". :-) This thread is for "the site is acting wonky".

** - There is an exception to this, but it's irrelevant WRT this site.

User avatar
Bregalad
Posts: 7766
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Re: 500 internal server error when posting

Post by Bregalad » Sun Jul 28, 2019 1:00 pm

Normally everything was fine but for my last post I got a problem after posting it where the web page froze, but nevertheless the post was correctly submitted, so when I tried to re-post it warned me that another post had been made, and it was mine. So it's not big issue - just reloading the thread will work, but still that's annoying.

User avatar
tokumaru
Posts: 11465
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: 500 internal server error when posting

Post by tokumaru » Mon Jul 29, 2019 9:40 am

This has just happened to me too.

nocash
Posts: 1086
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: 500 internal server error when posting

Post by nocash » Mon Jul 29, 2019 2:24 pm

Here's the error page as how it occurs to me. There is no "Sever" in the title, and the link to "help.opera.com" looks a lot like being generated by my browser.
Where is our admin? We need to get helped : )

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html dir="ltr">
<head>
 <title>Error</title>
 <link rel="stylesheet" href="file://localhost/C:/PROGRAMS/OPERA/styles/error.css" media="screen,projection,tv,handheld,print,speech">
</head>
<body>
<h1>HTTP gateway timed out</h1>
<p>You tried to access the address <cite><a href="http://forums.nesdev.com/posting.php?mode=reply&f=23&t=18490">http://forums.nesdev.com/posting.php?mode=reply&f=23&t=18490</a></cite>, which is currently unavailable. Please make sure that the Web address (URL) is correctly spelled and punctuated, then try reloading the page.</p>
<ul>
 <li>Make sure your Internet connection is active and check whether other applications that rely on the same connection are working.</li>
 <li>Check that the setup of any Internet security software is correct and does not interfere with ordinary Web browsing.</li>
 <li>If you are behind a firewall on a Local Area Network and think this may be causing problems, talk to your systems administrator.</li>
 <li>Try pressing the F12 key on your keyboard and disabling proxy servers, unless you know that you are required to use a proxy to connect to the Internet. Reload the page.</li>
</ul>
<h2>Need help?</h2>
<ul>
 <li>Open the <a href="http://help.opera.com/">Opera Help</a>.</li>
 <li>Go to <a href="http://www.opera.com/support/">Opera's online support desk</a>.</li>
</ul>
</body></html>

User avatar
koitsu
Posts: 4215
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: 500 internal server error when posting

Post by koitsu » Mon Jul 29, 2019 3:03 pm

Your web browser (Opera) is choosing to override/inject its own HTTP 5xx result page, possibly specific to HTTP 504. You should ask the Opera people why they do that. It's probably something along the same lines as why IE does/did it for all sorts of statuses.

User avatar
Fisher
Posts: 989
Joined: Sat Jul 04, 2015 9:58 am
Location: -29.794229 -55.795374

Re: 500 internal server error when posting

Post by Fisher » Wed Jul 31, 2019 11:40 am

Same thing here with me.
But the post was there when I tried again, just like what happened with Bregalad.
Weird! :shock:

The screen:
Server error
Server error
The code:

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
    <title>500 &mdash; Internal Sever Error</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="description" content="Sorry, something went wrong. Internal Server Error"/>
    <style type="text/css">
        body {font-size:14px; color:#777777; font-family:arial; text-align:center;}
        h1 {font-size:180px; color:#99A7AF; margin: 70px 0 0 0;}
        h2 {color: #DE6C5D; font-family: arial; font-size: 20px; font-weight: bold; letter-spacing: -1px; margin: -3px 0 39px;}
        p {width:320px; text-align:center; margin-left:auto;margin-right:auto; margin-top: 30px }
        div {width:320px; text-align:center; margin-left:auto;margin-right:auto;}
        a:link {color: #34536A;}
        a:visited {color: #34536A;}
        a:active {color: #34536A;}
        a:hover {color: #34536A;}
    </style>
</head>

<body>
    <p><a href="http://forums.nesdev.com/">forums.nesdev.com</a></p>

    <h1>500</h1>
    <h2>Internal Server Error</h2>
    <div>
        Sorry, something went wrong :(
    </div>
</body>
</html>
Edit: Strangely this did not happened when I posted here...

User avatar
dougeff
Posts: 2614
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: 500 internal server error when posting

Post by dougeff » Wed Jul 31, 2019 11:52 am

Test.

It posted fine. From Chrome, from my phone.
nesdoug.com -- blog/tutorial on programming for the NES

User avatar
Fisher
Posts: 989
Joined: Sat Jul 04, 2015 9:58 am
Location: -29.794229 -55.795374

Re: 500 internal server error when posting

Post by Fisher » Wed Jul 31, 2019 1:20 pm

dougeff wrote:It posted fine. From Chrome, from my phone.
Maybe it's happening in specific forum places or in new(er) threads?
My last post that had given me this problem was in General Stuff, and I had no problem when creating a new thread there.

User avatar
koitsu
Posts: 4215
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: 500 internal server error when posting

Post by koitsu » Wed Jul 31, 2019 2:40 pm

This information is not particularly helpful, folks. It's been hashed over already. Only one person can do something about it -- WhoaMan -- and I don't know if the moderators here have tried to contact him or not (I've asked for this to be done on Discord as well).

Rahsennor
Posts: 475
Joined: Thu Aug 20, 2015 3:09 am

Re: 500 internal server error when posting

Post by Rahsennor » Fri Aug 09, 2019 12:47 am

Just happened to me too.

Not that I would have noticed without the big gray "500" on the screen, since the post went through fine and it's otherwise business as usual for my piece-of-crap connection.

Post Reply