You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brian Kodl <bk...@yahoo.com> on 2009/11/12 15:50:50 UTC

pipe has been ended. : mod_fcgid: get overlap result error

Hello,
 
Please help, what am I doing wrong? I can't get the example to work from http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html
 
Thanks! 
Brian 
 
Error.log contains: 
[Wed Nov 11 15:57:27 2009] [warn] [client 192.168.21.21] (OS 109)The pipe has been ended. : mod_fcgid: get overlap result error 
[Wed Nov 11 15:57:27 2009] [error] [client 192.168.21.21] Premature end of script headers: foo.pl 
 
foo.pl is from: http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html 
 
Software versions: 
  1. mod_fcgid-2.3.4-win32-x86.zip 
  2. apache_2.2.14-win32-x86-openssl-0.9.8k.msi 
  3. Windows Server 2003 R2 
 
Httpd.conf entries: 
LoadModule fcgid_module modules/mod_fcgid.so 
Alias /fcgi-bin/ "C:/Apache/fcgi-bin/" 
<IfModule fcgid_module> 
  FcgidConnectTimeout 20 
  FcgidIOTimeout 48 
</IfModule> 
# Directives from http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html 
<Directory "C:/Apache/fcgi-bin"> 
  SetHandler fcgid-script 
  Options +ExecCGI 
  # Customize the next two directives for your requirements. 
  Order allow,deny 
  Allow from all
</Directory>



      

Re: pipe has been ended. : mod_fcgid: get overlap result error

Posted by Jeff Trawick <tr...@gmail.com>.
On Fri, Nov 13, 2009 at 3:15 PM, William A. Rowe Jr.
<wr...@rowe-clan.net> wrote:
> Jeff Trawick wrote:
>>
>> Users occasionally run scripts that spew noise to stderr that may not
>> require logging except when debugging.  Perhaps a more general
>> FcgidChildStderr directive could enable both the legacy Win32
>> processing or other solutions.
>
> I'd rather 1. set the expectation that stderr channel exists (even if it's
> /dev/null'ed - oops - I mean \Device\NUL'ed ;-) as the defacto standard,
> just as on unix and 2. focus on how to tune the log level, following the
> pattern of mod_cgi[d] and adjusting those again, accordingly.
>
> Remember that stderr is rewired through the Fcgid processing phase.  We are
> only talking here about stderr-at-startup.

oh yeah; got it

Re: pipe has been ended. : mod_fcgid: get overlap result error

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
Jeff Trawick wrote:
> 
> Users occasionally run scripts that spew noise to stderr that may not
> require logging except when debugging.  Perhaps a more general
> FcgidChildStderr directive could enable both the legacy Win32
> processing or other solutions.

I'd rather 1. set the expectation that stderr channel exists (even if it's
/dev/null'ed - oops - I mean \Device\NUL'ed ;-) as the defacto standard,
just as on unix and 2. focus on how to tune the log level, following the
pattern of mod_cgi[d] and adjusting those again, accordingly.

Remember that stderr is rewired through the Fcgid processing phase.  We are
only talking here about stderr-at-startup.



Re: pipe has been ended. : mod_fcgid: get overlap result error

Posted by Jeff Trawick <tr...@gmail.com>.
On Fri, Nov 13, 2009 at 2:06 PM, William A. Rowe Jr.
<wr...@rowe-clan.net> wrote:
> Jeff Trawick wrote:
>> On Thu, Nov 12, 2009 at 5:32 PM, Brian Kodl <bkodl@yahoo.com
>> <ma...@yahoo.com>> wrote:
>>
>>     Ps - Is there a debug or trace httpd.conf directive to get more
>>     information?
>>
>>
>> I see the same error on Vista.  Initially it was because the FCGI CPAN
>> module wasn't installed; after installing that with ActiveState's ppm
>> utility it still fails, with the same "overlap" message.  Increasing
>> Apache's LogLevel to debug doesn't help.  Running foo.pl <http://foo.pl>
>> from the command-line works fine.
>>
>> Regardless of the cause of this issue, mod_fcgid needs to capture stderr
>> from the process for logging.
>>
>> Windows anyone?  I'd love to get a build environment set up and start
>> playing but I'm out of time on this one.
>
> Yes this is a serious problem.  We need to *open* stderr on the windows side
> in addition to the communications pipe on FD0, but right now, PHP and others
> rely on both FD1&2 to be NULL.
>
> Fixing this will necessarily break PHP, and users expectations of how the
> FastCGI works on Win32, but it was broken by design.
>
> What about a setting that defaults to 'use a sensible FCGID tunnel' which
> can be configured to 'Go forth blindly per older FCGI Win32 mechanics'?
>
> Something like "FcgidWin32LegacyConnect on"?

Users occasionally run scripts that spew noise to stderr that may not
require logging except when debugging.  Perhaps a more general
FcgidChildStderr directive could enable both the legacy Win32
processing or other solutions.

Re: pipe has been ended. : mod_fcgid: get overlap result error

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
Jeff Trawick wrote:
> On Thu, Nov 12, 2009 at 5:32 PM, Brian Kodl <bkodl@yahoo.com
> <ma...@yahoo.com>> wrote:
> 
>     Ps - Is there a debug or trace httpd.conf directive to get more
>     information?
> 
> 
> I see the same error on Vista.  Initially it was because the FCGI CPAN
> module wasn't installed; after installing that with ActiveState's ppm
> utility it still fails, with the same "overlap" message.  Increasing
> Apache's LogLevel to debug doesn't help.  Running foo.pl <http://foo.pl>
> from the command-line works fine.
> 
> Regardless of the cause of this issue, mod_fcgid needs to capture stderr
> from the process for logging.
> 
> Windows anyone?  I'd love to get a build environment set up and start
> playing but I'm out of time on this one.

Yes this is a serious problem.  We need to *open* stderr on the windows side
in addition to the communications pipe on FD0, but right now, PHP and others
rely on both FD1&2 to be NULL.

Fixing this will necessarily break PHP, and users expectations of how the
FastCGI works on Win32, but it was broken by design.

What about a setting that defaults to 'use a sensible FCGID tunnel' which
can be configured to 'Go forth blindly per older FCGI Win32 mechanics'?

Something like "FcgidWin32LegacyConnect on"?

Re: pipe has been ended. : mod_fcgid: get overlap result error

Posted by Rainer Jung <ra...@kippdata.de>.
Hi Jeff,

On 13.11.2009 17:43, Jeff Trawick wrote:
> On Thu, Nov 12, 2009 at 5:32 PM, Brian Kodl <bkodl@yahoo.com
> <ma...@yahoo.com>> wrote:
> 
>     Ps - Is there a debug or trace httpd.conf directive to get more
>     information?
> 
> 
> I see the same error on Vista.  Initially it was because the FCGI CPAN
> module wasn't installed; after installing that with ActiveState's ppm
> utility it still fails, with the same "overlap" message.  Increasing
> Apache's LogLevel to debug doesn't help.  Running foo.pl <http://foo.pl>
> from the command-line works fine.
> 
> Regardless of the cause of this issue, mod_fcgid needs to capture stderr
> from the process for logging.
> 
> Windows anyone?  I'd love to get a build environment set up and start
> playing but I'm out of time on this one.
> 
> Any suggestions for a syscall tracer to capture the interaction with the
> child process?

The sysinternals tools are available without license cost and are of
very good quality. The company has been bought by Microsoft a couple of
years ago and the tools still get improved:

http://technet.microsoft.com/en-us/sysinternals/default.aspx

For your problem I guess, that "Process Monitor"
(http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx) is the
right solutions. A couple of more process oriented tools are listed on

http://technet.microsoft.com/en-us/sysinternals/bb795533.aspx

Most people use Process Explorer, but that one is only capable of a more
static view, e.g. showing open DLLs and Handle, Threads and their stack
etc. (kind of mixture between lsof, ps and pstack). Process Monitor is
also able to trace calls, more like a truss sort of thing.

The tools are usually pretty simple to install, mostly copying of the
binary files.

HTH!

Regards,

Rainer

Re: pipe has been ended. : mod_fcgid: get overlap result error

Posted by Jeff Trawick <tr...@gmail.com>.
On Thu, Nov 12, 2009 at 5:32 PM, Brian Kodl <bk...@yahoo.com> wrote:

> Ps - Is there a debug or trace httpd.conf directive to get more
> information?
>
>
I see the same error on Vista.  Initially it was because the FCGI CPAN
module wasn't installed; after installing that with ActiveState's ppm
utility it still fails, with the same "overlap" message.  Increasing
Apache's LogLevel to debug doesn't help.  Running foo.pl from the
command-line works fine.

Regardless of the cause of this issue, mod_fcgid needs to capture stderr
from the process for logging.

Windows anyone?  I'd love to get a build environment set up and start
playing but I'm out of time on this one.

Any suggestions for a syscall tracer to capture the interaction with the
child process?

Re: pipe has been ended. : mod_fcgid: get overlap result error

Posted by Brian Kodl <bk...@yahoo.com>.
Ps - Is there a debug or trace httpd.conf directive to get more information?

--- On Thu, 11/12/09, Brian Kodl <bk...@yahoo.com> wrote:


From: Brian Kodl <bk...@yahoo.com>
Subject: Re: pipe has been ended. : mod_fcgid: get overlap result error
To: dev@httpd.apache.org
Date: Thursday, November 12, 2009, 1:00 PM







Hi Jeff,
 
Thanks for your response!  Yes, the path to perl is correct.
 
If I change the path to a bad location, then the error.log has this different error:
[Thu Nov 12 12:55:48 2009] [error] (OS 3)The system cannot find the path specified.  : mod_fcgid: can't create process
[Thu Nov 12 12:55:48 2009] [warn] (OS 3)The system cannot find the path specified.  : mod_fcgid: spawn process c:/perl/bin2/perl.exe error

Here is foo.pl
 
#!c:/perl/bin/perl.exe
use CGI::Fast;
while (my $q = CGI::Fast->new) {
  print("Content-Type: text/plain\n\n");
  foreach $var (sort(keys(%ENV))) {
    $val = $ENV{$var};
    $val =~ s|\n|\\n|g;
    $val =~ s|"|\\"|g;
    print "${var}=\"${val}\"\n";
  }
}

Thanks!
Brian

--- On Thu, 11/12/09, Jeff Trawick <tr...@gmail.com> wrote:


From: Jeff Trawick <tr...@gmail.com>
Subject: Re: pipe has been ended. : mod_fcgid: get overlap result error
To: dev@httpd.apache.org
Date: Thursday, November 12, 2009, 12:34 PM



On Thu, Nov 12, 2009 at 9:50 AM, Brian Kodl <bk...@yahoo.com> wrote:






Hello,
 
Please help, what am I doing wrong? I can't get the example to work from http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html
 
Thanks! 
Brian 
 
Error.log contains: 
[Wed Nov 11 15:57:27 2009] [warn] [client 192.168.21.21] (OS 109)The pipe has been ended. : mod_fcgid: get overlap result error 
[Wed Nov 11 15:57:27 2009] [error] [client 192.168.21.21] Premature end of script headers: foo.pl 
 

I'd guess this is related to the shebang line processing, and that foo.pl isn't getting started.

Is the path to perl correct in foo.pl (maybe it should be "#!/perl/bin/perl")?  Do you need "ScriptInterpreterSource registry" to tie .pl files to the Perl interpreter, ignoring the shebang line?





      

Re: pipe has been ended. : mod_fcgid: get overlap result error

Posted by Brian Kodl <bk...@yahoo.com>.
Hi Jeff,
 
Thanks for your response!  Yes, the path to perl is correct.
 
If I change the path to a bad location, then the error.log has this different error:
[Thu Nov 12 12:55:48 2009] [error] (OS 3)The system cannot find the path specified.  : mod_fcgid: can't create process
[Thu Nov 12 12:55:48 2009] [warn] (OS 3)The system cannot find the path specified.  : mod_fcgid: spawn process c:/perl/bin2/perl.exe error

Here is foo.pl
 
#!c:/perl/bin/perl.exe
use CGI::Fast;
while (my $q = CGI::Fast->new) {
  print("Content-Type: text/plain\n\n");
  foreach $var (sort(keys(%ENV))) {
    $val = $ENV{$var};
    $val =~ s|\n|\\n|g;
    $val =~ s|"|\\"|g;
    print "${var}=\"${val}\"\n";
  }
}

Thanks!
Brian

--- On Thu, 11/12/09, Jeff Trawick <tr...@gmail.com> wrote:


From: Jeff Trawick <tr...@gmail.com>
Subject: Re: pipe has been ended. : mod_fcgid: get overlap result error
To: dev@httpd.apache.org
Date: Thursday, November 12, 2009, 12:34 PM



On Thu, Nov 12, 2009 at 9:50 AM, Brian Kodl <bk...@yahoo.com> wrote:






Hello,
 
Please help, what am I doing wrong? I can't get the example to work from http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html
 
Thanks! 
Brian 
 
Error.log contains: 
[Wed Nov 11 15:57:27 2009] [warn] [client 192.168.21.21] (OS 109)The pipe has been ended. : mod_fcgid: get overlap result error 
[Wed Nov 11 15:57:27 2009] [error] [client 192.168.21.21] Premature end of script headers: foo.pl 
 

I'd guess this is related to the shebang line processing, and that foo.pl isn't getting started.

Is the path to perl correct in foo.pl (maybe it should be "#!/perl/bin/perl")?  Do you need "ScriptInterpreterSource registry" to tie .pl files to the Perl interpreter, ignoring the shebang line?




      

Re: pipe has been ended. : mod_fcgid: get overlap result error

Posted by Jeff Trawick <tr...@gmail.com>.
On Thu, Nov 12, 2009 at 9:50 AM, Brian Kodl <bk...@yahoo.com> wrote:

> Hello,
>
> Please help, what am I doing wrong? I can't get the example to work from
> http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html
>
> Thanks!
> Brian
>
> Error.log contains:
> [Wed Nov 11 15:57:27 2009] [warn] [client 192.168.21.21] (OS 109)The pipe
> has been ended. : mod_fcgid: get overlap result error
> [Wed Nov 11 15:57:27 2009] [error] [client 192.168.21.21] Premature end of
> script headers: foo.pl
>
>

I'd guess this is related to the shebang line processing, and that
foo.plisn't getting started.

Is the path to perl correct in foo.pl (maybe it should be "#!/perl/bin/perl")?
Do you need "ScriptInterpreterSource registry" to tie .pl files to the Perl
interpreter, ignoring the shebang line?