Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Dev

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

 

 

Apache dev RSS feed   Index | Next | Previous | View Threaded


bkodl at yahoo

Nov 12, 2009, 6:50 AM

Post #1 of 10 (5691 views)
Permalink
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>


trawick at gmail

Nov 12, 2009, 10:34 AM

Post #2 of 10 (5619 views)
Permalink
Re: pipe has been ended. : mod_fcgid: get overlap result error [In reply to]

On Thu, Nov 12, 2009 at 9:50 AM, Brian Kodl <bkodl [at] yahoo> 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?


bkodl at yahoo

Nov 12, 2009, 11:00 AM

Post #3 of 10 (5694 views)
Permalink
Re: pipe has been ended. : mod_fcgid: get overlap result error [In reply to]

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 <trawick [at] gmail> wrote:


From: Jeff Trawick <trawick [at] gmail>
Subject: Re: pipe has been ended. : mod_fcgid: get overlap result error
To: dev [at] httpd
Date: Thursday, November 12, 2009, 12:34 PM



On Thu, Nov 12, 2009 at 9:50 AM, Brian Kodl <bkodl [at] yahoo> 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?


bkodl at yahoo

Nov 12, 2009, 2:32 PM

Post #4 of 10 (5613 views)
Permalink
Re: pipe has been ended. : mod_fcgid: get overlap result error [In reply to]

Ps - Is there a debug or trace httpd.conf directive to get more information?

--- On Thu, 11/12/09, Brian Kodl <bkodl [at] yahoo> wrote:


From: Brian Kodl <bkodl [at] yahoo>
Subject: Re: pipe has been ended. : mod_fcgid: get overlap result error
To: dev [at] httpd
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 <trawick [at] gmail> wrote:


From: Jeff Trawick <trawick [at] gmail>
Subject: Re: pipe has been ended. : mod_fcgid: get overlap result error
To: dev [at] httpd
Date: Thursday, November 12, 2009, 12:34 PM



On Thu, Nov 12, 2009 at 9:50 AM, Brian Kodl <bkodl [at] yahoo> 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?


trawick at gmail

Nov 13, 2009, 8:43 AM

Post #5 of 10 (5602 views)
Permalink
Re: pipe has been ended. : mod_fcgid: get overlap result error [In reply to]

On Thu, Nov 12, 2009 at 5:32 PM, Brian Kodl <bkodl [at] yahoo> 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?


rainer.jung at kippdata

Nov 13, 2009, 10:08 AM

Post #6 of 10 (5593 views)
Permalink
Re: pipe has been ended. : mod_fcgid: get overlap result error [In reply to]

Hi Jeff,

On 13.11.2009 17:43, Jeff Trawick wrote:
> On Thu, Nov 12, 2009 at 5:32 PM, Brian Kodl <bkodl [at] yahoo
> <mailto:bkodl [at] yahoo>> 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


wrowe at rowe-clan

Nov 13, 2009, 11:06 AM

Post #7 of 10 (5591 views)
Permalink
Re: pipe has been ended. : mod_fcgid: get overlap result error [In reply to]

Jeff Trawick wrote:
> On Thu, Nov 12, 2009 at 5:32 PM, Brian Kodl <bkodl [at] yahoo
> <mailto:bkodl [at] yahoo>> 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"?


trawick at gmail

Nov 13, 2009, 11:52 AM

Post #8 of 10 (5589 views)
Permalink
Re: pipe has been ended. : mod_fcgid: get overlap result error [In reply to]

On Fri, Nov 13, 2009 at 2:06 PM, William A. Rowe Jr.
<wrowe [at] rowe-clan> wrote:
> Jeff Trawick wrote:
>> On Thu, Nov 12, 2009 at 5:32 PM, Brian Kodl <bkodl [at] yahoo
>> <mailto:bkodl [at] yahoo>> 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.


wrowe at rowe-clan

Nov 13, 2009, 12:15 PM

Post #9 of 10 (5586 views)
Permalink
Re: pipe has been ended. : mod_fcgid: get overlap result error [In reply to]

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.


trawick at gmail

Nov 13, 2009, 12:22 PM

Post #10 of 10 (5584 views)
Permalink
Re: pipe has been ended. : mod_fcgid: get overlap result error [In reply to]

On Fri, Nov 13, 2009 at 3:15 PM, William A. Rowe Jr.
<wrowe [at] rowe-clan> 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

Apache dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.