500 internal server error when posting

500 internal server error when posting
by on (#241210)
Today when posting, there's a minute long wait, then a 500 internal server error, but the post has gone through.
Re: 500 internal server error when posting
by on (#241232)
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.
Re: 500 internal server error when posting
by on (#241233)
I've found that PMs have been troubled, but for me public posts have been fine.
Re: 500 internal server error when posting
by on (#241238)
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:
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:
<!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>
Re: 500 internal server error when posting
by on (#241239)
"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.
Re: 500 internal server error when posting
by on (#241240)
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.
Re: 500 internal server error when posting
by on (#241254)
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.
Re: 500 internal server error when posting
by on (#241277)
This has just happened to me too.
Re: 500 internal server error when posting
by on (#241281)
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:
<!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&amp;f=23&amp;t=18490">http://forums.nesdev.com/posting.php?mode=reply&amp;f=23&amp;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>
Re: 500 internal server error when posting
by on (#241282)
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.
Re: 500 internal server error when posting
by on (#241341)
Same thing here with me.
But the post was there when I tried again, just like what happened with Bregalad.
Weird! :shock:

The screen:
Attachment:
File comment: Server error
Screenshot.png
Screenshot.png [ 14.3 KiB | Viewed 7178 times ]

The code:
Code:
<!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...
Re: 500 internal server error when posting
by on (#241342)
Test.

It posted fine. From Chrome, from my phone.
Re: 500 internal server error when posting
by on (#241343)
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.
Re: 500 internal server error when posting
by on (#241347)
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).
Re: 500 internal server error when posting
by on (#241540)
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.
Re: 500 internal server error when posting
by on (#241553)
I just had a new case. Typically every post I make gets the 500 error. However I just had it "not 500" me but take me to the "somebody has already posted you might want to look at it" where said post was the one I was making. It seems the system may be double adding each post and the 2nd one is what causes the error..
Re: 500 internal server error when posting
by on (#241555)
The system is not trying to double-add anything (per se). It's a manifestation of the back-end problem. Phrased more simply:

1. Type new response (i.e. a Reply)
2. Click Post (or Preview then Post)
3. Browser will sit there saying "Waiting for..." and never come back with the usual "Thanks for your post" confirmation
4. Open new tab and open up thread, OR, click back in existing tab (the one that's "Waiting for...")
5. Click Preview (or view the thread as stated)
6. You will see your post

The situation is different on brand new posts (not replies). But again, as I said, this is all a manifestation of the back-end problem. Once that gets solved, all of this weirdness will stop.

There is a bigger problem here. WhoaMan is still MIA. He also owns the nesdev.com domain, so even doing something like moving off of his hosting and onto something self-managed or actively maintained isn't an option. Memblers/Tepples need to think about that.
Re: 500 internal server error when posting
by on (#241562)
I've been getting this problem every time I post for a few days now.
Re: 500 internal server error when posting
by on (#241677)
Since this is happening with basically every post now, what I've been doing is I click on "submit", then a few seconds later I click on "preview" to make sure my post has gone through, since it shows as a new post that has been made, just to skip the pointless waiting and the error page. I also copy the whole post before submitting, just in case, but so far every post has gone through without problems.
Re: 500 internal server error when posting
by on (#241726)
I am experiencing the problem for 1-2 weeks too. When sending "sumbit" in response to PM message, it just waits but going back to the message outbox shows that it was sent.
Posting on public forum does not cause trouble.

Looks like the last sentence was false - it also hang up while replying to this topic, but as I can see, the message was sent.
Re: 500 internal server error when posting
by on (#241992)
Happened to me today when sending a PM. Did anyone actually get in contact with WhoaMan?
Re: 500 internal server error when posting
by on (#242138)
Hahaha I was just posting to say that the problem wasn't happening to me anymore after a number of consecutive successful posts, but this post in particular triggered the problem again, so, never mind.
Re: 500 internal server error when posting
by on (#242218)
I noticed this too. Thankfully, posts seem to go through without issues, it's just that the page never advances to the "Post submitted successfully!" screen.

I have experience maintaining ASP.NET code running on IIS, and several small PHP scripts running on a LAMP server, and my intuition tells me that, since the post reaches the database but the page never redirects correctly, some function call in the PHP script responsible for posting a new reply is timing out, which would cause a 500 error, since the PHP script isn't "finishing" correctly.

Also, since NesDev has been experiencing email issues lately, it's not a stretch to suspect that bad SMTP settings could cause some kind of SendEmailNotification() function in PHP to block and then time out. If phpBB has a way to disable email notifications, see if disabling them fixes posting replies to threads here, and that can be an easy thing to confirm or rule out.

Edit: Editing a post doesn't cause a 500, so I'm thinking it's notifications or something like that.
Re: 500 internal server error when posting
by on (#242293)
Another problem: It looks as if nesdev.com was completely down today and yesterday.
Except, yesterday afternoon (central european time) it worked for a brief moment.
And, today it didn't work either until about 16:00 cet.
Re: 500 internal server error when posting
by on (#242294)
I experienced some inaccessibility too earlier today and yesterday evening.
Posting also produces the gateway timeout error after a while, the post itself always gets sent though.
Re: 500 internal server error when posting
by on (#242303)
Site was down for me too, last night and most of today, which is a little concerning when your sysadmin seems to be awol. :P
Re: 500 internal server error when posting
by on (#242307)
I was hoping the downtime yesterday was because someone was finally getting these problems straightened out. Where the heck is WhoaMan? I hope nothing serious has happened to him...
Re: 500 internal server error when posting
by on (#242350)
Yes, I hope that he's fine, too! At the moment, it's been mostly koitsu saying that there is a problem and that we can't contact WhoaMan. That makes me wonder about a couple of things...

Is it normal that WhoaMan is disappearing for a couple of months, or is that uncommon?
Is he really the one-and-only person with all nesdev passwords & server access rights?
Did anyone manage to contact him & knows what's up?
If not, did anyone already try to contact him... via PM, email, phone, door bell...?
Can the other forum staff people confirm if there is a problem?
If there's a problem: Is it known if the server fees are still being paid?

Maybe someone could help if we knew more about was already done, and if there's a problem at all.
Re: 500 internal server error when posting
by on (#242353)
I only know WhoaMan from the forum, and must have been IRC in the past. It is normal for him to not be around on the forum, but he's been in the community for what must at least 15 years by now, I remember the game Hot Logic he made is at least that old.

I believe he said the server was related to his work, so I'd assume he's doing OK and is in the same business, since we're still here.

As far as I know, he's the only one with full access. I make backup copies for the forum database occasionally, and I believe there is a backup of the wiki, but that's something that I don't have myself, so it would be great to verify that.

I tried sending an email to him while the server was down, it was an old email address so I don't know if he monitors it, I haven't heard back.
Re: 500 internal server error when posting
by on (#242808)
Testing, testing, I was literally just able to make a post in another thread without it timing out...

Edit: Nope, still timed out here. It did not time out in that other thread though, I really think it's notification-related.