You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jean-Denis Girard <jd...@esoft.pf> on 2002/06/08 00:16:26 UTC

libapreq: could not create/open temp file

Hi,

Has anybody already seen this error ???

The problem happens on a web site which has been online for the last 2 
years without trouble.
We are using the proxied Apache_1.3.20 / mod_perl-1.24, behind a light 
front end Apache_1.3.20 / mod_ssl / mod_proxy_add_forward, on a Linux 
server.

Last week we upgraded most components of the system (kernel, 
libraries...) including Perl (5.6.0 to 5.6.1), then recompiled Apache, 
mod_ssl, mod_perl, libapreq-0.33, and rebooted (Apache, mod_ssl, 
mod_perl upgrade was planned for this month).

Everything worked flawlesly, the web site was still working, but after a 
few days, visitors started to complain  that uplaods didn't work. 
mod_perl dies with the message:
	[libapreq] could not create/open temp file
What is really funny, is that it works after rebooting the system, and 
the error shows up later.
I upgraded libapreq to 1.0, which didn't solve the problem. Next step 
will be to upgrade APache, mod_perl, etc. but I would like some help.

Thanks for any help.

Jean-Denis Girard

====================================================
Essential Software - Ingénierie Informatique
Solutions Linux & Open Source en Polynésie française
----------------------------------------------------
http://www.esoft.pf/
Tél: (689) 50 82 89
====================================================


Re: libapreq: could not create/open temp file

Posted by Joe Schaefer <jo...@sunstarsys.com>.
> Jean-Denis Girard wrote:
> > 
> > Everything worked flawlesly, the web site was still working, but after a 
> > few days, visitors started to complain  that uplaods didn't work. 
> > mod_perl dies with the message:
> >     [libapreq] could not create/open temp file
> > What is really funny, is that it works after rebooting the system, and 
> > the error shows up later.

Where are the temp files being created, on a RAM disk or something?
pre 1.0 apreq's had a bug that caused filehandles to leak (there's
a refcount problem in the IO parts of perl's ExtUtils/typemap), which
would eventually fill up /tmp (this is the default location of your 
spooled apreqXXXX files) until apache was restarted.


> > I upgraded libapreq to 1.0, which didn't solve the problem. Next step 
> > will be to upgrade APache, mod_perl, etc. but I would like some help.

In 1.0, we no longer use perl's ExtUtils/typemap for this, which should
take care of the aforementioned leak.  One other possible candidate is 
that your apache server is segfaulting after the file is received, which 
prevents apache from cleaning up the temp files.  If so, you should see
a bunch of apreqXXXX files filling up your spool directory.

-- 
Joe Schaefer
joe@sunstarsys.com


Re: libapreq: could not create/open temp file

Posted by Joe Schaefer <jo...@sunstarsys.com>.
> Jean-Denis Girard wrote:
> > 
> > Everything worked flawlesly, the web site was still working, but after a 
> > few days, visitors started to complain  that uplaods didn't work. 
> > mod_perl dies with the message:
> >     [libapreq] could not create/open temp file
> > What is really funny, is that it works after rebooting the system, and 
> > the error shows up later.

Where are the temp files being created, on a RAM disk or something?
pre 1.0 apreq's had a bug that caused filehandles to leak (there's
a refcount problem in the IO parts of perl's ExtUtils/typemap), which
would eventually fill up /tmp (this is the default location of your 
spooled apreqXXXX files) until apache was restarted.


> > I upgraded libapreq to 1.0, which didn't solve the problem. Next step 
> > will be to upgrade APache, mod_perl, etc. but I would like some help.

In 1.0, we no longer use perl's ExtUtils/typemap for this, which should
take care of the aforementioned leak.  One other possible candidate is 
that your apache server is segfaulting after the file is received, which 
prevents apache from cleaning up the temp files.  If so, you should see
a bunch of apreqXXXX files filling up your spool directory.

-- 
Joe Schaefer
joe@sunstarsys.com


Re: libapreq: could not create/open temp file

Posted by Ask Bjoern Hansen <as...@develooper.com>.
On Sat, 8 Jun 2002, Stas Bekman wrote:

> > Has anybody already seen this error ???
[...]
> >     [libapreq] could not create/open temp file

sounds like something is running out of filehandles; or a temp file
system of some kind running out of space.

Try applying the patch Stas sent and see what it changes to.
 
 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/         !try; do();


Re: libapreq: could not create/open temp file

Posted by Ask Bjoern Hansen <as...@develooper.com>.
On Sat, 8 Jun 2002, Stas Bekman wrote:

> > Has anybody already seen this error ???
[...]
> >     [libapreq] could not create/open temp file

sounds like something is running out of filehandles; or a temp file
system of some kind running out of space.

Try applying the patch Stas sent and see what it changes to.
 
 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/         !try; do();


Re: libapreq: could not create/open temp file

Posted by Stas Bekman <st...@stason.org>.
Jean-Denis Girard wrote:
> Hi,
> 
> Has anybody already seen this error ???
> 
> The problem happens on a web site which has been online for the last 2 
> years without trouble.
> We are using the proxied Apache_1.3.20 / mod_perl-1.24, behind a light 
> front end Apache_1.3.20 / mod_ssl / mod_proxy_add_forward, on a Linux 
> server.
> 
> Last week we upgraded most components of the system (kernel, 
> libraries...) including Perl (5.6.0 to 5.6.1), then recompiled Apache, 
> mod_ssl, mod_perl, libapreq-0.33, and rebooted (Apache, mod_ssl, 
> mod_perl upgrade was planned for this month).
> 
> Everything worked flawlesly, the web site was still working, but after a 
> few days, visitors started to complain  that uplaods didn't work. 
> mod_perl dies with the message:
>     [libapreq] could not create/open temp file
> What is really funny, is that it works after rebooting the system, and 
> the error shows up later.
> I upgraded libapreq to 1.0, which didn't solve the problem. Next step 
> will be to upgrade APache, mod_perl, etc. but I would like some help.

Let's try to change apreq to give the real system error message, that 
should help. Try the patch at the end. Also apreq has its own list, 
apreq-dev-subscribe@httpd.apache.org

Index: c/apache_request.c
===================================================================
RCS file: /home/cvs/httpd-apreq/c/apache_request.c,v
retrieving revision 1.20
diff -u -r1.20 apache_request.c
--- c/apache_request.c	18 Feb 2002 16:48:27 -0000	1.20
+++ c/apache_request.c	8 Jun 2002 04:41:08 -0000
@@ -359,7 +359,9 @@
      }

      if ( tries == 0  || (fp = ap_pfdopen(r->pool, fd, "w+" "b") ) == 
NULL ) {
- 
ap_log_rerror(REQ_ERROR, "[libapreq] could not create/open temp file");
+ 
ap_log_rerror(REQ_ERROR,
+                      "[libapreq] could not create/open temp file: %s",
+                      strerror(errno));
  	if ( fd >= 0 ) { remove(name); free(name); }
  	return NULL;
      }

Index: c/apache_request.h
===================================================================
RCS file: /home/cvs/httpd-apreq/c/apache_request.h,v
retrieving revision 1.8
diff -u -r1.8 apache_request.h
--- c/apache_request.h	26 Jun 2001 10:58:29 -0000	1.8
+++ c/apache_request.h	8 Jun 2002 04:41:08 -0000
@@ -9,6 +9,7 @@
  #include "http_main.h"
  #include "http_protocol.h"
  #include "util_script.h"
+#include <string.h>

  #ifdef  SFIO
  #include "sfio.h"

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: libapreq: could not create/open temp file

Posted by Stas Bekman <st...@stason.org>.
Jean-Denis Girard wrote:
> Hi,
> 
> Has anybody already seen this error ???
> 
> The problem happens on a web site which has been online for the last 2 
> years without trouble.
> We are using the proxied Apache_1.3.20 / mod_perl-1.24, behind a light 
> front end Apache_1.3.20 / mod_ssl / mod_proxy_add_forward, on a Linux 
> server.
> 
> Last week we upgraded most components of the system (kernel, 
> libraries...) including Perl (5.6.0 to 5.6.1), then recompiled Apache, 
> mod_ssl, mod_perl, libapreq-0.33, and rebooted (Apache, mod_ssl, 
> mod_perl upgrade was planned for this month).
> 
> Everything worked flawlesly, the web site was still working, but after a 
> few days, visitors started to complain  that uplaods didn't work. 
> mod_perl dies with the message:
>     [libapreq] could not create/open temp file
> What is really funny, is that it works after rebooting the system, and 
> the error shows up later.
> I upgraded libapreq to 1.0, which didn't solve the problem. Next step 
> will be to upgrade APache, mod_perl, etc. but I would like some help.

Let's try to change apreq to give the real system error message, that 
should help. Try the patch at the end. Also apreq has its own list, 
apreq-dev-subscribe@httpd.apache.org

Index: c/apache_request.c
===================================================================
RCS file: /home/cvs/httpd-apreq/c/apache_request.c,v
retrieving revision 1.20
diff -u -r1.20 apache_request.c
--- c/apache_request.c	18 Feb 2002 16:48:27 -0000	1.20
+++ c/apache_request.c	8 Jun 2002 04:41:08 -0000
@@ -359,7 +359,9 @@
      }

      if ( tries == 0  || (fp = ap_pfdopen(r->pool, fd, "w+" "b") ) == 
NULL ) {
- 
ap_log_rerror(REQ_ERROR, "[libapreq] could not create/open temp file");
+ 
ap_log_rerror(REQ_ERROR,
+                      "[libapreq] could not create/open temp file: %s",
+                      strerror(errno));
  	if ( fd >= 0 ) { remove(name); free(name); }
  	return NULL;
      }

Index: c/apache_request.h
===================================================================
RCS file: /home/cvs/httpd-apreq/c/apache_request.h,v
retrieving revision 1.8
diff -u -r1.8 apache_request.h
--- c/apache_request.h	26 Jun 2001 10:58:29 -0000	1.8
+++ c/apache_request.h	8 Jun 2002 04:41:08 -0000
@@ -9,6 +9,7 @@
  #include "http_main.h"
  #include "http_protocol.h"
  #include "util_script.h"
+#include <string.h>

  #ifdef  SFIO
  #include "sfio.h"

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com