Premature end of script headers after post

Started by WillyP, May 24, 2012, 08:23:01 PM

Previous topic - Next topic

WillyP

Sometimes posting results in an internal server error, it seems to do this every time I or anyone else posts, for a while, then it stops for a while. Also does the same for a certain member when reporting a post. The post is made but the user is left on the error page.

QuoteInternal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


--------------------------------------------------------------------------------

Apache/2.2.9 Server at forum.cog-online.org Port 80

There are no errors in the forum log that could be related.

Server log:

Quote[Wed May 23 11:15:52 2012] [error] [client 207.241.237.220] File does not exist: /home/133072/domains/forum.cog-online.org/html/robots.txt

[Wed May 23 11:23:51 2012] [error] [client 204.195.175.205] Premature end of script headers: php-legacy, referer: http://forum.cog-online.org/index.php?action=post;topic=30089.30;last_msg=177801

[Wed May 23 11:25:48 2012] [error] [client 173.168.38.56] Premature end of script headers: php-legacy, referer: http://forum.cog-online.org/index.php?action=post;quote=182114;topic=34755.0;last_msg=182512

[Wed May 23 11:33:38 2012] [error] [client 167.83.101.24] Premature end of script headers: php-legacy, referer: http://forum.cog-online.org/index.php?action=post;quote=183838;topic=32181.0

[Wed May 23 11:34:16 2012] [error] [client 71.231.136.229] Premature end of script headers: php-legacy, referer: http://forum.cog-online.org/index.php?action=post;topic=27036.255;last_msg=183216

[Wed May 23 11:34:41 2012] [error] [client 157.55.16.219] File does not exist: /home/133072/domains/forum.cog-online.org/html/robots.txt

[Wed May 23 11:35:56 2012] [error] [client 68.61.178.70] Premature end of script headers: php-legacy, referer: http://forum.cog-online.org/index.php?action=post;board=21.0

[Wed May 23 11:37:51 2012] [error] [client 68.0.205.12] File does not exist: /home/133072/domains/forum.cog-online.org/html/Themes/likaWiki/css/webkit.css, referer: http://forum.cog-online.org/index.php/topic,32047.msg154464.html

[Wed May 23 11:38:56 2012] [error] [client 71.231.136.229] Premature end of script headers: php-legacy, referer: http://forum.cog-online.org/index.php?action=reporttm;topic=32855.24;msg=183923

Mods:
Quote1.    Aeva Media    1.4w
2.    First Post on every Page    1.4
3.    Fix Firefox 8.0 download problems    1.0.0
4.    SMF 2.0.2 Update    1.0
5.    Limit First Post on every Page to certain boards    1.4
6.    Post History    0.3a
7.    FantasticSmileys    1.0

9.    SMF 2.0.1 Update    1.0
10.    Memberize Integration    1.0.6

This error began while the forum was at 2.0.1. All mods except the upgrade to 2.0.1 and Memberize Integration where removed, no effect. Then the forum was upgraded to 2.0.2, through the package manage. The mods all installed successfully, the upgrade was successful except for subscriptions.php being missing, which was extracted from the 2.0.1 distro and uploaded. After that the upgrade went without a hitch.

The forum is at Concours Owners Group (COG) Forum - Index

Storman™

Well for starters your theme is built for RC3 and not 2.0.2.

Have you checked with the theme's author to see if there is a revised theme for 2.0.2. as they are not always compatible ?

WillyP

I am the author of the theme. Can you inform me of the differences, or point me to a reference?

MrPhil

Also give your site a /robots.txt file, even if it's empty, to stop that being logged as an error (cluttering up the log). If you're getting errors about /favicon.ico or missing error documents such as 500.shtml, add them (see my sig > FAQs > Missing Support Files). All these spurious errors clutter up the log and make it easy to overlook real errors.

colinp386

Quote from: MrPhil on May 25, 2012, 11:21:24 AM
Also give your site a /robots.txt file, even if it's empty, to stop that being logged as an error (cluttering up the log). If you're getting errors about /favicon.ico or missing error documents such as 500.shtml, add them (see my sig > FAQs > Missing Support Files). All these spurious errors clutter up the log and make it easy to overlook real errors.

FYI
I'm working with WillyP on this, issue that has us very stumped.
I have already added a favicon.ico and will add a robots.txt
I've had a pretty good look through the error log and don't see any other errors other than the premature end of script header.

This issue has become a real PITA for us  :(

Storman™

So forgetting about SMF for a minute, has anything changed in the way the site is hosted recently ?

Has your host updated anything with regard to your hosting package ?

colinp386

Yes and No.

PHP was recently upgraded to the latest version, but the issue was around before the upgrade.

The background is that we were hosting the forum on another hosting provider that was running out of steam.
So I moved the forum over to Media Temple, who provided a better/more powerful virtual hosting platform.
After the move, I upgraded I think from 2.0 to 2.1
This was almost 1 year ago.
It's hard for me to know if the issue was created by a faulty upgrade by me, or if there is something "weird" or incorrect with the Media Temple setup.
I does not appear to be load related, but I can't be sure on that either.
The db is now around 500Mb of which 250K is in the search table.

Storman™

Hmmm...    Media Temple, not exactly heard good things.

Also, it makes me wonder if something is incompatible with php's latest incarnation which is quite possible. Because it's the latest version does not necessarily mean it will work with certain scripts.

P.S.   On a side note, Apache 2.2.9 has heaps of vulnerabilities by the way, see here

MrPhil

What is "latest version"? PHP 5.3.x should be good, but some hosts are jumping the gun with PHP 5.4.x, which may not be very stable yet.

I did a quick google on PHP "premature end of script header". Among the causes:

  • Underpowered host killing the script after running out of resources (tends to be intermittent)
  • DNS not yet completely transferred over, leading to a conflict over DNS authority
  • Corrupted PHP files (extra blank lines added)
  • Apache and/or PHP needed to be restarted
  • Missing or incompatible library, such as GD (check your prerequisites)

Storman™

#9
Could also be caused by a configuration issue with suEXEC or mod_perl

I'd be inclined to pitch this past your host with a support ticket if only to check that everything is ok.

colinp386

All good tips.

We are running PHP-5.3.10 which is reported to be stable.
It was failing with the previous release of PHP so I don't think it's that.

I'll put in a support ticket to see if they have any suggestions and raise the awareness to them.
I also want to understand why the error log is not flushed as its a crazy size now.

My suspicion is
"Underpowered host killing the script after running out of resources (tends to be intermittent)"

as it is so random, and may well be related to load.

CP


Anguz

Hi Colin. I have a new SMF 2.0.2 forum on a MediaTemple server and it's giving me the same errors. Did you happen to find what the cause was? Thanks!
Cristián Lávaque http://cristianlavaque.com

colinp386

Hi Cristián;

It's a small world, I recognize you from the S2member forum.
You may recall me from UNIX Packages.

No I don't have a fix for this yet.
I have created a brand new forum on a new sub-domain but the same server, to see if I get the same issue with it.
Its just I have not gotten round to restoring the db yet to see if the problem is still there.

Perhaps we can work on this together  :P

Cheers

Colin

Anguz

Oh, right! Sorry I didn' recognize your username earlier, but I do remember you. Good to see you. :)

Yeah, we could work together on this. Let me know if you find the problem, I'll let you know if I do. Have you created a support ticket over at MT? I'm creating one now.

Cristián Lávaque http://cristianlavaque.com

colinp386

Yes i did open a ticket with MT

It is still open and its not helped much.
They advised (somewhat incorrectly) how to increase the logging for PHP to see if that gives more details.
However none are picked up at all which is most strange.


Anguz

So weird...

Do you think it may be timing out? It doesn't feel like it because the error happens almost immediately, and the post actually happens.
Cristián Lávaque http://cristianlavaque.com

The Craw

Quote from: Anguz on May 31, 2012, 04:47:36 PM
So weird...

Do you think it may be timing out? It doesn't feel like it because the error happens almost immediately, and the post actually happens.

AFAIK, the default PHP timeout is set to 30 seconds. If it's immediately redirecting you to the error, I think that's what it is. I'm not an expert though. :)

WillyP


The Craw

Quote from: WillyP on June 01, 2012, 08:16:45 AM
Any ideas how we can test for that?

You should be able to check the timeout settings with phpinfo();. Another thing worth checking might be exit_on_timeout, under Core. As I said before though, I doubt this is the problem, since it's redirecting so quickly. One of the server gurus would know better than me.


<?php
echo phpinfo();

Advertisement: