Discussion:
ModPerl and DBI problems
(too old to reply)
Randolf Richardson
2006-02-16 23:48:39 UTC
Permalink
I'm running NetWare 6.5 and Apache v2.0.55 with ModPerl. One of my
scripts use DBD::PgPP (the PostgreSQL Pure-Perl module) to connect to a
remote host running PostgreSQL v8.x.

Under ModPerl, I get the following error in my error logs when the script
attempts to connect (the connection always fails, cached or not):

1: ModPerl::Registry: dbih_getcom given an undefined handle (perhaps
returned from a previous call which failed) at sys:perllib/DBI.pm line 601.

Running the same script on the same server from the System Console (PERL
v5.8.4 is installed on the system) works properly. All of my other
scripts (none of which are using DBI) are working correctly, thus ModPerl
seems to be fine.

Included below is the script I'm trying to get working under ModPerl (with
passwords changed so as not to reflect reality).

All suggestions are welcome. Thanks in advance.

----------------------

use DBI;

print "Content-type: text/htmlnn";

my $db = 'dbi:PgPP:dbname=template1;host=10.1.1.253';
print "<p>Connecting to $db...n";
my $dbh = DBI->connect_cached($db,'postgres','manager');

# -x- Under ModPerl this script fails before reaching this point.

print "<p>Preparing SQL statement...n";
my $sth = $dbh->prepare_cached('select * from pg_ts_cfg');

print "<p>Executing SQL statement...n";
$sth->execute;

print "<p>Fetching rows...n<p>";
while (my $row = $sth->fetchrow_hashref) {
print $row->{'ts_name'},"<BR>n";
}
Guenter Knauf, DevNet SysOp 32
2006-02-17 02:17:05 UTC
Permalink
Hi Randy,
I've a script which uses Socket.pm with same issue:
called as native cgi through perlcgi it doesnt work and claims not to find
its module NLM - from console it works as expected.
Currently I'm out of ideas - does your calling Apache instance run
protected, or in OS? mine is protected, and I thought that might be the
reason...

Guenter.
Post by Randolf Richardson
I'm running NetWare 6.5 and Apache v2.0.55 with ModPerl. One of my
scripts use DBD::PgPP (the PostgreSQL Pure-Perl module) to connect to a
remote host running PostgreSQL v8.x.
Under ModPerl, I get the following error in my error logs when the script
1: ModPerl::Registry: dbih_getcom given an undefined handle (perhaps
returned from a previous call which failed) at sys:perllib/DBI.pm line 601.
Running the same script on the same server from the System Console (PERL
v5.8.4 is installed on the system) works properly. All of my other
scripts (none of which are using DBI) are working correctly, thus ModPerl
seems to be fine.
Included below is the script I'm trying to get working under ModPerl (with
passwords changed so as not to reflect reality).
All suggestions are welcome. Thanks in advance.
----------------------
use DBI;
print "Content-type: text/htmlnn";
my $db = 'dbi:PgPP:dbname=template1;host=10.1.1.253';
print "<p>Connecting to $db...n";
my $dbh = DBI->connect_cached($db,'postgres','manager');
# -x- Under ModPerl this script fails before reaching this point.
print "<p>Preparing SQL statement...n";
my $sth = $dbh->prepare_cached('select * from pg_ts_cfg');
print "<p>Executing SQL statement...n";
$sth->execute;
print "<p>Fetching rows...n<p>";
while (my $row = $sth->fetchrow_hashref) {
print $row->{'ts_name'},"<BR>n";
}
Randolf Richardson
2006-02-18 00:05:58 UTC
Permalink
Guenter Knauf, DevNet SysOp 32 wrote:

[sNip]
Post by Guenter Knauf, DevNet SysOp 32
Hi Randy,
called as native cgi through perlcgi it doesnt work and claims not to find
its module NLM - from console it works as expected.
ModPerl's socket I/O must be broken. This needs to be fixed. Hopefully a
ModPerl for NetWare for Apache 2.2.x will be released soon that also
resolves this problem.

Anyone from Novell here who can look into this problem? If ModPerl can't
do socket I/O, then there's a lot of stuff that is broken.
Post by Guenter Knauf, DevNet SysOp 32
Currently I'm out of ideas - does your calling Apache instance run
protected, or in OS? mine is protected, and I thought that might be the
reason...
I'm running in the OS space.

I'm not a fan of running Apache in a protected address space because my
experience has been that it is sometimes less stable this way, and most
importantly it doesn't seem to perform as well (slightly slower response
to client requests, and higher CPU utilization).
--
Randolf Richardson - ***@8x.ca
Inter-Corporate Computer & Network Services, Inc.
Vancouver, British Columbia, Canada
http://www.8x.ca/

This message originated from within a secure, reliable,
high-performance network ... a Novell NetWare network.
Guenter Knauf, DevNet SysOp 32
2006-02-18 12:58:05 UTC
Permalink
Hi Randy,
the Novell developer replied already, and is looking into the issue which
is very strange. There's nothing broken with Sockets directly, but with the
autoloader function, and that only if called as CGI, and only with _some_
installations. Please tell us how you did installed the server:
was is from Overlay, or updated? what SP are you on?

Guenter.
Post by Randolf Richardson
[sNip]
Post by Guenter Knauf, DevNet SysOp 32
Hi Randy,
called as native cgi through perlcgi it doesnt work and claims not to
find its module NLM - from console it works as expected.
ModPerl's socket I/O must be broken. This needs to be fixed. Hopefully
a ModPerl for NetWare for Apache 2.2.x will be released soon that also
resolves this problem.
Anyone from Novell here who can look into this problem? If ModPerl
can't do socket I/O, then there's a lot of stuff that is broken.
Post by Guenter Knauf, DevNet SysOp 32
Currently I'm out of ideas - does your calling Apache instance run
protected, or in OS? mine is protected, and I thought that might be the
reason...
I'm running in the OS space.
I'm not a fan of running Apache in a protected address space because my
experience has been that it is sometimes less stable this way, and most
importantly it doesn't seem to perform as well (slightly slower response
to client requests, and higher CPU utilization).
Randolf Richardson
2006-02-19 06:19:36 UTC
Permalink
Guenter Knauf, DevNet SysOp 32 wrote:

[sNip]
Post by Guenter Knauf, DevNet SysOp 32
the Novell developer replied already, and is looking into the issue which
That's excellent! Thanks a lot for the update.
Post by Guenter Knauf, DevNet SysOp 32
is very strange. There's nothing broken with Sockets directly, but with the
autoloader function, and that only if called as CGI, and only with _some_
was is from Overlay, or updated? what SP are you on?
I'm using NetWare 6.5 with Support Pack 4 installed (100% NNS volumes),
plus two post-SP4 updates (n65nss4b.exe and tcp661e.exe). The server has
4 GBs of RAM, a 3 GHz Intel processor with HyperThreading enabled on an
Intel server motherboard with an on-board Intel GB NIC (plus other Intel
NICs), and mirrored 320 MB SCSI hard drives serviced by an add-in 320 MB
Adaptec SCSI controller.

I'm not using the Apache installation that came with NetWare at all (nor
have I changed it except for changing its load statements in AUTOEXEC.NCF
to comments in order to prevent it from loading), and I've manually
created a separate installation of Apache 2.0.55 on a separate volume
which is loaded in AUTOEXEC.NCF (the Support Pack updates create too many
problems for SYS:-based installations, thus it's totally
counter-productive to bother modifying the default one).

PERL (v5.8.4) was updated, I believe, by the Support Pack. The only
addition I made to it (aside from a few custom libraries that don't
interfere with any other libraries, and don't load automatically with
Apache's {or any other} startup) is to add PgPP.pm to the DBDs.

I'd really REALLY like to add a native PostgreSQL DBD instead so that I
can have BLOB support (PgPP, which performs very well under ModPerl,
doesn't support BLOB data), and also for better overall efficiency, but as
you know this requires a functioning version of LIBPQ.NLM (there's no need
for SSL support for me since my database resides in the private side of my
network).

I hope this provides you with enough information. Let me know if there
are some NLM versions you'd like me to let you know about.
--
Randolf Richardson - ***@inter-corporate.com
Inter-Corporate Computer & Network Services, Inc.
Vancouver, British Columbia, Canada
http://www.inter-corporate.com/

This message originated from within a secure, reliable,
high-performance network ... a Novell NetWare network.
Randolf Richardson
2006-02-26 09:06:30 UTC
Permalink
Post by Randolf Richardson
Post by Guenter Knauf, DevNet SysOp 32
the Novell developer replied already, and is looking into the issue which
That's excellent! Thanks a lot for the update.
[sNip]

Hi Guenter. I was just wondering if you've gotten any news from Novell on
this issue?
--
Randolf Richardson - ***@inter-corporate.com
Inter-Corporate Computer & Network Services, Inc.
Vancouver, British Columbia, Canada
http://www.inter-corporate.com/

This message originated from within a secure, reliable,
high-performance network ... a Novell NetWare network.
Guenter
2006-02-26 19:13:55 UTC
Permalink
Hi Randy,
Post by Randolf Richardson
Post by Randolf Richardson
Post by Guenter Knauf, DevNet SysOp 32
the Novell developer replied already, and is looking into the issue which
That's excellent! Thanks a lot for the update.
[sNip]
Hi Guenter. I was just wondering if you've gotten any news from Novell
on this issue?
no, nothing yet.....

Guen.
Randolf Richardson
2006-02-28 03:22:05 UTC
Permalink
Post by Guenter
Post by Randolf Richardson
Post by Randolf Richardson
Post by Guenter Knauf, DevNet SysOp 32
the Novell developer replied already, and is looking into the issue which
That's excellent! Thanks a lot for the update.
Hi Guenter. I was just wondering if you've gotten any news from Novell
on this issue?
no, nothing yet.....
This particular issue is a very frustrating one because sockets in PERL
have been an issue many times before, and as I recall they always took so
long to resolve that I was forced to give up and use some other platform.
I would really like to use NetWare, but I need to have certain basic
things, like sockets, working properly.

I know you're just as stuck with this issue as I am. I really hope Novell
gets this problem solved very soon because my project is almost ready to
be promoted to a production environment, and it works just fine with
Apache2/ModPERL on Unix and Win32 where the sockets make it possible to
use DBD::PgPP (or just DBD::Pg).
--
Randolf Richardson - ***@inter-corporate.com
Inter-Corporate Computer & Network Services, Inc.
Vancouver, British Columbia, Canada
http://www.inter-corporate.com/

This message originated from within a secure, reliable,
high-performance network ... a Novell NetWare network.
Loading...