From dumoulin at e-summum.com Wed Feb 10 18:51:13 2010 From: dumoulin at e-summum.com (Richard Dumoulin) Date: Wed, 10 Feb 2010 18:51:13 -0500 Subject: [FASTCGI] Fastcgi and perl : How to recover from an error? Message-ID: <009701caaaab$ee6b2810$cb417830$@com> Hi! This morning one of my fastcgi / perl script running on Linux / Apache2 ran into an error : [Wed Feb 10 08:43:50 2010] [error] [client X.Y.Z.194] FastCGI: server "xxxxxxxx/index.fcgi" stderr: Can't use an undefined value as a HASH reference at xxxxxxxx/index.fcgi line 153., referer: http://xxxxxxxx/index.fcgi?demande=rech&str=rivi%E8re [Wed Feb 10 08:43:56 2010] [error] [client X.Y.Z.194] FastCGI: server "xxxxxxxx/index.fcgi" stderr: Can't use an undefined value as a HASH reference at xxxxxxxx/index.fcgi line 153., referer: http://xxxxxxxx/index.fcgi?demande=rech&str=riviere [Wed Feb 10 08:44:21 2010] [error] [client X.Y.Z.194] FastCGI: server "xxxxxxxx/index.fcgi" stderr: Can't use an undefined value as a HASH reference at xxxxxxxx/index.fcgi line 153., referer: http://xxxxxxxx/index.fcgi?demande=rech&str=rivi%E8re I found the problem (type cast from a session variable and the variable was undefined because of an error in the session state). That's ok and fixed. What bothers me is that the visitors did try several queries that all ended in error. The fastcgi process went in a strange error state and it was no longer responding to normal queries from different users. After the initial errors, I got these errors (lots of them): . [Wed Feb 10 08:45:02 2010] [error] [client X.Y.Z.194] FastCGI: incomplete headers (0 bytes) received from server "xxxxxxxx/index.fcgi", referer: http://www.xxxxxxxx/index.fcgi?demande=rech&page=2 [Wed Feb 10 08:45:04 2010] [error] [client X.Y.Z.194] FastCGI: comm with (dynamic) server "xxxxxxxx/index.fcgi" aborted: (first read) idle timeout (30 sec), referer: http://www.xxxxxxxx/?demande=rech&str=singe [Wed Feb 10 08:45:04 2010] [error] [client X.Y.Z.194] FastCGI: incomplete headers (0 bytes) received from server "xxxxxxxx/index.fcgi", referer: http://www.xxxxxxxx/?demande=rech&str=singe [Wed Feb 10 08:45:05 2010] [error] [client X.Y.Z.194] FastCGI: comm with (dynamic) server "xxxxxxxx/index.fcgi" aborted: (first read) idle timeout (30 sec), referer: http://www.xxxxxxxx/index.fcgi?demande=rech&str=rivi%E8re [Wed Feb 10 08:45:05 2010] [error] [client X.Y.Z.194] FastCGI: incomplete headers (0 bytes) received from server "xxxxxxxx/index.fcgi", referer: http://www.xxxxxxxx/index.fcgi?demande=rech&str=rivi%E8re [Wed Feb 10 08:45:05 2010] [error] [client X.Y.Z.194] FastCGI: comm with (dynamic) server "xxxxxxxx/index.fcgi" aborted: (first read) idle timeout (30 sec), referer: http://xxxxxxxx/index.fcgi?demande=consulter&id=581 [Wed Feb 10 08:45:05 2010] [error] [client X.Y.Z.194] FastCGI: incomplete headers (0 bytes) received from server "xxxxxxxx/index.fcgi", referer: http://xxxxxxxxxx/index.fcgi?demande=consulter&id=581 [Wed Feb 10 08:45:08 2010] [error] [client X.Y.Z.194] FastCGI: comm with (dynamic) server "xxxxxxxx/index.fcgi" aborted: (first read) idle timeout (30 sec), referer: http://www.xxxxxxxx/?demande=rech&str=singe [Wed Feb 10 08:45:08 2010] [error] [client X.Y.Z.194] FastCGI: incomplete headers (0 bytes) received from server "xxxxxxxx/index.fcgi", referer: http://www.xxxxxxxx/?demande=rech&str=singe [Wed Feb 10 08:45:09 2010] [error] [client X.Y.Z.194] FastCGI: comm with (dynamic) server "xxxxxxxx/index.fcgi" aborted: (first read) idle timeout (30 sec), referer: http://www.xxxxxxxx/index.fcgi?demande=rech&str=rivi%E8re [Wed Feb 10 08:45:09 2010] [error] [client X.Y.Z.194] FastCGI: incomplete headers (0 bytes) received from server "xxxxxxxx/index.fcgi", referer: http://www.xxxxxxxx/index.fcgi?demande=rech&str=rivi%E8re [Wed Feb 10 08:45:09 2010] [error] [client X.Y.Z.194] FastCGI: comm with (dynamic) server "xxxxxxxx/index.fcgi" aborted: (first read) idle timeout (30 sec), referer: http://xxxxxxxx/index.fcgi?demande=consulter&id=581 [Wed Feb 10 08:45:09 2010] [error] [client X.Y.Z.194] FastCGI: incomplete headers (0 bytes) received from server "xxxxxxxx/index.fcgi", referer: http://xxxxxxxxxxxx/index.fcgi?demande=consulter&id=581 and it went like that for 30 minutes until Apache was restarted. Is there a config to add in Apache to fix this? I found the following in the doc : -restart (none) Causes the process manager to restart dynamic applications upon failure (similar to static applications). Is this the good way to solve this? Any help will be really appreciated! Thanks in advance! Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mst at shadowcat.co.uk Thu Feb 11 16:45:42 2010 From: mst at shadowcat.co.uk (Matt S Trout) Date: Thu, 11 Feb 2010 21:45:42 +0000 Subject: [FASTCGI] Fastcgi and perl : How to recover from an error? In-Reply-To: <009701caaaab$ee6b2810$cb417830$@com> References: <009701caaaab$ee6b2810$cb417830$@com> Message-ID: <20100211214542.GA15270@agaton.scsys.co.uk> On Wed, Feb 10, 2010 at 06:51:13PM -0500, Richard Dumoulin wrote: > [Wed Feb 10 08:43:50 2010] [error] [client X.Y.Z.194] FastCGI: server > "xxxxxxxx/index.fcgi" stderr: Can't use an undefined value as a HASH > reference at xxxxxxxx/index.fcgi line 153., referer: > http://xxxxxxxx/index.fcgi?demande=rech&str=rivi%E8re > > and it went like that for 30 minutes until Apache was restarted. > > Is there a config to add in Apache to fix this? I found the following in > the doc : > > -restart (none) > > Causes the process manager to restart dynamic applications upon failure > (similar to static applications). Right, so what happened is your app (on the other end of the socket) die()ed at which point there was nothing for apache to talk to down the socket - and since you didn't configure it to restart it that just threw errors. I think you probably want to (a) turn that config option on (b) stick a big eval {} around your top level run loop so an exception generated by the request handling code in your app doesn't take out the FastCGI handler. -- Matt S Trout Catalyst and DBIx::Class consultancy with a clue Technical Director and a commit bit: http://shadowcat.co.uk/catalyst/ Shadowcat Systems Limited mst (@) shadowcat.co.uk http://shadowcat.co.uk/blog/matt-s-trout/ From vdb at mail.ru Fri Feb 19 12:56:12 2010 From: vdb at mail.ru (Dmitry) Date: Fri, 19 Feb 2010 20:56:12 +0300 Subject: [FASTCGI] cgi-fcgi stuck at 100% CPU in __kernel_vsyscall () Message-ID: <4B7ED0BC.6070304@mail.ru> Hello, I am using simple webserver together with php_5_3_fpm (from SVN) and cgi-fcgi from fcgi-2.4.1-SNAP-0910052249. cgi-fcgi is patched with the small patch: diff -uNrbB fcgi-2.4.1-SNAP-0910052249.org/cgi-fcgi/cgi-fcgi.c fcgi-2.4.1-SNAP-0910052249/cgi-fcgi/cgi-fcgi.c --- fcgi-2.4.1-SNAP-0910052249.org/cgi-fcgi/cgi-fcgi.c 2009-10-06 05:31:59.000000000 +0400 +++ fcgi-2.4.1-SNAP-0910052249/cgi-fcgi/cgi-fcgi.c 2009-12-13 14:46:28.000000000 +0300 @@ -703,9 +708,6 @@ fprintf(stderr, "Number of servers must be greater than 0\n"); err++; } - } else { - fprintf(stderr, "Unknown argument %s\n", argv[i]); - err++; } } if(*doStartPtr && *appPathPtr == 0) { @@ -748,6 +750,7 @@ FCGI_BeginRequestRecord beginRecord; int doBind, doStart, nServers; char appPath[MAXPATHLEN], bindPath[MAXPATHLEN]; + struct timeval fd_read_timeout = { 10,0 }; if(ParseArgs(argc, argv, &doBind, &doStart, (char *) &bindPath, (char *) &appPath, &nServers)) { @@ -856,7 +859,9 @@ * NULL = wait forever (or at least until there's something * to do. */ - OS_DoIo(NULL); + /* OS_DoIo(NULL); */ + + OS_DoIo(&fd_read_timeout); First chunk is needed in order to correctly process QUERY_STRING with uninitialized variables like /?xxx. cgi-fcgi exits with error if there is no '=' sign after the name of variable. /?xxx=yyy is fine. Second chunk is my attempt to solve the problem with endless loop and 100% CPU usage. But it doesn't help. Every day one or two cgi-fcgi processes stuck at 100% CPU for a long time. This is `ps auxwww` output: 1001 19832 98.8 0.0 1792 428 ? R 11:45 15:49 /usr/local/bin/cgi-fcgi -bind -connect /home/user/php-fpm.sock /var/vhosts/user/index.php Trying to debug: # gdb /usr/local/bin/cgi-fcgi 19832 GNU gdb Fedora (6.8-37.el5) Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu"... (no debugging symbols found) Attaching to program: /usr/local/bin/cgi-fcgi, process 19832 Reading symbols from /lib/libnsl.so.1...(no debugging symbols found)...done. Loaded symbols for /lib/libnsl.so.1 Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done. Loaded symbols for /lib/libc.so.6 Reading symbols from /lib/ld-linux.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/ld-linux.so.2 (no debugging symbols found) 0xffffe405 in __kernel_vsyscall () (gdb) bt #0 0xffffe405 in __kernel_vsyscall () #1 0x00cd488d in ___newselect_nocancel () from /lib/libc.so.6 #2 0x0804ed73 in OS_DoIo () #3 0x0804a588 in main () (gdb) n Single stepping until exit from function __kernel_vsyscall, which has no line number information. 0x00cd488d in ___newselect_nocancel () from /lib/libc.so.6 (gdb) n Single stepping until exit from function ___newselect_nocancel, which has no line number information. 0x0804ed73 in OS_DoIo () (gdb) s Single stepping until exit from function OS_DoIo, which has no line number information. 0x0804a588 in main () (gdb) s Single stepping until exit from function main, which has no line number information. Quit How can I solve this problem? -- Dmitry From silverburgh.meryl at gmail.com Sun Feb 21 11:28:48 2010 From: silverburgh.meryl at gmail.com (silverburgh) Date: Sun, 21 Feb 2010 08:28:48 -0800 Subject: [FASTCGI] How to configure fastcgi with lighttpd Message-ID: <701fce31002210828i222ffa07n99202cd4168ad057@mail.gmail.com> Hi, I am trying to configure FastCgi with ligttpd server. I was able to run vanilla lighttpd like this: ./lighttpd -f lighttpd.conf And then I compile/install the source of fastcgi, and I add the following in my lighttpd.conf: fastcgi.server = ( "/fastcgi_scripts/" => (( #"host" => "127.0.0.1", #"port" => 9091, "check-local" => "disable", "bin-path" => "/usr/local/bin/cgi-fcgi", "docroot" => "/" # remote server may use # it's own docroot )) ) But lighttpd won't start after I add the above. Can you please tell me how can I run fastcgi with lighttpd? I want to use a c program with fastcgi with lighttpd. Thank you. From gc at falconpl.org Sun Feb 21 18:37:07 2010 From: gc at falconpl.org (Giancarlo Niccolai) Date: Mon, 22 Feb 2010 00:37:07 +0100 Subject: [FASTCGI] FastCGI for the Falcon Programming Language Message-ID: <201002220037.07911.gc@falconpl.org> Hello, I'd like to notify to the kind developers and users of FastCGI that the Falcon Programming Language is currently implementing FastCGI as a part of the WOPI (Web Oriented Programming Interface) project. WOPI is a web-oriented common architecture that allows web-based script applications to run just the same under different web service providers. Currently we support: - Apache2 direct integration - Standard CGI - FastCGI Release is imminent; we're cross-building and refining docs (the ones you can find are based on the Apache2 module, whose interface for scripts has ben maintained mostly unhaletered in the WOPI project). If you may kindly cross-link us back, we'd be delighted: http://www.falconpl.org/index.ftd?page_id=prjs&prj_id=wopi&sid=main Best regards, Giancarlo Niccolai The Falcon Programming Language. From unique at idempot.net Sun Feb 21 23:40:38 2010 From: unique at idempot.net (Matthew Weigel) Date: Sun, 21 Feb 2010 22:40:38 -0600 Subject: [FASTCGI] How to configure fastcgi with lighttpd In-Reply-To: <701fce31002210828i222ffa07n99202cd4168ad057@mail.gmail.com> References: <701fce31002210828i222ffa07n99202cd4168ad057@mail.gmail.com> Message-ID: <4B820AC6.6010703@idempot.net> On 2/21/2010 10:28 AM, silverburgh wrote: > Hi, > > I am trying to configure FastCgi with ligttpd server. > > I was able to run vanilla lighttpd like this: ./lighttpd -f lighttpd.conf > > And then I compile/install the source of fastcgi, and I add the > following in my lighttpd.conf: > > fastcgi.server = ( "/fastcgi_scripts/" => > (( #"host" => "127.0.0.1", > #"port" => 9091, > "check-local" => "disable", > "bin-path" => "/usr/local/bin/cgi-fcgi", > "docroot" => "/" # remote server may use > # it's own docroot > )) > ) > But lighttpd won't start after I add the above. Per http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModFastCGI, you need to specify host+port or socket; you don't specify either in this case, so lighttpd doesn't know what to do and exits instead. -- Matthew Weigel hacker unique & idempot . ent From silverburgh.meryl at gmail.com Mon Feb 22 12:52:45 2010 From: silverburgh.meryl at gmail.com (silverburgh) Date: Mon, 22 Feb 2010 09:52:45 -0800 Subject: [FASTCGI] How to configure fastcgi with lighttpd In-Reply-To: <4B820AC6.6010703@idempot.net> References: <701fce31002210828i222ffa07n99202cd4168ad057@mail.gmail.com> <4B820AC6.6010703@idempot.net> Message-ID: <701fce31002220952r3e61dbdey690df2217d19e246@mail.gmail.com> Thank you. I read that article, but do I need to start FastCGI on my local machine? I tried and I get missing application pathname: cgi-fcgi -start -connect :9095 Missing application pathname Usage: cgi-fcgi -f , or cgi-fcgi -connect [] , or cgi-fcgi -start -connect [] , or cgi-fcgi -bind -connect , where is either the pathname of a UNIX domain socket or (if -bind is given) a hostName:portNumber specification or (if -start is given) a :portNumber specification (uses local host). And I just want to setup the 'echo' example in FastCGI with lighttpd. Thank you. On Sun, Feb 21, 2010 at 8:40 PM, Matthew Weigel wrote: > On 2/21/2010 10:28 AM, silverburgh wrote: >> Hi, >> >> I am trying to configure FastCgi with ligttpd server. >> >> I was able to run vanilla lighttpd like this: ./lighttpd -f lighttpd.conf >> >> And then I compile/install the source of fastcgi, and I add the >> following in my lighttpd.conf: >> >> fastcgi.server = ( "/fastcgi_scripts/" => >>       (( #"host" => "127.0.0.1", >>          #"port" => 9091, >>          "check-local" => "disable", >>      "bin-path" => "/usr/local/bin/cgi-fcgi", >>          "docroot" => "/" # remote server may use >>                           # it's own docroot >>       )) >>     ) >> But lighttpd won't start after I add the above. > > Per http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModFastCGI, you > need to specify host+port or socket; you don't specify either in this case, so > lighttpd doesn't know what to do and exits instead. > -- >  Matthew Weigel >  hacker >  unique & idempot . ent > _______________________________________________ > FastCGI-developers mailing list > FastCGI-developers at mailman.fastcgi.com > http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers > From unique at idempot.net Mon Feb 22 13:40:54 2010 From: unique at idempot.net (Matthew Weigel) Date: Mon, 22 Feb 2010 18:40:54 +0000 Subject: [FASTCGI] How to configure fastcgi with lighttpd In-Reply-To: <701fce31002220952r3e61dbdey690df2217d19e246@mail.gmail.com> References: <701fce31002210828i222ffa07n99202cd4168ad057@mail.gmail.com> <4B820AC6.6010703@idempot.net> <701fce31002220952r3e61dbdey690df2217d19e246@mail.gmail.com> Message-ID: On Mon, 22 Feb 2010 09:52:45 -0800, silverburgh wrote: > Thank you. > > I read that article, but do I need to start FastCGI on my local > machine? I tried and I get missing application pathname: The FastCGI list isn't really the right place to get help with how to configure lighttpd's FastCGI module. That said, it does indeed look like you're not specifying a pathname as noted in the Lighttpd mod_fastcgi docs I linked to last time. Here's the line you seem to have missed: # "bin-path": path to the local FastCGI binary which should be started if no local FastCGI is running So either a) you specify bin-path, and lighttpd will start that application for you, or b) you start the FastCGI server outside of lighttpd and set it to listen on the port you have configured lighttpd to talk over. -- Matthew Weigel hacker unique & idempot . ent From jeremy.desmauts at inge-neo-soft.fr Tue Feb 23 12:01:45 2010 From: jeremy.desmauts at inge-neo-soft.fr (=?ISO-8859-1?Q?J=E9r=E9my_DESMAUTS?=) Date: Tue, 23 Feb 2010 18:01:45 +0100 Subject: [FASTCGI] KeepAlive Message-ID: Hello, I'm using mod_fastcgi 2.4.6. I wanted to activate KeepAlive but the flags FCGI_KEEP_CONN is never set. I looked the mod_fastcgi code and I noticed that parameter in function build_begin_request is always set to FALSE. Does it mean that Keepalive is not manage by FastCGI ? Thanks for your answer Jeremy -------------- next part -------------- An HTML attachment was scrubbed... URL: From konenkovs at gmail.com Sat Feb 27 01:57:37 2010 From: konenkovs at gmail.com (Konenkov Sergey) Date: Sat, 27 Feb 2010 09:57:37 +0300 Subject: [FASTCGI] mod_fastcgi and setenv Message-ID: <6fa1c8451002262257p1d3c8c9dw6c5f7425f842adbf@mail.gmail.com> Hi everybody! Is there any way to set initial variables defined with setenv? Like this? SetEnv PERL5LIB /home/username/perl/lib:/var/common-libs SetEnv MY_HOME /home/username/www/ ... FastCgiServer /home/konenkovs/www/htdocs/cgi/get_struct_svg.fcgi \ -initial-env PERL5LIB \ -initial-env MY_HOME Thanks :) -------------- next part -------------- An HTML attachment was scrubbed... URL: