>Number: 594
>Category: general
>Synopsis: Occasionally a cgi-bin returns 'server failed'
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: apache (Apache HTTP Project)
>State: open
>Class: sw-bug
>Submitter-Id: apache
>Arrival-Date: Fri May 16 17:10:01 1997
>Originator: [EMAIL PROTECTED]
>Organization:
apache
>Release: 1.2b10
>Environment:
SunOS cheddar 5.5 Generic sun4m sparc SUNW,SPARCstation-10
With a Pc running the latest Netscape 4.0-pr4, but also with earlier versions.
>Description:
I have created a cgi-bin that calls the 'fping' program and produces a table
with hosts and their status: up or down.
The cgi output has a meta tag that causes a reload every 5 seconds.
After working for many hours, it will occasionally return a server error
and stop refreshing.
Using a packet sniffer left on overnight has revealed that the netscape
request is identical to all previous netscape requests, so the error must
in the web server.
The logs just report the fact that there was an internal server error:
...several hundred successes deleted...
209.17.133.42 - - [16/May/1997:16:38:35 -0700] "GET /cgi-bin/foo/whats-up-doc HT
TP/1.0" 200 6069
209.17.133.42 - - [16/May/1997:16:38:45 -0700] "GET /cgi-bin/foo/whats-up-doc HT
TP/1.0" 200 6069
209.17.133.42 - - [16/May/1997:16:38:53 -0700] "GET /cgi-bin/foo/whats-up-doc HT
TP/1.0" 200 6069
209.17.133.42 - - [16/May/1997:16:38:59 -0700] "GET /cgi-bin/foo/whats-up-doc HT
TP/1.0" 500 405
>How-To-Repeat:
http://cheddar.ics.bc.ca/cgi-bin/foo/whats-up-doc is really this cgi program:
#!/usr/local/bin/gawk -f
BEGIN {
print "Content-type: text/html"
print ""
print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">"
print "<HTML>"
print "<HEAD>"
cmd="/usr/5bin/date +'%Y-%m-%d %H:%M:%S'"
cmd | getline date
close(cmd)
print "<TITLE>Ping results "date"</TITLE>"
print "<META HTTP-EQUIV=\"refresh\" CONTENT=\"5\"> "
print "</HEAD>"
ping="/usr/local/bin/fping -a %s"
c=0
# Machines we care about
imp[c]=1;nm[c]="209.17.133.33";h[c++]="cheddar.ics.bc.ca"
imp[c]=1;nm[c]="209.17.133.249";h[c++]="swiss.ics.bc.ca"
imp[c]=1;nm[c]="209.17.136.1";h[c++]="cirrus.imag.net"
imp[c]=1;nm[c]="209.17.136.2";h[c++]="donkeykong.imag.net"
imp[c]=1;nm[c]="209.17.136.3";h[c++]="pacman.imag.net"
imp[c]=1;nm[c]="209.17.133.250";h[c++]="P50-1 router"
imp[c]=1;nm[c]="209.17.133.251";h[c++]="p50-2 router"
imp[c]=1;nm[c]="209.17.133.129";h[c++]="walker router"
imp[c]=1;nm[c]="209.17.133.65";h[c++]="redesign router"
imp[c]=1;nm[c]="207.107.214.254";h[c++]="router at starnet"
imp[c]=1;nm[c]="204.244.109.2";h[c++]="asterix.helix.net"
imp[c]=0;nm[c]="209.17.137.6";h[c++]="dees router here"
# imp[c]=0;nm[c]="209.17.137.7";h[c++]="dees router there"
imp[c]=0;nm[c]="206.186.255.149";h[c++]="router-bbb"
imp[c]=0;nm[c]="204.50.251.49";h[c++]="core-spc-van-1-fddi3/0.Sprint-Canada.Ne
t"
imp[c]=0;nm[c]="144.228.95.37";h[c++]="sl-sea-5-H11/0-T3.sprintlink.net"
imp[c]=0;nm[c]="144.228.90.2";h[c++]="sl-sea-2-F0/0.sprintlink.net"
imp[c]=0;nm[c]="144.228.10.62";h[c++]="sl-chi-15-H3/0-T3.sprintlink.net"
imp[c]=0;nm[c]="206.157.77.89";h[c++]="core4-hssi5-0.WillowSprings.mci.net"
imp[c]=0;nm[c]="204.70.2.147";h[c++]="border3-fddi-0.Seattle.mci.net"
# imp[c]=0;nm[c]="204.70.54.66";h[c++]="westel.Seattle.mci.net"
imp[c]=0;nm[c]="204.244.46.90";h[c++]="router1.helix.net"
# Traceroute to rs.internic.net
imp[c]=0;nm[c]="204.70.1.81";h[c++]="core2-hssi-2.KansasCity.mci.net"
imp[c]=0;nm[c]="204.70.197.51";h[c++]="border7-fddi-0.KansasCity.mci.net"
imp[c]=0;nm[c]="204.70.200.82";h[c++]="network-solutions-inc.KansasCity.mci.ne
t"
imp[c]=0;nm[c]="198.41.0.6";h[c++]="rs.internic.net"
# Traceroute to www.altavista.digital.com
imp[c]=0;nm[c]="144.228.90.1";h[c++]="sl-sea-1-F0/0.sprintlink.net"
imp[c]=0;nm[c]="144.228.10.57";h[c++]="sl-stk-1-H2/0-T3.sprintlink.net"
imp[c]=0;nm[c]="144.228.10.46";h[c++]="sl-mae-w-H1/0-T3.sprintlink.net"
imp[c]=0;nm[c]="198.32.136.19";h[c++]="sanjose1-br1.bbnplanet.net"
imp[c]=0;nm[c]="4.0.1.233";h[c++]="paloalto-br2.bbnplanet.net"
imp[c]=0;nm[c]="131.119.0.161";h[c++]="131.119.0.161"
imp[c]=0;nm[c]="4.0.1.58";h[c++]="decwrl.bbnplanet.net"
# nm[c]="198.32.176.241";h[c++]="digital-gw1.pa-x.dec.com"
imp[c]=0;nm[c]="204.123.2.66";h[c++]="altavista.digital.com"
# Dead
# nm[c]="144.228.10.62";h[c++]="sl-chi-15-H3/0-T3.sprintlink.net"
for (x=0;x<c;x++)
{
hosts=hosts " " nm[x]
value[nm[x]]=x
}
cmd=sprintf(ping,hosts)
while ((cmd | getline)>0)
{
up[$1]++
}
close(cmd)
for (x=0;x<c;x++)
if (!(nm[x] in up)) uc=uc+imp[x]
if (uc)
{
print "<BODY BGCOLOR=\"#ffff00\", TEXT=\"#000000\", LINK=\"#000000\","
print " VLINK=\"#ff00ff\", ALINK=\"#ffffff\">"
}
else
{
print "<BODY BGCOLOR=\"#ffffff\", TEXT=\"#000000\", LINK=\"#000000\","
print " VLINK=#ff00ff, ALINK=#00ffff>"
}
print "<DIV ALIGN=\"CENTER\">"
print "<FONT SIZE=+1>Ping results:</FONT><BR>"
print date"<br>"
print "<FONT SIZE=-2>"
print "<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>"
for (x=0;x<c;x++)
{
# If this host is important
if (imp[x])
print "<TR><TD BGCOLOR=\"#007fff\" ALIGN=CENTER><FONT COLOR=\"#FFFFFF\">"
else
print "<TR><TD ALIGN=\"CENTER\"><FONT>"
# The hostname
print "<A HREF=\"telnet://"nm[x]"\">"
print h[x]
print "</A>"
print "</FONT></TD>"
# If this host is up
if (nm[x] in up)
print "<TD ALIGN=CENTER><FONT COLOR=\"#000000\">UP</FONT></TD>"
else
print "<TD BGCOLOR=\"#ff0000\" ALIGN=CENTER><FONT COLOR=\"#FFFFFF\">DOWN</
FONT></TD>"
print "</TR>"
}
print "</TABLE>"
print "</FONT>"
print "</DIV>"
print "</BODY>"
print "</HTML>"
}
>Fix:
Set it up, start the auto-reload running, and keep a log of internal state
of the web server, in the path of execution. An expect script combined with
lynx will probably do a good job of informing you when the page has died
>Audit-Trail:
>Unformatted: