[ic] Premature end of script headers.

JOHN interchange-users@icdevgroup.org
Fri Apr 11 17:28:00 2003


> Sorry if this is rehashing a known issue, I didn't find it..
> 
> Working on an intranet site & clients are receiving:
> "The server encountered an internal error and was unable to
complete your 
> request. Error message: Premature end of script headers"
> 
> The Error log looks like:
> IP Address - [11/April/2003:13:41:49 -0500] db 
> /cgi-bin/db/scan/st=db/co=yes/sf=category/se=Informal 
> Seating/sf=prod_group/se=Reception Area.html 
> Runtime error: Could not lock file: Interrupted system call
> 
> The error happens when people are adding items from the
results.html 
> results_buylist component. 
> 
> Interchange version 4.9.6  (was also happening under 4.9.5,
> Thought it might be the part of the broken locks issue so I
tried
> Variable MV_BAD_LOCK 1 in interchange.cfg with no noticable
difference.)
> 
> I could possibly go to 4.8 stable, but would rather not if it
is avoidable..
> 
> Server mode       UNIX   
> 
> Perl Version        Perl 5.8.0 (built from source not
threaded)
> Archive::Tar found (v0.23). 
> SQL::Statement found (v0.1021).
> Archive::Zip found (v1.05). 
> Safe::Hole found (v0.08).
> Bundle::LWP found (v1.09). 
> Spreadsheet::ParseExcel found (v0.2602).
> Business::UPS found (v1.13). 
> Spreadsheet::WriteExcel found (v0.40).
> Compress::Zlib found (v1.20). 
> Storable found (v2.06).
> Crypt::SSLeay found (v0.49). 
> Term::ReadKey found (v2.21).
> DBI found (v1.35). 
> Term::ReadLine::Perl not found. 
> Digest::MD5 found (v2.24). 
> Tie::ShadowHash found (v0.07).
> Image::Size found (v2.991). 
> Tie::Watch found (v1.0).
> LWP::Simple found (v1.36). 
> URI::URL found (v5.03).
> MIME::Base64 found (v2.18).  
> Safe operations untrapped     ftfile sort rand
> 
> GDBM available (v1.06)
> No Berkeley DB_File.
> DBI enabled (v1.35)
> Working with MySQL 3.23.54 located on the same box.
> 
> Linux version 2.4.18-27.8.0
(bhcompile@sylvester.devel.redhat.com) 
> (gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7))
> Apache/2.0.40 (Red Hat Linux)
> 
> Any info would be greatly appreciated..

This might help.. try it.

"it is a general incompatibility between perl 5.8.0 and
interchange."
Here is a variation on Frederic's patch that I made based on
some comments 
about this problem in the interchange-core list.  It puts a
limit on the 
number of flock attempts to prevent an infinite loop.

--- Util.orig.pm        2003-03-17 16:23:06.000000000 -0500
+++ Util.pm     2003-03-17 16:33:33.000000000 -0500
@@ -1413,7 +1413,12 @@
      my $flag = $excl ? $flock_LOCK_EX : $flock_LOCK_SH;

      if ($wait) {
-        flock($fh, $flag) or die "Could not lock file: $!\n";
+       my $failedcount = 0;
+       while(!flock($fh, $flag) && $failedcount < 30) {
+               $failedcount++;
+               sleep 1;
+       }
+       die "Could not lock file after 30 tries: $!\n" if
($failedcount == 30);
          return 1;
      }
      else {

I've been using this version for a couple of weeks on our
development 
server and have yet to see it actually hit 30 failures.

Thanks much to Frederic for his investigate and initial patch.


Randy Moore
Axion Information Technologies, Inc.

email     ramoore@axion-it.net
phone   301-408-1200
fax        301-445-3947




________________________________________________
Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag