Frequent internal server error 500 + unable to backup database

Started by krystal, July 10, 2018, 05:23:38 PM

Previous topic - Next topic

krystal

My forum: http://www.playmofriends.com/forum/index.php
Running SMF 2.0.15
PHP Version 5.6.36 (http://www.playmofriends.com/phpinfo.php)
Caching Level - No caching


I upgraded my forum to 2.0.15 back in January and everything had been running perfectly until about a month ago.
Suddenly forum users were getting repeated 500 errors in all sorts of different places. There doesn't seem to be any pattern - they happen randomly on any page, sometimes even when trying to reply to a post or send a personal message. The pages can always be reached after a refresh (or sometimes two) so nothing is actually missing as far as I can tell.

I wrote to my webhost (Dreamhost) who I have been with since 2005, and they have offered a few suggestions but nothing has worked so far. They observed that there was high traffic so I added some code to the .htaccess to block all the unwanted bots. I also enabled debugging for them, but they weren't able to gain anything helpful from it. In their opininon the errors are not due to "overly utilizing the servers resources."

Additionally, I have an even more serious problem where I am unable to download a backup of the database. It tries to load and eventually times out and returns a File Not Found error. Very worrying!

The error log seems to be full of the same type of message each time this happens:

Premature end of script headers: php56.cgi, referer: http://www.playmofriends.com/forum/index.php?board=14.0
File does not exist: /home/playmo/playmofriends.com/internal_error.html, referer: http://www.playmofriends.com/forum/index.php?board=14.0


I hope I have provided enough information. Even after all this time, I'm not very experienced at this stuff.  :-[

GigaWatt

If you'e got cache enabled... don't move a muscle.

We've been seeing these 500 errors related to corrupted cache files and would like to debug it. As I can see, you forum still emits the 500 error, so what we would like is a dump (a copy) of the cache folder's content and the error log of the forum. The first can be obtained via FTP from your webspace (it's the cache folder in the forum's root directory). If you're not sure whether you're using caching or not, open up the cache folder. If the only files present in the cache folder are .htaccess and index.php, you're not using caching and the 500 error is probably not related with the cache setting. But, if you are, we would appreciate if you could copy the content (download it) from the cache folder and share it here on the forum. You could archive the content (zip will do just fine) and if the archive is too big to be attached as an attachment on the forum, you could share it through some file sharing site (zippyshare offers uploads up to 200MB in file size).

About the admin error log... it should reside in the database (I'm kind of slow today... can't really remember at the moment, if some of the members remember the exact place of the forum's error log, please correct me). In any case, a database dump could also be helpful.

About not being able to dump the database, do the following. Open up phpMyAdmin, select the database, go to the Export tab, select "Custom - display all possible options", in the Output settings in the Compression settings, select "zipped", scroll down to the end and click on "Go". Try it like this and report back ;).



I'm sorry for not giving you the answer straight away, but if you are using forum cache and the 500 error is related to caching, we would loose all forensic material if I told you how to fix it right away :S. Once again, I'm sorry...
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

krystal

Thank you for your help! I managed to download a backup of the database using your detailed instructions  :)

I don't have cache enabled. I checked the folder and it only contains .htaccess and index.php

On the caching page in Server Settings there is a message in red: SMF has not been able to detect a compatible accelerator on your server.

I guess this is going to make it a lot harder to debug  :(

Do you still need a copy of the error log? You mean the one on the server in the logs directory or a different one?

GigaWatt

Quote from: krystal on July 10, 2018, 08:06:51 PM
On the caching page in Server Settings there is a message in red: SMF has not been able to detect a compatible accelerator on your server.

Yep, this means that your host doesn't support caching, but don't worry about it not supporting caching.

Quote from: krystal on July 10, 2018, 08:06:51 PM
I guess this is going to make it a lot harder to debug  :(

Yeah... kind of... we'll see ;).

Quote from: krystal on July 10, 2018, 08:06:51 PM
Do you still need a copy of the error log? You mean the one on the server in the logs directory or a different one?

If you could access your server's error log, yes, that would be preferable. And a copy of the most recent error logs from the forum's admin panel too ;).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

krystal

Quote from: GigaWatt on July 10, 2018, 08:17:08 PM
If you could access your server's error log, yes, that would be preferable. And a copy of the most recent error logs from the forum's admin panel too ;).

I hope what I have attached is the correct file :)

I checked the error log on the forum (which I cleared prior to June 26 when trying to do some maintenance).
There are only 11 logs and they are all for "Password incorrect" from various users.


Dreamhost replied in the meantime and said they noticed a number of hits showing this:

Request exceeded the limit of 10 internal redirects due to probable configuration error.
Use 'LimitInternalRecursion' to increase the limit if necessary.
Use 'LogLevel debug' to get a backtrace.


I don't know how to do the debug it suggests. :-[

The DH support guy suggested adding a rewrite rule for 'LimitInternalRecursion' to .htaccess to see if it will help.
Could you please tell me the actual code I need to put in and does it matter if it goes at the start or end of the file?

Thanks again!



GigaWatt

You probably have RewriteEngine On in your .htaccess file. Could you post the content of your .htaccess file (in case you can't find it, it's in the root of your forum)?

In any case, if you encounter RewriteEngine On in your .htaccess file (you can open it with Notepad++), add the following code after it.

Original code:

Code (.htaccess) Select
RewriteEngine On

Modified code:

Code (.htaccess) Select
RewriteEngine On
RewriteBase /


It doesn't matter how many spaces RewriteBase / has in front of it as long as it's in a new line and right after RewriteEngine On.

Try this and see if the 500 errors stop appearing ;). If your .htaccess file doesn't contain the code RewriteEngine On, as I said previously, either attach the file in your post or post the content of the file in the post ;).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

krystal

Quote from: GigaWatt on July 11, 2018, 09:39:45 AM
In any case, if you encounter RewriteEngine On in your .htaccess file (you can open it with Notepad++), add the following code after it.

Original code:

Code (.htaccess) Select
RewriteEngine On

Modified code:

Code (.htaccess) Select
RewriteEngine On
RewriteBase /


Thanks! I added the code as you said. The trouble is is I only added the Rewrite command a few days ago, when we were already having the 500 error for a few weeks before it. :(

This is what I have now:

ErrorDocument 404 /notfound.html



# Begin HackRepair.com Blacklist
RewriteEngine On
RewriteBase /
# Abuse Agent Blocking
RewriteCond %{HTTP_USER_AGENT} ^[Ww]eb[Bb]andit [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Acunetix [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^binlar [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Bolt\ 0 [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^BOT\ for\ JCE [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Bot\ mailto:craftbot\@yahoo\.com [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^casper [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^checkprivacy [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^clshttp [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^cmsworldmap [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^comodo [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Custo [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Default\ Browser\ 0 [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^diavol [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^DIIbot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^DISCo [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^dotbot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Download\ Demon [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^eCatch [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^EirGrabber [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailCollector [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Express\ WebPictures [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^extract [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^EyeNetIE [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^feedfinder [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^FHscan [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^FlashGet [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^flicky [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^FunWebProducts [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^g00g1e [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^GetRight [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^GetWeb! [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Go-Ahead-Got-It [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Go!Zilla [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^grab [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^GrabNet [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Grafula [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^harvest [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^HMView [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^ia_archiver [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Image\ Stripper [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Image\ Sucker [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^InterGET [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Internet\ Ninja [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^InternetSeer\.com [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^jakarta [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Java [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^JetCar [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^JOC\ Web\ Spider [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^kanagawa [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^kmccrew [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^larbin [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^LeechFTP [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^libwww [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Mass\ Downloader [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Maxthon$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^microsoft\.url [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^MIDown\ tool [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^miner [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Mister\ PiX [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Mozilla\.*Indy [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Mozilla\.*NEWT [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^MSFrontPage [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Navroad [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^NearSite [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Net\ Vampire [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^NetAnts [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^NetSpider [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^NetZIP [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^nutch [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Octopus [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Offline\ Explorer [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Offline\ Navigator [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^PageGrabber [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Papa\ Foto [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^pavuk [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^pcBrowser [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^PeoplePal [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^planetwork [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^psbot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^purebot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^pycurl [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^RealDownload [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^ReGet [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Rippers\ 0 [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^SeaMonkey$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^sitecheck\.internetseer\.com [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^SiteSnagger [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^skygrid [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^SmartDownload [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^sucker [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^SuperBot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^SuperHTTP [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Surfbot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^tAkeOut [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Teleport\ Pro [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Toata\ dragostea\ mea\ pentru\ diavola [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^turnit [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^vikspider [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^VoidEYE [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Web\ Image\ Collector [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Web\ Sucker [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WebAuto [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WebCopier [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WebFetch [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WebGo\ IS [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WebLeacher [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WebReaper [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WebSauger [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Website\ eXtractor [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Website\ Quester [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WebStripper [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WebWhacker [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WebZIP [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Wget [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Widow [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WPScan [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WWW-Mechanize [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WWWOFFLE [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Yandex [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^zmeu [NC,OR]
RewriteCond %{HTTP_USER_AGENT} 360Spider [NC,OR]
RewriteCond %{HTTP_USER_AGENT} AhrefsBot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} CazoodleBot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} discobot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} EasouSpider [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ecxi [NC,OR]
RewriteCond %{HTTP_USER_AGENT} GT::WWW [NC,OR]
RewriteCond %{HTTP_USER_AGENT} heritrix [NC,OR]
RewriteCond %{HTTP_USER_AGENT} HTTP::Lite [NC,OR]
RewriteCond %{HTTP_USER_AGENT} HTTrack [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ia_archiver [NC,OR]
RewriteCond %{HTTP_USER_AGENT} id-search [NC,OR]
RewriteCond %{HTTP_USER_AGENT} id-search\.org [NC,OR]
RewriteCond %{HTTP_USER_AGENT} IDBot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Indy\ Library [NC,OR]
RewriteCond %{HTTP_USER_AGENT} IRLbot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ISC\ Systems\ iRc\ Search\ 2\.1 [NC,OR]
RewriteCond %{HTTP_USER_AGENT} LinksCrawler [NC,OR]
RewriteCond %{HTTP_USER_AGENT} LinksManager.com_bot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} linkwalker [NC,OR]
RewriteCond %{HTTP_USER_AGENT} lwp-trivial [NC,OR]
RewriteCond %{HTTP_USER_AGENT} MFC_Tear_Sample [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Microsoft\ URL\ Control [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Missigua\ Locator [NC,OR]
RewriteCond %{HTTP_USER_AGENT} MJ12bot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} panscient.com [NC,OR]
RewriteCond %{HTTP_USER_AGENT} PECL::HTTP [NC,OR]
RewriteCond %{HTTP_USER_AGENT} PHPCrawl [NC,OR]
RewriteCond %{HTTP_USER_AGENT} PleaseCrawl [NC,OR]
RewriteCond %{HTTP_USER_AGENT} SBIder [NC,OR]
RewriteCond %{HTTP_USER_AGENT} SearchmetricsBot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Snoopy [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Sogou [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Steeler [NC,OR]
RewriteCond %{HTTP_USER_AGENT} URI::Fetch [NC,OR]
RewriteCond %{HTTP_USER_AGENT} urllib [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Web\ Sucker [NC,OR]
RewriteCond %{HTTP_USER_AGENT} webalta [NC,OR]
RewriteCond %{HTTP_USER_AGENT} WebCollage [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Wells\ Search\ II [NC,OR]
RewriteCond %{HTTP_USER_AGENT} WEP\ Search [NC,OR]
RewriteCond %{HTTP_USER_AGENT} XoviBot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} YisouSpider [NC,OR]
RewriteCond %{HTTP_USER_AGENT} zermelo [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ZyBorg
RewriteRule ^.* - [F,L]
# Abuse bot blocking rule end

# Abuse HTTP Referrer Blocking
RewriteCond %{HTTP_REFERER} free-social-buttions\.com [NC,OR]
RewriteCond %{HTTP_REFERER} best-seo-offer\.com [NC,OR]
RewriteCond %{HTTP_REFERER} buttons-for-your-website\.com [NC,OR]
RewriteCond %{HTTP_REFERER} www1.free-social-buttons\.com [NC,OR]
RewriteCond %{HTTP_REFERER} www2.free-social-buttons\.com [NC,OR]
RewriteCond %{HTTP_REFERER} www3.free-social-buttons\.com [NC,OR]
RewriteCond %{HTTP_REFERER} 100dollars-seo.com\.com [NC,OR]
RewriteCond %{HTTP_REFERER} www4.free-social-buttons\.com
RewriteRule ^.* - [F,L]
# Abuse HTTP Referrer Blocking end

# Start Custom Blocks
# Aboundex
Deny from 173.192.34.95
# Bluecoat
deny from 8.21.4.254
deny from 65.46.48.192/30
deny from 65.160.238.176/28
deny from 85.92.222.0/24
deny from 206.51.36.0/22
deny from 216.52.23.0/24
# cyveillance
deny from 38.100.19.8/29
deny from 38.100.21.0/24
deny from 38.100.41.64/26
deny from 38.105.71.0/25
deny from 38.105.83.0/27
deny from 38.112.21.140/30
deny from 38.118.42.32/29
deny from 65.213.208.128/27
deny from 65.222.176.96/27
deny from 65.222.185.72/29
# Cyberpatrol
deny from 38.103.17.160/27
# Internet Identity - Anti-Phishing
deny from 66.113.96.0/20
deny from 70.35.113.192/27
# Ironport
deny from 204.15.80.0/22
# Lightspeed Systems Security
deny from 66.17.15.128/26
deny from 69.84.207.32/27
deny from 69.84.207.128/25
# Layered Technologies
deny from 72.36.128.0/17
deny from 72.232.0.0/16
deny from 72.233.0.0/17
deny from 216.32.0.0/14
# M86
deny from 67.192.231.224/29
deny from 208.90.236.0/22
# Phish-Inspector.com
deny from 209.147.127.208/28
# Prescient Software, Inc. Phishmongers
deny from 198.186.190.0/23
deny from 198.186.192.0/23
deny from 198.186.194.0/24
# urlfilterdb
deny from 207.210.99.32/29
# websense-in.car1.sandiego1.level3.net
deny from 4.53.120.22
# Websense
deny from 66.194.6.0/24
deny from 67.117.201.128/28
deny from 69.67.32.0/20
deny from 131.191.87.0/24
deny from 204.15.64.0/21
deny from 208.80.192.0/21
deny from 212.62.26.64/27
deny from 213.168.226.0/24
deny from 213.168.241.0/30
deny from 213.168.242.0/30
deny from 213.236.150.16/28
# End Custom Blocks. Add a couple line breaks below this as well.

# Block comment spammers and bad bots
# Add your custom IP block list here. Example format:
# deny from 4.53.120.22
# End Block comment spammers, bad bots and some proxies
# End HackRepair.com Blacklist, http://pastebin.com/u/hackrepair



QuoteTry this and see if the 500 errors stop appearing ;).

Unfortunately, that didn't fix it.  :(
Just got another error page when trying to send a PM (http://www.playmofriends.com/forum/index.php?action=pm)

Kindred

yeah, that htaccess is going to cause actual delays on the site....  having that many things that need to be analyzed and pre-parsed sucks up processing power on every pageview.


why are you using rewrite conditions to attempt to block bots?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

krystal

Quote from: Kindred on July 11, 2018, 10:46:08 AM
why are you using rewrite conditions to attempt to block bots?

When I first wrote to my webhost about the problems we were having, they suggested the server errors might be caused by heavy traffic.
We don't have very many active members so I assumed there could be a lot of bot activity.
I was hunting around for a way to combat the unnecessary ones and came across that code.
Thought I'd give it a try, since if it didn't work I could easily remove it again.

I only added the rewrite conditions a few days ago, whereas the errors have been around for several weeks.

GigaWatt

Did you change anything on your forum before the errors started happening... installing a mod, a large file upload by some user maybe ???.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

krystal

No, I haven't changed anything since January
And I have a cap on the size of uploads so it couldn't be that
That's what has me so baffled  :-\

Illori

that does not mean your host has not changed anything.

krystal

Quote from: Illori on July 11, 2018, 01:31:06 PM
that does not mean your host has not changed anything.

Yeah, I know. :) That's why I wrote to them initially, giving them a heads up.
If it was something they changed which has caused the problem, surely they don't need me to tell them that?
Wouldn't they make the connection themselves?

GigaWatt

Quote from: krystal on July 11, 2018, 01:35:56 PM
If it was something they changed which has caused the problem, surely they don't need me to tell them that?
Wouldn't they make the connection themselves?

No, actually, in most cases, they just want to do as little work as possible. Not that I blame them, you're not their only client... but still :S.

Have you had any problems since you included RewriteBase / in .htaccess?
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

krystal

Quote from: GigaWatt on July 11, 2018, 05:04:27 PM
Have you had any problems since you included RewriteBase / in .htaccess?

Yes, it's still happening.  :(
Not sure if they are as frequent now, hard to tell.
I had to click around a bit longer just now before I hit one here: http://www.playmofriends.com/forum/index.php?action=help

Quote from: GigaWatt on July 11, 2018, 05:04:27 PM
Quote from: krystal on July 11, 2018, 01:35:56 PM
If it was something they changed which has caused the problem, surely they don't need me to tell them that?
Wouldn't they make the connection themselves?

No, actually, in most cases, they just want to do as little work as possible. Not that I blame them, you're not their only client... but still :S.

Ah, right. I did wonder if that could be the case.  ::)

I have gone back through the older error logs on the server and I think I have pinpointed the date the 500 errors started happening for forum users.
Error logs before that date were showing true errors where bots were searching for files that didn't actually exist at that time... robots.txt, guestbooks, etc.
Armed with this knowledge I'll go back to my host and see if something changed on the server that particular day.

GigaWatt

From what I've noticed, it happens randomly. I clicked on Album list, it showed a 500 error, then clicked again, once again a 500, third time, it loaded properly.

Quote from: krystal on July 11, 2018, 05:53:19 PM
I have gone back through the older error logs on the server and I think I have pinpointed the date the 500 errors started happening for forum users.
Error logs before that date were showing true errors where bots were searching for files that didn't actually exist at that time... robots.txt, guestbooks, etc.
Armed with this knowledge I'll go back to my host and see if something changed on the server that particular day.

That will probably be the best approach at this point, since there doesn't seem to be any other logical explanation except that something's changed on your host's side.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

krystal

Just received their reply:

QuoteThanks for contacting DreamHost. The only issue was that our admin team
restart the Apache services as they had become unresponsive. The server
has been up and stable ever since however.

Really don't know what to do now.  :(

Arantor


krystal


GigaWatt

Why don't you just ask the support team from your host to try and click on some of the menus and see for themselves that this is not actually a problem with the software, it's happening randomly and it started since they restarted the service.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

krystal

Quote from: GigaWatt on July 12, 2018, 10:03:48 PM
Why don't you just ask the support team from your host to try and click on some of the menus and see for themselves that this is not actually a problem with the software, it's happening randomly and it started since they restarted the service.

I already did that right at the beginning. I even created a temporary account for them on the forum so they could test it as a user and not just a guest. I have given them as much information as I can right down to the date and time it started happening.

They did test it a few times (not always the same support member) and they also encountered the errors, but they haven't come up with a solution. The last suggestion they gave was to add a rule to .htaccess for Limitinternalrecursion. I haven't done that yet.

Illori

if your host will not help you resolve the issue, then it might be time to look for a new host.

GigaWatt

Try adding this to .htaccess before RewriteEngine On.

LimitInternalRecursion 30

If the forum still emits a 500 error, check the server's error log, if the error message changed to "Request exceeded the limit of 30 internal redirects due to probable configuration error.", as Illori said, I'd look for a different host.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

krystal

Quote from: GigaWatt on July 13, 2018, 06:17:15 AM
If the forum still emits a 500 error, check the server's error log, if the error message changed to "Request exceeded the limit of 30 internal redirects due to probable configuration error.", as Illori said, I'd look for a different host.

Thanks! I added the code :)

The error message in the log now is:

[Fri Jul 13 05:56:20 2018] [alert] [client xx] /home/playmo/playmofriends.com/.htaccess: LimitInternalRecursion not allowed here

Kindred

lol... that means that your host does not allow you to configure the server like that.

take out the line
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

krystal

Quote from: Kindred on July 13, 2018, 09:15:20 AM
lol... that means that your host does not allow you to configure the server like that.

Weird since they were the ones who first suggested adding it! ::)

Quotetake out the line

I took it out straight away since the whole site went down when I tested it.


So the fault for the repeated 500 errors definitely lies with the host in this case?
It wouldn't be due to a file somehow becoming corrupt?
(Please excuse my lack of knowledge  :-[ )

GigaWatt

I don't think it's a corrupt file problem because it happens randomly, sometimes the requested link loads, sometimes it doesn't... maybe malfunctioning hardware (disk, storage, etc.), but that's their problem, not yours.

Ask them to transfer you to another rig (server). You'll have to reconfigure your forum, but even if you change hosts, you'd have to do it anyway, so... at least this way you don't have to go through all if the bureaucracy.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Kindred

Actually, since it is intermittent, the chances are that there is a badly formed code bit somewhere which is only triggered in some circumstances
(like an advert that rotates - the error only happens when the badly formed advert gets into the dipslay)

So, what mods do you have installed?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

krystal

Quote from: GigaWatt on July 13, 2018, 11:33:30 AM
Ask them to transfer you to another rig (server). You'll have to reconfigure your forum, but even if you change hosts, you'd have to do it anyway, so... at least this way you don't have to go through all if the bureaucracy.

I'll definitely give that a try if nothing else works! :)

Quote from: Kindred on July 13, 2018, 11:45:00 AM
So, what mods do you have installed?

These are the only ones I have.
I try to keep things as simple as possible.
None of these were added or modified recently.

1.    Add Social Media Icons To Profiles    1.0.7    
2.    Bookmarks    2.5    
3.    Started By Column    1.41    
4.    Custom Tab    1.2    
5.    Bakers Dozen Pages    1.2

Aleksi "Lex" Kilpinen

There's been quite a few errors referenced in this topic already, with different solutions suggested, so just to clear up things a bit.

What kind of errors are you now seeing, could you copy paste a few here in full?
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

krystal

Quote from: Aleksi "Lex" Kilpinen on July 14, 2018, 04:24:19 AM
What kind of errors are you now seeing, could you copy paste a few here in full?

Today's server log attached :)

Aleksi "Lex" Kilpinen

OK, mostly it is the "Premature end of script headers"

Firstly, I would go through all your file and folder permissions, and try to make sure they are not writable to the whole world - to see if that fixes it.

If not, well - that error is one of the vaguest of them all - and has a load of different possible causes, mostly on the server side.
https://www.liquidweb.com/kb/apache-error-premature-end-of-script-headers/
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Arantor

Premature end of script headers usually means the PHP process crashed, and that's nothing you can fix.

krystal

Quote from: Aleksi "Lex" Kilpinen on July 15, 2018, 03:43:44 AM
OK, mostly it is the "Premature end of script headers"

Firstly, I would go through all your file and folder permissions, and try to make sure they are not writable to the whole world - to see if that fixes it.

All the directories are 755
The files within them vary. Most are 644, but some are 666.
I don't know enough about permissions to tell if they are correct or not (example screenshot attached)

Quote from: Arantor on July 15, 2018, 05:10:41 AM
Premature end of script headers usually means the PHP process crashed, and that's nothing you can fix.

That seems to be the most likely conclusion. :(

GigaWatt

Quote from: krystal on July 15, 2018, 06:33:22 PM
All the directories are 755
The files within them vary. Most are 644, but some are 666.

Try changing those with 666 to 644, but make a note of the files that you're going to change (just in case ;)).

Directories should be 755, that's OK ;).

Also, check if there are any php files or directories with 777 permissions. Change the directories to 755 and the php files to 644.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

krystal

Quote from: GigaWatt on July 15, 2018, 08:20:57 PM
Quote from: krystal on July 15, 2018, 06:33:22 PM
All the directories are 755
The files within them vary. Most are 644, but some are 666.

Try changing those with 666 to 644, but make a note of the files that you're going to change (just in case ;)).

Directories should be 755, that's OK ;).

Also, check if there are any php files or directories with 777 permissions. Change the directories to 755 and the php files to 644.

Thanks for the suggestion!
I've done this and given it a test.
Still getting random errors every so often - not sure if they are less frequent now or if that is just wishful thinking. ;)

GigaWatt

I clicked around the site on topics, boards, main menu items... didn't get one error.

They are either less frequent or maybe it depends on server load ???.... who knows.

Could you ask your host to switch you to another physical server (not the one you're on currently)?
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

krystal

Quote from: GigaWatt on July 16, 2018, 09:58:45 PM
Could you ask your host to switch you to another physical server (not the one you're on currently)?

I have just sent them a message asking if this would be possible.  :)

krystal

Got a reply

QuoteThanks for contacting tech support and I'm sorry to hear about the issue.
I recommend to change PHP version to 7.0 and copy the phprc settings
over to it from PHP 5.6 to see if that will help.

Does this sound like a possible solution?
They've sent me instructions on how to do it.

GigaWatt

Hmmm... with the randomness of the error, I'm not surprised if it worked :P.

Give it a go, it can't hurt to try ;). SMF 2.0.15 is compatible with 7.0, but not all mods. Check the admin error log to see if some errors keep frequently repeating themselves. If this is the case, it's possible some mod is not up to date.

But, if the suggested solution does work and you stop getting the 500 error... hey, at least a bigger problem is solved :).

Let's just see how everything goes and worry about minor problems later ;).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Aleksi "Lex" Kilpinen

Well, if you are currently on 5.6, I would say that is not the issue.
It is probably the most compatible version with most SMF mods currently.

But, that being said if your host suggests it, you can always try - just make sure you have a way to switch back too if that breaks something more.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

krystal

So, a bit of an update...

Changing the PHP version didn't help, not surprisingly. :( The errors continue the same as before.

I will be going back to the previous PHP version since my Coppermine Photo Album does not appear to be compatible with 7.0 and I don't have time to try and fix that.

The most recent response from the host's support:

QuoteOk I was able to replicate the error on my end as well. The thing is the
site errored out right away which is usually an indication of a software
issue. I checked over the server logs in regard to running out of memory
and all those looked good. Here is the full error I was able to
replicate:

[Thu Aug 23 12:40:21 2018] [error] [client 189.124.234.160] Premature end
of script headers: php70.cgi, referer:
http://www.playmofriends.com/forum/index.php?topic=15953.0
[Thu Aug 23 12:40:21 2018] [error] [client 189.124.234.160] File does not
exist: /home/playmo/playmofriends.com/internal_error.html, referer:
http://www.playmofriends.com/forum/index.php?topic=15953.0

It seems as if there is something going on with your forum that caused
the error. Do you think you can reach out to there support to see if
there are any debug logs that would show what might be wrong. Or maybe
even updating or replacing the software?

I have to say there's not a lot of continuity in the service from them with regard to this problem. It's very rarely the same person replying and I don't think they go back and read all the previous messages that have been exchanged. I already explained to a previous agent that I had looked for solutions on this forum.

Feeling pretty hopeless about it all. I did ask again about the possibility of moving the site to a different server rig but they ignored the suggestion, probably because it creates more work for them.  ::)

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

krystal

That links to the Coppermine Album.
It was working fine before recently changing the PHP Version, so that must be the cause.

Sir Osis of Liver

#44
I would drop back to php 5.6 until you get this resolved.  500 errors seem to be random, that's usually a server problem.  Anything in forum error log?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

drewactual

Drop a phpinfo link for us to see the configuration?

Go to your cpanel and turn off any pho handlers... And if SuPHP is running, turn it off as well.  If you're running any acceleration such as OPCache or XCache, SuHosin will hose it down with a quickness :) and seriously destabilize php.  Also, look for mod_authorize and if its running, switch it off too..,.

Often mass hosts will turn everything on and leave it to user's to discover incompatibility,,, of you make a phpinfo() page and linkvot for us we may be able to spot the issue(s)..  Your issue has a signature of mods or settimgs butting heads.  The infinite way to configure php frustrates even those who actually know how it tics... 

edited to add:

the forum seems fine... the coppermine seems to cough the errors... i never saw a single error with the forum, but the coppermine errored no matter how it was approached.. a failure due to functions.inc line 181 and then the 500...

Sir Osis of Liver

There's phpinfo link in OP.  If you click around the forum, you'll get random 500 errors. Coppermine is broken because he's still in php 7.0.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

drewactual

Krystal, do you have cpanel access? 

can you get to software>phpmanager> and turn OFF CGI as a handler and turn ON FPM?

you're running CGI/FastCGI while FPM is present- leave the handler line blank in the php manager and FPM will carry the water... when you select FPM for the site you'll see a little block usually on the far right of the line called 'pools'.... double or triple each of those figures (5 to either 10 or 15, ect...)....

using CGI as the handler exhausts the available workers with a quickness, is not secure, and is generally slower than any other method.  Also, you're running OPCache, which is great- but.... while running CGI as a handler OPCache is literally useless and does absolutely nothing but consume resources (and workers).... but when you enable FPM (disabling CGI handler at same time) you'll notice your processor weight takes a a nose dive and there will be more available workers to process your scripts. 

also, it's been my experience for whatever value it holds that using output compression via SMF while using zlib is a bad plan... one or the other, with preference being on allowing SMF to manage the compression (selected in server settings area of admin section) and turning OFF zlib compression via htaccess or php/user.ini... I would suggest turning it off in user.ini in your forum directory, as the .user is a directory level only adjustment, and not an entire website or sub-directory cascade adjustment. 

krystal

Quote from: Sir Osis of Liver on August 23, 2018, 07:40:23 PM
Anything in forum error log?

Nope, nothing unusual. Only incorrect passwords.


Quote from: drewactual on August 24, 2018, 09:12:15 AM
Krystal, do you have cpanel access?

Sadly, no.  :(
I searched for info and found this answer:
DreamHost's panel was built in-house and is currently the only panel available.

Thanks for all the suggestions though!
Really appreciate you taking the time to look into this :)

Is there any other way I can change those settings like in phpMyadmin?
Or do I need to ask my host to change them for me?

drewactual


# Use PHP54CGI as default
   AddHandler fcgidbeta-script .php

i THINK you can do this in htaccess to solve the CGI as a handler issue, but FPM is deeper than that.... I think... see what this does while i seek information on using FPM after http.d loads...


edited to add:

phpMyAdmin is your database tool... you'll be needing to find whatever mechanism they have to manage php versions... so... yeah, you'll likely need your host for this one.  it can't be done after php has already initiated. 

krystal

Quote from: drewactual on August 24, 2018, 12:26:14 PM

# Use PHP54CGI as default
   AddHandler fcgidbeta-script .php

i THINK you can do this in htaccess to solve the CGI as a handler issue, but FPM is deeper than that.... I think... see what this does while i seek information on using FPM after http.d loads...

That caused a different problem  ;)
Whenever I click on a php link I get a pop up from Firefox asking me how it should open it


drewactual


krystal

Quote from: drewactual on August 24, 2018, 01:10:17 PM
DOH!!!!!

use:
AddHandler application/x-httpd-php56 .php


I was still getting those browser pop-ups whenever clicking on topic or board links, unfortunately :(

drewactual

ask your host how many workers are set on your account?  how is the pool configured?

Advertisement: