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

Mailing List Archive: ModPerl: ModPerl

BerkeleyDB error

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


Sudhakara.Peram at pfizer

Dec 28, 2010, 5:07 PM

Post #1 of 6 (532 views)
Permalink
BerkeleyDB error

Hi All



I am migrating Perl 5.005 to 5.12.2, Apache 1.3.9 to 1.3.42, mod_perl
1.21 to 1.31 and BerkeleyDB 3.x to 5.x



We are setting ENV variables through GUI and executing perl script in
background through GUI. In that perl script we are using same libraries
which we used in GUI scripts. I am able to execute that perl script
successfully few times (less than 5 times) after every restart of Apache
web server. After that I am getting following BerkeleyDB error message
in log file of that script (i.e., run_command).





Error Message:



Can't load
'~/lib/perl5/site_perl/5.12.2/sun4-solaris-64int/auto/BerkeleyDB/Berkele
yDB.so' for module BerkeleyDB: ld.so.1: perl: fatal: libgcc_s.so.1: open
failed: No such file or directory at ~/lib/perl5/5.12.2/XSLoader.pm line
70.

at xxx-lib.pl line 6

Compilation failed in require at xxx-lib.pl line 6.

BEGIN failed--compilation aborted at xxx-lib.pl line 6.

Compilation failed in require at yyy-lib.pl line 34.

Compilation failed in require at ~/bin/run_command line 101.





Line 6 of xxx-lib.pl is use BerkeleyDB;

Line 34 of yyy-lib.pl is require xxx-lib.pl;

Line 101 of run_command is eval { require yyy-lib.pl;};





Thanks in advance for your help!!







Regards

Sudhakar


perrin at elem

Jan 2, 2011, 4:07 PM

Post #2 of 6 (506 views)
Permalink
Re: BerkeleyDB error [In reply to]

Hi,

> I am able to execute that perl script
> successfully few times (less than 5 times) after every restart of Apache web
> server. After that I am getting following BerkeleyDB error message in log
> file of that script (i.e., run_command).

Are you using Apache::Registry for this?

It sounds as if your requests fail on the second attempt to run the
script in a process. If you start apache with the -X option, do they
fail on the second request?

- Perrin


jschueler at tqis

Jan 2, 2011, 4:35 PM

Post #3 of 6 (500 views)
Permalink
Re: BerkeleyDB error [In reply to]

I wrote the module Apache::ChildExit specifically to resolve the
incompatibility between BerkeleyDB and Apache::Registry

http://search.cpan.org/~tqisjim/ChildExit_0-1/

-Jim

> Subject: Re: BerkeleyDB error
> From: Perrin Harkins <perrin [at] elem>
> To: "Peram, Sudhakara" <Sudhakara.Peram [at] pfizer>
> Cc: modperl [at] perl
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi,
>
> > I am able to execute that perl script
> > successfully few times (less than 5 times) after every restart of Apache web
> > server. After that I am getting following BerkeleyDB error message in log
> > file of that script (i.e., run_command).
>
> Are you using Apache::Registry for this?
>
> It sounds as if your requests fail on the second attempt to run the
> script in a process. If you start apache with the -X option, do they
> fail on the second request?
>
> - Perrin
>


Sudhakara.Peram at pfizer

Jan 3, 2011, 1:44 PM

Post #4 of 6 (492 views)
Permalink
RE: BerkeleyDB error [In reply to]

Thanks Perrin.



I am using Apache::Registry in httpd.conf file and I am running
run_command through system command.



Below is my httpd.conf for mod_perl:



<Location />

PerlFixupHandler Apache::Resource

</Location>



PerlModule Apache::Filter

# Actual mod_perl setting.

<Files *.pl>

Options ExecCGI

SetHandler perl-script

# PerlHandler Apache::PerlRun

PerlSetVar Filter On

PerlHandler Apache::RegistryFilter Apache::Compress

PerlSendHeader On

PerlInitHandler CDARSLog

</Files>



<Files *top.pl>

Options ExecCGI

SetHandler perl-script

PerlHandler Apache::PerlRun

PerlSendHeader On

PerlInitHandler CDARSLog

</Files>



# Actual mod_perl setting.

<Files *.mpl>

Options +ExecCGI

SetHandler perl-script

PerlHandler Apache::Registry

PerlSendHeader On

</Files>



<Files *.xpl>

Options +ExecCGI

SetHandler perl-script

PerlHandler Refresh

PerlSendHeader On

</Files>



# watch what mod_perl is doing...

<Location /perl-status>

SetHandler perl-script

PerlHandler Apache::Status

order deny,allow

deny from all

allow from all

</Location>



<Location /xxxx/gui/>

# This is the standard authentication stuff

AuthName "CDARS Authentication"

AuthType Basic



PerlAuthenHandler xxxx_Access



require valid-user

</Location>





Where xxxx is our application name.









--Sudhakar



-----Original Message-----
From: pharkins [at] gmail [mailto:pharkins [at] gmail] On Behalf Of Perrin
Harkins
Sent: Sunday, January 02, 2011 7:07 PM
To: Peram, Sudhakara
Cc: modperl [at] perl
Subject: Re: BerkeleyDB error



Hi,



> I am able to execute that perl script

> successfully few times (less than 5 times) after every restart of
Apache web

> server. After that I am getting following BerkeleyDB error message in
log

> file of that script (i.e., run_command).



Are you using Apache::Registry for this?



It sounds as if your requests fail on the second attempt to run the

script in a process. If you start apache with the -X option, do they

fail on the second request?



- Perrin


Sudhakara.Peram at pfizer

Jan 3, 2011, 1:47 PM

Post #5 of 6 (500 views)
Permalink
RE: BerkeleyDB error [In reply to]

Thanks Jim.



I am bit novice to mod_perl and apache, below is my httpd.conf
configuration. Can you please let me know how to use Apache::ChildExit
module if you have free time.





<Location />

PerlFixupHandler Apache::Resource

</Location>



PerlModule Apache::Filter

# Actual mod_perl setting.

<Files *.pl>

Options ExecCGI

SetHandler perl-script

# PerlHandler Apache::PerlRun

PerlSetVar Filter On

PerlHandler Apache::RegistryFilter Apache::Compress

PerlSendHeader On

PerlInitHandler CDARSLog

</Files>



<Files *top.pl>

Options ExecCGI

SetHandler perl-script

PerlHandler Apache::PerlRun

PerlSendHeader On

PerlInitHandler CDARSLog

</Files>



# Actual mod_perl setting.

<Files *.mpl>

Options +ExecCGI

SetHandler perl-script

PerlHandler Apache::Registry

PerlSendHeader On

</Files>



<Files *.xpl>

Options +ExecCGI

SetHandler perl-script

PerlHandler Refresh

PerlSendHeader On

</Files>



# watch what mod_perl is doing...

<Location /perl-status>

SetHandler perl-script

PerlHandler Apache::Status

order deny,allow

deny from all

allow from all

</Location>



<Location /xxxx/gui/>

# This is the standard authentication stuff

AuthName "CDARS Authentication"

AuthType Basic



PerlAuthenHandler xxxx_Access



require valid-user

</Location>





Where xxxx is our application name.



Thank you once again for your help!







--Sudhakar



-----Original Message-----
From: Jim Schueler [mailto:jschueler [at] tqis]
Sent: Sunday, January 02, 2011 7:35 PM
To: Peram, Sudhakara
Cc: modperl [at] perl; Perrin Harkins
Subject: Re: BerkeleyDB error



I wrote the module Apache::ChildExit specifically to resolve the

incompatibility between BerkeleyDB and Apache::Registry



http://search.cpan.org/~tqisjim/ChildExit_0-1/



-Jim



> Subject: Re: BerkeleyDB error

> From: Perrin Harkins <perrin [at] elem>

> To: "Peram, Sudhakara" <Sudhakara.Peram [at] pfizer>

> Cc: modperl [at] perl

> Content-Type: text/plain; charset=ISO-8859-1

>

> Hi,

>

> > I am able to execute that perl script

> > successfully few times (less than 5 times) after every restart of
Apache web

> > server. After that I am getting following BerkeleyDB error message
in log

> > file of that script (i.e., run_command).

>

> Are you using Apache::Registry for this?

>

> It sounds as if your requests fail on the second attempt to run the

> script in a process. If you start apache with the -X option, do they

> fail on the second request?

>

> - Perrin

>


Sudhakara.Peram at pfizer

Jan 5, 2011, 1:07 PM

Post #6 of 6 (492 views)
Permalink
RE: BerkeleyDB error [In reply to]

Thanks Jim!


--Sudhakar

-----Original Message-----
From: Jim Schueler [mailto:jschueler [at] eloquency]
Sent: Monday, January 03, 2011 10:47 PM
To: Peram, Sudhakara
Cc: modperl [at] perl
Subject: RE: BerkeleyDB error

The following line needs to be added to httpd.conf

PerlChildExitHandler Apache::ChildExit

The handler is called when a process is shut down, regardless of which
handlers were called during the process's lifetime. So this line should
not be inside a directive block.

The module documentation says that Apache::Registry evals the BEGIN {}
blocks only once and evals the END {} blocks every time the
Apache::Registry handler is called. I originally determined this by
observation- it may also be documented.

Apache::ChildExit::Postpone() moves the END {} blocks from an internal
perl stack to a vector private to Apache::ChildExit. The handler then
executes those blocks when the process is terminated. Thus, the
Postpone() method is specifically intended for Apache::Registry. If
other handlers do a better job alternating BEGIN {} blocks with END {}
blocks, those handlers should never encounter the Postpone() method. If
the
Postpone() method is used correctly this way, the Apache::ChildExit
handler should be compatible with all your other configured handlers.

BerkeleyDB handles are typically closed in an END {} tag. But in
Apache::Registry, these handles are still available to subsequent
handler calls. Because the BerkeleyDB close() command performs cache
flushing and similar housekeeping, subsequent operations on a db handle
don't flush correctly, which ultimately leads to file corruption.

Let me know-

Jim

> Thanks Jim.
>
> I am bit novice to mod_perl and apache, below is my httpd.conf
> configuration. Can you please let me know how to use Apache::ChildExit

> module if you have free time.
>
> Where xxxx is our application name.
>
> Thank you once again for your help!
>
> --Sudhakar

ModPerl modperl 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.