Premature end of script headers: fcgid_env.sh

494 views
Skip to first unread message

Jarrod

unread,
Jul 14, 2015, 8:09:13 PM7/14/15
to th...@googlegroups.com
Hi there,

I've had Thruk 1.88 release 4 installed and working fine for some time, after checking it today for the first time in a couple of weeks I found that it would eventually load with an internal server error.

From /var/log/httpd/error_log:

[Wed Jul 15 09:55:39 2015] [warn] [client x.x.x.x] mod_fcgid: error reading data, FastCGI server closed connection, referer: http://hostname/thruk/
[Wed Jul 15 09:55:39 2015] [error] [client x.x.x.x] Premature end of script headers: fcgid_env.sh, referer: http://hostname/thruk/

/var/log/thruk/thruk.log on the other hand is completely empty for today, previous entries in it were just from service restarts. No /var/log/thruk/error.log file exists.

I have tried the steps under "Premature end of script headers: fcgid_env.sh" from here: http://www.thruk.org/documentation/faq.html

The apache error log / thruk logs don't help too much. I can confirm that SELinux is disabled.

[root@thruk1 ~]# getenforce
Disabled

I tried modifying /etc/httpd/conf.d/thruk.conf to specify a higher timeout under mod_fcgid which did not help but allowed the page/script to run longer before the internal server error occurred.

I have tried to restart the Thruk/HTTPD services, even the entire server but no change.

Sven Nierlein

unread,
Jul 15, 2015, 5:51:31 AM7/15/15
to th...@googlegroups.com
On 15/07/15 2:09, Jarrod wrote:
> From /var/log/httpd/error_log:
>
> [Wed Jul 15 09:55:39 2015] [warn] [client x.x.x.x] mod_fcgid: error reading data, FastCGI server closed connection, referer: http://hostname/thruk/
> [Wed Jul 15 09:55:39 2015] [error] [client x.x.x.x] Premature end of script headers: fcgid_env.sh, referer: http://hostname/thruk/

Without any more errors, this could be anything.

You could try to run the wrapper script manually by:
replace www-data with the actual webserver user which
is different on every system, ex. apache.

su - www-data -c "/usr/share/thruk/fcgid_env.sh"
STDIN is not a socket: specify a listen location at /usr/lib/thruk/perl5/Plack/Handler/FCGI.pm line 57.

You should either see the error above or the actual error.

Cheers,
Sven

Jarrod

unread,
Jul 15, 2015, 7:16:40 PM7/15/15
to th...@googlegroups.com
I had to change the apache user to use /bin/bash instead of /sbin/nologin, however I was able to run it as that user and receive the same message you posted.

[root@thruk1 html]# su - apache -c "/usr/share/thruk/fcgid_env.sh"
STDIN is not a socket: specify a listen location at /usr/lib64/thruk/perl5/Plack/Handler/FCGI.pm line 57.

What can I try next?

Jarrod

unread,
Jul 26, 2015, 10:00:14 PM7/26/15
to Thruk, jard...@gmail.com
It seems to be working fine now with no changes on my part.
Reply all
Reply to author
Forward
0 new messages