Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

DBI Confusion

Quote Reply
DBI Confusion
I'm getting a DBI error while trying to set up 2.0.2 that I assume is a system configuration error. The error is:

Error: Can't locate object method "connect" via package "Apache::DBI::connect" at /usr/lib/perl5/site_perl/5.6.0/i386-linux/DBI.pm line 408.

At first everything appeared to be functional after a fresh install without mod_perl. I added the configuration options for use with mod_perl in a startup.pl file and that's when I started getting this error.

I tried to revert back to the non-mod_perl install with no luck. I'm going to reinstall from scratch right now and see if I get the same results.

I'm running DBI 1.14 as included with the RedHat 7.1 distribution.

Quote Reply
Re: DBI Confusion In reply to
I get the same error even after removing the mod_perl configuration and running the install.cgi script again. I get the same error when I try to initialize the new database.



Quote Reply
Re: DBI Confusion In reply to
Hi,

Try installing or reinstalling Apache::DBI module. This is required if you are running under mod_perl as it caches database connections.

If you are still having problems under a fresh install, most likely you didn't restart the mod_perl server after reinstalling the program.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: DBI Confusion In reply to
I've tried jsut about everything I can think of to fix this problem. I'm still getting the same error after reinstalling the operating system withouth any of the default RedHat Apache or MySQL support. I upgraded the version of perl that was installed with RedHat 7.1 prior to compiling Apache, MySQL, DBI, and Mysql-modules all from the latest sources.

I think my problem may stem from the fact that the DBI.pm is not being found in the @INC path. I had to copy it from ../i686-linux/DBI.pm to ..i686-linux/Apache/DBI.pm directory in order for httpd to start. I assume this is where my problem is. It's just a guess. Any suggestions?

System Information
======================================
Perl Version: 5.006001
Gossamer Mail Version: 2.0.2-Upgrade
DBI.pm Version: 1.18
MIME::Base64 Version: 2.12
Digest::MD5 Version: 2.13
Persistant Env: mod_perl (1) SpeedyCGI (0)
Mod Perl Version: 1.26
DBI::errstr = @INC =
/var/www/cgi-bin/admin
/usr/local/lib/perl5/site_perl/5.6.1/i686-linux/
/usr/local/lib/perl5/5.6.1/i686-linux
/usr/local/lib/perl5/5.6.1
/usr/local/lib/perl5/site_perl/5.6.1/i686-linux
/usr/local/lib/perl5/site_perl/5.6.1
/usr/local/lib/perl5/site_perl
.
/usr/local/apache/
/usr/local/apache/lib/perl


Stack Trace
======================================
GMail (836): DBI::connect called at /var/www/cgi-bin/admin/GT/SQL/Driver.pm line 78 with arguments
(DBI, DBI:mysql:gmail:mailsql.chaosunlimited.com, a-user-name, a-password, HASH(0x8db0e88)).
GMail (836): GT::SQL::Driver::connect called at /var/www/cgi-bin/admin/GT/SQL/Table.pm line 132 with arguments
(GT::SQL::Driver::MYSQL=HASH(0x8da97bc)).
GMail (836): GT::SQL::Table::connect called at /var/www/cgi-bin/admin/GT/SQL/Table.pm line 320 with arguments
(GT::SQL::Table=HASH(0x8dabd70)).
GMail (836): GT::SQL::Table::update called at /var/www/cgi-bin/admin/GMail/User.pm line 164 with arguments
(GT::SQL::Table=HASH(0x8dabd70), HASH(0x8d9b048), HASH(0x8da9780)).
GMail (836): GMail::User::update_template called at /var/www/cgi-bin/admin/GMail.pm line 586 with arguments
(GMail::User=HASH(0x8d9ca94), default).
GMail (836): GMail::template_set called at /var/www/cgi-bin/user/join.cgi line 40 with arguments
(GMail).
GMail (836): Apache::ROOT::cgi_2dbin::user::join_2ecgi::main called at /var/www/cgi-bin/admin/GT/Plugins.pm line 98 with no arguments.
GMail (836): GT::Plugins::dispatch called at /var/www/cgi-bin/user/join.cgi line 29 with arguments
(GT::Plugins=HASH(0x8da96f0), join::main, CODE(0x8d7bf28)).
GMail (836): Apache::ROOT::cgi_2dbin::user::join_2ecgi::handler called at /usr/local/lib/perl5/site_perl/5.6.1/i686-linux/Apache/Registry.pm line 143 with arguments
(Apache=SCALAR(0x8d67ca8)).
GMail (836): (eval) called at /usr/local/lib/perl5/site_perl/5.6.1/i686-linux/Apache/Registry.pm line 143 with arguments
(Apache=SCALAR(0x8d67ca8)).
GMail (836): Apache::Registry::handler called at /var/www/cgi-bin/admin/GT/SQL/Driver/MYSQL.pm line 0 with arguments
(Apache=SCALAR(0x8d67ca8)).
GMail (836): (eval) called at /var/www/cgi-bin/admin/GT/SQL/Driver/MYSQL.pm line 0 with arguments
(Apache=SCALAR(0x8d67ca8)).





Quote Reply
Re: DBI Confusion In reply to
In Reply To:
I think my problem may stem from the fact that the DBI.pm is not being found in the @INC path. I had to copy it from ../i686-linux/DBI.pm to ..i686-linux/Apache/DBI.pm directory in order for httpd to start. I assume this is where my problem is. It's just a guess. Any suggestions?
Ah, that would do it. DBI and Apache::DBI are two different things. DBI is a module that provides a common perl interface to a database. Apache::DBI is a mod_perl module that provides persistent connections to the database (you don't need to connect/disconnect every request).

What I would do is remove the file you copied in Apache/DBI and do a:

perl -MCPAN -e 'install Apache::DBI'

and you should be set. I don't understand why this module doesn't come with mod_perl, but it should.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: DBI Confusion In reply to
It's amazing how much better things work when you use the correct modules. Thanks Alex.