Lunarpages Web Hosting Forum

Web Hosting Guidance and Advice => Web Hosting Help and Troubleshooting => Topic started by: mschrier on January 25, 2018, 07:12:22 PM

Title: My sites are all DOWN - 500 Internal Server Errors
Post by: mschrier on January 25, 2018, 07:12:22 PM
I submitted a ticket, but it's been well over 24 hours and no response from Support.  All of our hosted websites are reporting 500 Internal Server errors or similar.

The error logs are full of the following type of message:

[error] [client 34.229.252.252] (12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/XXX/public_html/XXX.XXX/index.php, referer: XXX

We did not make any changes - in fact I rarely visit these sites and made no edits since October or November.  I don't know how long this problem has been occurring.

Anything I can check on from my end??
Title: Re: My sites are all DOWN - 500 Internal Server Errors
Post by: MrPhil on January 26, 2018, 05:46:04 AM
That's an unusual 500 error, so it will probably take support to fix it. The only thing I can think of at the moment is that you check your .htaccess and php.ini files to see if they're still there, and readable, and they contain your settings (especially any for allowed memory size). Settings that haven't been touched in years and use obsolete formats (e.g., php_value and php_flag in .htaccess) can cause 500 errors, but it's usually because the command is no longer permitted in that file. Anyway, make sure such PHP settings are in your php.ini file and not .htaccess. If that doesn't fix it, support will have to step in.

You got an automated response to your ticket, which tells you they've received it? Also, a problem like this may be more complex than run of the mill problems, and could take more time to deal with.
Title: Re: My sites are all DOWN - 500 Internal Server Errors
Post by: youfoundjake on February 06, 2018, 08:44:45 PM
mschrier..
I had a smiliar issue, and per supports answer on my ticket...

"Since your server has been switched to a new hardware machine which is under the newer version of operating system (CentOS 7), dual version of PHP (5.6 & 7) and MySQL 5.6, some of parameter settings in .htaccess are no longer with the new environments such as 'SetEnv'. You just need to remove or comment the coding line which has 'SetEnv' so that your website should back to be working."

take a look at your php.ini file...
Title: Re: My sites are all DOWN - 500 Internal Server Errors
Post by: josephbe on February 21, 2018, 07:17:48 AM
My memory utilization has been very high on these new servers due to stuck processes.

A week ago I had a DB table lock up and become completely inaccessible.  6 PHP requests for the same page that query that table got stuck and each consumed approx 1/6th the memory available on my account, and stayed that way for days.  All pages/domains were giving 500s.  The error log was full of 'unable to allocate memory.'  I spoke with support 14 times over 3 days to kill processes and revive the server and track down what was going on.  I reloaded the bad table to another name to restore functionality.  Days later, completely independent of either existing ticket, someone there created a new ticket about a stuck MySQL process and then killed the initial process that was locking the DB table (thank you!).

Fast forward a week.  Again I'm getting 500s across my sites.  I've spoken to support 4 times in the past 24 hours.  I have a ticket that has been raised to the highest urgency, and still has not been commented on for 20 hours.  In the past week the phone support reps have lost the ability to view and/or kill processes on the server.  I don't see a way to even view what pages FastCGI is serving myself, much less kill them.  So I'm stuck while my sites are sometimes serving 500s and sometimes not.

I have simple questions, like what processes/pages are currently stuck?  How can I enable the mysql slow query log?  Why isn't the max_execution_time config variable being honored on CentOS?  I have asked 4 support reps these questions with no answers.  Only - I've put this on the ticket and escalated the priority.  These are questions I would love to troubleshoot, but they don't give me enough authority to do so or can't tell me how to exercise it.

I've started the process of putting everything behind CloudFlare, to help reduce traffic and hopefully displace some 500 errors.  I'm doing everything I can but am extraordinarily frustrated.  Time to call support a again...
Title: Re: My sites are all DOWN - 500 Internal Server Errors
Post by: kjones75 on March 25, 2018, 12:28:52 PM
I've started the process of putting everything behind CloudFlare, to help reduce traffic and hopefully displace some 500 errors.  I'm doing everything I can but am extraordinarily frustrated.  Time to call support a again...

I've been through the same thing. I've tried blocking the IP addresses of suspicious activity (pretty much all of Russia and China must be blocked at this point), and I've installed Cloudflare (which didn't seem to have an effect at all, to be honest). Blocking IP addresses seemed to help temporarily, but the problem always returns.

I even moved 2 of my 3 websites that were sharing my LP account to another host thinking that would reduce the resource usage... those two websites are working great on my new host, but the one that remains on LP has gotten worse instead of better. The 508 errors used to be intermittent, now they are constant. I can't even log into my cPanel or FTP. And wouldn't you know it? I just renewed my LP hosting for another year a few days ago.

The server should not be having this much difficultly serving my small low traffic websites. It's not like I'm Facebook or something. My websites have never been super popular, and they've never used a ton of bandwidth or disk space. Ever since sites like Facebook and Twitter came along my sites have gradually lost more and more regular visitors. So I find it very difficult to believe my small websites are putting a strain on the server when they never did in their heyday several years ago.

I've been hosting the same 3 websites on my Lunar Pages account for almost 20 years now (since 2001). I've recommended LP to many people. But it looks like it's time for me to leave.
Title: Re: My sites are all DOWN - 500 Internal Server Errors
Post by: MrPhil on March 25, 2018, 03:06:06 PM
Has anyone on the support side been able to explain just what a "stuck process" or "stuck table" is? I presume something has gotten into an infinite loop. For a database, it would seem to be an error in the MySQL code (nothing you can normally do about it, unless you're doing some very advanced procedure stuff), but for a process, it might be something in your code. I suppose that it could also be some sort of deadlock over resource contention, but again, that's almost always an OS issue and not end-user code.

Has support offered any guidance on what might need updating in .htaccess or php.ini when your server is upgraded or account moved? Some obsolete settings may cause a 500 error, but I'm worried that from the sound of it, there are old settings that are simply ignored, or worse, do the wrong thing now. That should be the responsibility of the hosting company (LP) to at least document such things, if not scan customer accounts.
Title: Re: My sites are all DOWN - 500 Internal Server Errors
Post by: virpus123 on April 18, 2018, 01:01:50 AM
The 500 Internal Server Error is a very general HTTP status code that means something has gone wrong on the website's server, but the server could not be more specific on what the exact problem is.

Are You the Webmaster? See Fixing 500 Internal Server Error Problems on Your Own Site towards the bottom of the page for some better advice if you're seeing the 500 Internal Server Error on one or more of your own pages.
Title: Re: My sites are all DOWN - 500 Internal Server Errors
Post by: EricBoss on April 26, 2018, 11:02:04 AM
Don't worry guys, give them some time I'm sure they'll sort it out. It's annoying that's for sure.
Title: Re: My sites are all DOWN - 500 Internal Server Errors
Post by: hnrms on June 25, 2018, 04:31:33 PM
I've been getting 500 Internal Server Error also since last year, I was able to resolve it by creating a separate cron file (and i think by installing a cache plugin on my sites helps aswell - my sites are using wordpress).  The 500 internal server error was also because of high resource usage, and so "cannot allocate memory".  I've been with LP for more than 10 years, and never had any server issue before until the start of 2015 or 2016 (I think). :(
Title: Re: My sites are all DOWN - 500 Internal Server Errors
Post by: ritesh.patil732 on November 12, 2018, 10:37:10 PM
500 Internal Server Error is a generic error message, given when no more specific message is suitable. There are a number of causes for a 500 Internal Server Error to display in a web browser. Below is a sample error message.
Title: Re: My sites are all DOWN - 500 Internal Server Errors
Post by: EnglishMajor on February 10, 2019, 07:23:38 PM
Were you ever able to resolve this issue, or did you have to change webhosts? (I suppose if you changed webhosts, you won't be able to respond.)

I have been getting "cannot allocate memory" errors continually since December, and LP has not helped. This has not happened before. These errors do, indeed, represent excessive CPU usage. But, like some of the other posters in this thread, my site has minimal genuine usage. Even my mother doesn't know I have a blog, and maybe three customers browse my e-commerce site. (That's an exaggeration; it's probably closer to two.)

There are no deprecated directives in either my .htaccess or php.ini files.
Title: Re: My sites are all DOWN - 500 Internal Server Errors
Post by: MrPhil on February 11, 2019, 06:09:54 AM
Someone can still be active on this forum without having an LP hosting account. Indeed, swarms of spammers do that every day. :(

Per your other thread, you should see if heavy bot crawling is triggering your problems (and treat it by banning certain bots). Also, unless it sounds like your problems are very similar to (or the same as) the subject of this thread, please start a new thread rather than hijacking this one. It's difficult to follow a conversation when the subject area keeps lurching from one thing to another.
Title: Re: My sites are all DOWN - 500 Internal Server Errors
Post by: EnglishMajor on February 11, 2019, 06:58:46 AM
I am not hijacking anyone's thread, MrPhil. The problem mschrier reported is identical to mine, and some of the things posters tried to solve it are identical to what I am trying. I would like to know if anything actually worked, or if this is a problem introduced by LP and can be solved only by leaving LP.

As you know, I am banning bots, but I'm doing it blind. I cannot find any resource provided by LP that lets me know where my memory usage is truly coming from. kjones75 reported above that this solution did not work for him, and josephbe reported his problem was stuck processes. I don't have the faintest idea how I would know that processes were stuck or which ones.
Title: Re: My sites are all DOWN - 500 Internal Server Errors
Post by: Malin Cenusa on February 11, 2019, 09:21:18 AM
Do you already have a ticket opened with us on this matter? We can help you determine where the issue is coming from and provide you with further guidance. If you already have a ticket opened please post the ID here or if you're not comfortable posting it then please send the ticket ID via a private message and I will ask the proper department to investigate the matter further.
Title: Re: My sites are all DOWN - 500 Internal Server Errors
Post by: EnglishMajor on February 11, 2019, 12:08:22 PM
Thank you for your interest, Malin. Yes, I opened ticket MY34WE54MHL2 in December. Despite numerous specific questions and mostly vague and generic answers, I haven't gotten far. My account is still throttled, still throwing "cannot allocate memory" errors, and has been up only intermittently for nearly two months now.

If you know the answer, please tell me whether LP provides a tool that allows webmasters to see what processes are running, how much memory they are using, the ability to kill them, etc. The cPanel "Bandwidth" and "CPU and Concurrent Connection Usage" tools don't seem very useful in this situation. It would be helpful to know whether there are any processes running that I didn't authorize, or if legitimate processes are running inefficiently.
Title: Re: My sites are all DOWN - 500 Internal Server Errors
Post by: EnglishMajor on February 11, 2019, 12:10:58 PM
P.S. If I'm going to complain about customer support, I should also give credit where it is due, as I did in a related thread.  Laurențiu Victor Vișan provided a very detailed response when other customer service representatives did not. Although his suggestions did not resolve all issues, they resolved some.
Title: Re: My sites are all DOWN - 500 Internal Server Errors
Post by: Malin Cenusa on February 15, 2019, 11:38:02 AM
Hello @EnglishMajor, thank you for providing the requested ticket ID. I was able to track down the ticket and asked my supervisor to review and address it further.

Next, concerning your enquiry about the possibility to identify running processes, the amount of memory used and the possibility to kill them. Unfortunately cPanel does not provide such functionality. There is similar functionality integrated into the WHM panel, but on the shared environment, access to it is limited to our technicians only.

However, there are ways around this. One would be through shell access which we offer as an add-on. The shell access would offer you to execute commands via the terminal and get a list of all processes running under your user along with the PID's and resources used. This also allows you to kill the processes if needed.

Another solution, which may not work if there are not enough resources would be to use PHP scripts to pass commands to the shell.

A PHP file with the following contents would allow you to get all processes running under your username:

<?php system("ps -eo pid,user,cmd | grep `whoami`");  ?>

A similar PHP file with a form where you input the process ID and it executes the kill command would help you kill a specific process.

Both functions work only if the "system()" function is not disabled for security reasons in php.ini. If it is you can simply comment out the value while you do the execution of the PHP script.

Next, I have also revised your account's usage with my colleagues and noticed that the usage was stable over the past days. There were no suspicious processes recorded and most of the resource exhaust appears to have come from attacks targeting the scripts installed or from crawlers. We also noticed that you have blocked the vast majority through .htaccess which helps keep the resources within limits.

My colleagues will revise more in depth and will get back to you on the matter.
Title: Re: My sites are all DOWN - 500 Internal Server Errors
Post by: EnglishMajor on February 15, 2019, 01:03:14 PM
Thank you, @Malin Cenusa. That is very helpful. I will definitely experiment with the PHP commands you mentioned. I expect there to be enough resources to execute a single line of code from time to time. ;-)

The problem with banning hackers by ip in .htaccess is that they are always reappearing with new ip addresses. Does LP do any banning on a server configuration level?
Title: Re: My sites are all DOWN - 500 Internal Server Errors
Post by: BuckyBob on June 13, 2019, 09:13:52 AM
Well, ONE of my sites is down,
and tracing the error_log file
tells me it's some mysql calls in a php file.

Without getting too specific,
this php file was compliant with php 4, and sorta worked with php 5
but now that php 7 is working, this script breaks.

I know what to do to edit this file, make it php 7 compliant,
but - is there any other fix, perhaps to put in something on a php.ini file ? 

Thanks in advance for answering me - if I am hijaaking this thread I apologize. 
Title: Re: My sites are all DOWN - 500 Internal Server Errors
Post by: MrPhil on June 13, 2019, 09:27:19 AM
Unfortunately, LP refuses to support PHP 7.1 any more, and has 7.2 as the minimum possible level. 7.2 is very strict about what is allowed. You may be able to get moved to a PHP 5.6 server, but in any case should take the reprieve to update your site.

Are you specifically getting PHP errors, or are you getting warnings about using deprecated features? Such warnings can be shut off with a PHP ini_set() call, but keep in mind that eventually those will turn into real, fatal errors. I.e., they should still be fixed ASAP. I'm not familiar with any MySQL upgrades that are causing problems, but I suppose it's possible (MySQL is often upgraded along with PHP).

I have complained very loudly about their refusal to allow PHP 7.1 any more, but they insist it's out of support (which it isn't, for another 6 months).
Title: Re: My sites are all DOWN - 500 Internal Server Errors
Post by: BuckyBob on June 13, 2019, 09:36:59 AM
ya, i not write 7.1 or 7.2 - and the problem is with php4 compliant script being 'run' by php 7.2
It just doesn't work - the mysql calls in this script are php4 compliant.
So, I've got to mod the file to be php 7.2 compliant - my easiest example is a call to 'mysqli' , must change over 100 instances of a call via 'mysql' to 'mysqli' .  it's not just a single word replacement, the functions have to be rewritten to be php 7.2 compliant .  Hooray open source ! ug !

Yes, the errors are php errors, the script stops with the first error :D
I understand the pattern, as well. ug !

I'm ok with making the change. 
I will not ask to move to another server (I have many domains in my account here, and am happy mostly).

Thank you for your insight - I really appreciate it !
---
Unfortunately, LP refuses to support PHP 7.1 any more, and has 7.2 as the minimum possible level. 7.2 is very strict about what is allowed. You may be able to get moved to a PHP 5.6 server, but in any case should take the reprieve to update your site.

Are you specifically getting PHP errors, or are you getting warnings about using deprecated features? Such warnings can be shut off with a PHP ini_set() call, but keep in mind that eventually those will turn into real, fatal errors. I.e., they should still be fixed ASAP. I'm not familiar with any MySQL upgrades that are causing problems, but I suppose it's possible (MySQL is often upgraded along with PHP).

I have complained very loudly about their refusal to allow PHP 7.1 any more, but they insist it's out of support (which it isn't, for another 6 months).
Title: Re: My sites are all DOWN - 500 Internal Server Errors
Post by: MrPhil on June 13, 2019, 03:09:21 PM
Just to nitpick a little (as if you need it...), modern versions of PHP now typically support only MySQLi, rather than the ancient MySQL API. It's tedious work to convert MySQL calls to MySQLi, but not rocket science (unless you want to rewrite procedural code to OO). PHP itself has a number of gotchas, such as banning object constructors named the same as the class (use __construct instead). See https://www.php.net/manual/en/migrationXX.deprecated.php, where XX is 72, 71, 70, 56, 55, etc.