RT not connecting to database?

When I hit my RT install in a browser, I get an Internet Server Error.
The error_log says:

DBI connect(‘dbname=rt3;host=10.12.14.149’,‘rt_user’,…) failed: Can’t
connect to MySQL server on ‘10.12.14.149’ (13) at
/usr/lib/perl5/vendor_perl/5.8.8/DBIx/SearchBuilder/Handle.pm line 106
Connect Failed Can’t connect to MySQL server on ‘10.12.14.149’ (13)
at /usr/lib/perl5/vendor_perl/5.8.8/RT.pm line 205
[Mon Jul 23 13:20:52 2007] [warn] (104)Connection reset by peer:
mod_fcgid: read data from fastcgi server error.
[Mon Jul 23 13:20:52 2007] [error] [client 192.168.2.231] Premature end
of script headers: mason_handler.fcgi

But:

[root@rt3 ~]# mysqladmin -h 10.12.14.149 -u rt_user -p ping
Enter password:
mysqld is alive

The MySQL server is up, running, and available.

Does this error happen all the time or after a longer time without any usage?

All the time.

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com rt-users-bounces@lists.bestpractical.com
To: rt-users@lists.bestpractical.com rt-users@lists.bestpractical.com
Sent: Mon Jul 23 22:25:23 2007
Subject: [rt-users] RT not connecting to database?

When I hit my RT install in a browser, I get an Internet Server Error.
The error_log says:

DBI connect(‘dbname=rt3;host=10.12.14.149’,‘rt_user’,…) failed: Can’t
connect to MySQL server on ‘10.12.14.149’ (13) at
/usr/lib/perl5/vendor_perl/5.8.8/DBIx/SearchBuilder/Handle.pm line 106
Connect Failed Can’t connect to MySQL server on ‘10.12.14.149’ (13)
at /usr/lib/perl5/vendor_perl/5.8.8/RT.pm line 205
[Mon Jul 23 13:20:52 2007] [warn] (104)Connection reset by peer:
mod_fcgid: read data from fastcgi server error.
[Mon Jul 23 13:20:52 2007] [error] [client 192.168.2.231] Premature end
of script headers: mason_handler.fcgi

I can run mason_handler.fcgi from the command line and get results,
so… some issue with the Apache configuration?

Is the server at the same box or on a separated box? How does your setup looks like?

The database is on a separate host. It can be accessed with mysqladmin
from the host running RT, so there isn’t a firewall or anything.

-----Original Message-----

Does this error happen all the time or after a longer time without any usage?

All the time.

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com rt-users-bounces@lists.bestpractical.com
To: rt-users@lists.bestpractical.com rt-users@lists.bestpractical.com
Sent: Mon Jul 23 22:25:23 2007
Subject: [rt-users] RT not connecting to database?

When I hit my RT install in a browser, I get an Internet Server Error.
The error_log says:

DBI connect(‘dbname=rt3;host=10.12.14.149’,‘rt_user’,…) failed: Can’t
connect to MySQL server on ‘10.12.14.149’ (13) at
/usr/lib/perl5/vendor_perl/5.8.8/DBIx/SearchBuilder/Handle.pm line 106
Connect Failed Can’t connect to MySQL server on ‘10.12.14.149’ (13)
at /usr/lib/perl5/vendor_perl/5.8.8/RT.pm line 205
[Mon Jul 23 13:20:52 2007] [warn] (104)Connection reset by peer:
mod_fcgid: read data from fastcgi server error.
[Mon Jul 23 13:20:52 2007] [error] [client 192.168.2.231] Premature end
of script headers: mason_handler.fcgi

I can run mason_handler.fcgi from the command line and get results,
so… some issue with the Apache configuration?

No, firewall was not my idea behind, have you tried from rtwww to rtdb with mysql -uusername -p -h rtdb and this works? Are the rights granded correctly during the installation?

[root@rt3 ~]# mysql -u rt_user -p -h 10.12.14.149
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 53
Server version: 5.0.22

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> show databases;
| Database |
| information_schema |
| rt3 |
| test |
3 rows in set (0.00 sec)

mysql> quit
Bye

Is the server at the same box or on a separated box? How does your setup looks like?

The database is on a separate host. It can be accessed with mysqladmin
from the host running RT, so there isn’t a firewall or anything.

-----Original Message-----

Does this error happen all the time or after a longer time without any usage?

All the time.

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com rt-users-bounces@lists.bestpractical.com
To: rt-users@lists.bestpractical.com rt-users@lists.bestpractical.com
Sent: Mon Jul 23 22:25:23 2007
Subject: [rt-users] RT not connecting to database?

When I hit my RT install in a browser, I get an Internet Server Error.
The error_log says:

DBI connect(‘dbname=rt3;host=10.12.14.149’,‘rt_user’,…) failed: Can’t
connect to MySQL server on ‘10.12.14.149’ (13) at
/usr/lib/perl5/vendor_perl/5.8.8/DBIx/SearchBuilder/Handle.pm line 106
Connect Failed Can’t connect to MySQL server on ‘10.12.14.149’ (13)
at /usr/lib/perl5/vendor_perl/5.8.8/RT.pm line 205
[Mon Jul 23 13:20:52 2007] [warn] (104)Connection reset by peer:
mod_fcgid: read data from fastcgi server error.
[Mon Jul 23 13:20:52 2007] [error] [client 192.168.2.231] Premature end
of script headers: mason_handler.fcgi

I can run mason_handler.fcgi from the command line and get results,
so… some issue with the Apache configuration?

I’m still having this problem.

I configured Apache to use mod_perl instead of fcgid and I get the same
results.

The databaase is accessible, but RT won’t access it. I’m stumped.
Could this be an issue with perl-DBI? Or something else?

How can I troubleshoot further? I’m stuck.

Please list the Set($Database* entries you have in RT_SiteConfig.pm

Also, have you run ‘make testdeps’ to see if you are missing any perl
modules?

James Moseley

         John Oliver                                                   
         <joliver@john-oli                                             
         ver.net>                                                   To 
         Sent by:                  rt-users@lists.bestpractical.com    
         rt-users-bounces@                                          cc 
         lists.bestpractic                                             
         al.com                                                Subject 
                                   Re: Re: [rt-users] RT not           
                                   connecting to database?             
         07/25/2007 04:10                                              
         PM                                                            

Is the server at the same box or on a separated box? How does your
setup looks like?

The database is on a separate host. It can be accessed with mysqladmin
from the host running RT, so there isn’t a firewall or anything.

-----Original Message-----

Does this error happen all the time or after a longer time without
any usage?

All the time.

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
rt-users-bounces@lists.bestpractical.com
To: rt-users@lists.bestpractical.com
rt-users@lists.bestpractical.com
Sent: Mon Jul 23 22:25:23 2007
Subject: [rt-users] RT not connecting to database?

When I hit my RT install in a browser, I get an Internet Server
Error.
The error_log says:

DBI connect(‘dbname=rt3;host=10.12.14.149’,‘rt_user’,…) failed:
Can’t
connect to MySQL server on ‘10.12.14.149’ (13) at
/usr/lib/perl5/vendor_perl/5.8.8/DBIx/SearchBuilder/Handle.pm line
106
Connect Failed Can’t connect to MySQL server on ‘10.12.14.149’ (13)
at /usr/lib/perl5/vendor_perl/5.8.8/RT.pm line 205
[Mon Jul 23 13:20:52 2007] [warn] (104)Connection reset by peer:
mod_fcgid: read data from fastcgi server error.
[Mon Jul 23 13:20:52 2007] [error] [client 192.168.2.231] Premature
end
of script headers: mason_handler.fcgi

I can run mason_handler.fcgi from the command line and get results,
so… some issue with the Apache configuration?

I’m still having this problem.

I configured Apache to use mod_perl instead of fcgid and I get the same
results.

The databaase is accessible, but RT won’t access it. I’m stumped.
Could this be an issue with perl-DBI? Or something else?

How can I troubleshoot further? I’m stuck.

http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Please list the Set($Database* entries you have in RT_SiteConfig.pm

Set($DatabaseHost , ‘10.12.14.149’);
Set($DatabaseRTHost , ‘10.12.14.149’);

#The name of the database user (inside the database)
Set($DatabaseUser , ‘rt_user’);

Password the DatabaseUser should use to access the database

Set($DatabasePassword , ‘***********’);

The name of the RT’s database on your database server

Set($DatabaseName , ‘rt3’);

Also, have you run ‘make testdeps’ to see if you are missing any perl
modules?

No. RT was installed as an RPM via yum from the FC7 extras repository.

FWIW, I installed a CentOS 5 host to try to install from source again…
and am once again trapped in a hopeless maze of unresolvable
dependencies. Tons of the items that make fixdeps wants to install
fail, but there are so many of them rushing by, I couldn’t begin to
guess what’s failing or why. This is why I wanted to get the RPM
install working.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1On Wed, 25 Jul 2007 at 14:10 (-0700), John Oliver wrote:

The database is on a separate host. It can be accessed with mysqladmin
from the host running RT, so there isn’t a firewall or anything.

When I hit my RT install in a browser, I get an Internet Server
Error. The error_log says:

DBI connect(‘dbname=rt3;host=10.12.14.149’,‘rt_user’,…) failed: Can’t
connect to MySQL server on ‘10.12.14.149’ (13) at
/usr/lib/perl5/vendor_perl/5.8.8/DBIx/SearchBuilder/Handle.pm line 106
Connect Failed Can’t connect to MySQL server on ‘10.12.14.149’ (13)
at /usr/lib/perl5/vendor_perl/5.8.8/RT.pm line 205
[Mon Jul 23 13:20:52 2007] [warn] (104)Connection reset by peer:
mod_fcgid: read data from fastcgi server error.
[Mon Jul 23 13:20:52 2007] [error] [client 192.168.2.231] Premature end
of script headers: mason_handler.fcgi

I can run mason_handler.fcgi from the command line and get results,
so… some issue with the Apache configuration?

I’m still having this problem.

I configured Apache to use mod_perl instead of fcgid and I get the same
results.

The databaase is accessible, but RT won’t access it. I’m stumped. Could
this be an issue with perl-DBI? Or something else?

John,

I think I missed the earliest parts of this discussion, so let me just
ask: are you using SSL to connect to your remote MySQL database?

I do and my experience has been that out of the box RT doesn’t provide a
way to tell DBD::MySQL (used by DBI) where to find the SSL certificates.
That information is normally pointed to in the MySQL client ‘my.cnf’ file
and the location of that file must be specified in the database connect(),
or as a separate DBI statement. This takes place in the RT::Handle
module.

[The ‘mysql’ command line client knows how to find the my.cnf file, or can
be told how, via an environment variable. But perl’s DBD::MySQL requires
this information to be coded explicitly].

So, I wrote a small customization mod to RT::Handle that allows you to
specify the location of ‘my.cnf’ as a variable in RT_SiteConfig.pm. This
has been working for me for a couple of months now. I’m running RT 3.6.3.

On the other hand, if you’re not requiring SSL for your database
connection, the above is not relevant to your problem.

Mike

Mike Friedman Information Services & Technology
mikef@ack.Berkeley.EDU 2484 Shattuck Avenue
1-510-642-1410 University of California at Berkeley
Socrates and Berkeley Scholars Web Hosting Services Have Been Retired | Web Platform Services http://ist.berkeley.edu

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8

iQA/AwUBRqgGta0bf1iNr4mCEQI9tQCgj9Qi00lX8BJwuDghLxf/BaQ6U9AAnjto
Dv1z6ZWRM0NBbXexiaolRO5G
=5xmP
-----END PGP SIGNATURE-----

Our mysql database is on separate server as well, however, I have
$DatabaseRTHost set to ‘localhost’ via the defaults in RT_Config.pm. You
might try changing to localhost as well. I will admit I don’t know what
this variable defines, exactly…

I will still suggest you download the source and run ‘make testdeps’ on the
box you are trying to get RT working on. I am not suggesting that you
actually go through with trying to install from source, just suggesting
that you do this to find out what perl modules may be missing. At this
point, neither you, me, nor the list knows for sure if all the necessary
perl modules have been installed via the FC7 yum RPM.

James Moseley

         John Oliver                                                   
         <joliver@john-oli                                             
         ver.net>                                                   To 
         Sent by:                  rt-users@lists.bestpractical.com    
         rt-users-bounces@                                          cc 
         lists.bestpractic                                             
         al.com                                                Subject 
                                   Re: Re: [rt-users] RT not           
                                   connecting to database?             
         07/25/2007 06:21                                              
         PM                                                            

Please list the Set($Database* entries you have in RT_SiteConfig.pm

Set($DatabaseHost , ‘10.12.14.149’);
Set($DatabaseRTHost , ‘10.12.14.149’);

#The name of the database user (inside the database)
Set($DatabaseUser , ‘rt_user’);

Password the DatabaseUser should use to access the database

Set($DatabasePassword , ‘***********’);

The name of the RT’s database on your database server

Set($DatabaseName , ‘rt3’);

Also, have you run ‘make testdeps’ to see if you are missing any perl
modules?

No. RT was installed as an RPM via yum from the FC7 extras repository.

FWIW, I installed a CentOS 5 host to try to install from source again…
and am once again trapped in a hopeless maze of unresolvable
dependencies. Tons of the items that make fixdeps wants to install
fail, but there are so many of them rushing by, I couldn’t begin to
guess what’s failing or why. This is why I wanted to get the RPM
install working.

http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Our mysql database is on separate server as well, however, I have
$DatabaseRTHost set to ‘localhost’ via the defaults in RT_Config.pm. You
might try changing to localhost as well. I will admit I don’t know what
this variable defines, exactly…

I’ll give this a shot.

I will still suggest you download the source and run ‘make testdeps’ on the
box you are trying to get RT working on. I am not suggesting that you
actually go through with trying to install from source, just suggesting
that you do this to find out what perl modules may be missing. At this
point, neither you, me, nor the list knows for sure if all the necessary
perl modules have been installed via the FC7 yum RPM.

I’ll try this as well, but I have little confidence it will help… I
opened the source on another host (CentOS 5), and make testdeps listed a
couple of dozen needed dependencies. make fixdeps fixed a few, but
wouldn’t touch most of the rest. I try to install them via CPAN, and I
get messages about no such thing, or dependencies that fail to install,
dependencies that are further dependant upon other dependancies that
are unresolvable because they in turn are dependant upon still more
things that can’t be installed… quite frankly, this is the most
frustrating software package I’ve ever tried to install. I remember
cursing at sendmail 10 years or so ago. It was well-known as a
hideously complex, arcane piece of work, and was nowheres near as bad
as RT! :slight_smile:

John,

I think I missed the earliest parts of this discussion, so let me just
ask: are you using SSL to connect to your remote MySQL database?

No :slight_smile:

Right now, I’m just trying to get RT working “out of the box”. I
haven’t even thought about any bizarre customizations. Honestly,
thinking about doing something like SSL makes me want to just shoot
myself in the head… anything that’s this difficult and time-consuming
simply to install cannot be customization-friendly.

I will still suggest you download the source and run ‘make testdeps’ on the
box you are trying to get RT working on.

[root@rt3 rt-3.6.4]# make testdeps | grep -v found
/usr/bin/perl ./sbin/rt-test-dependencies --verbose --with-mysql
$VAR1 = {
‘with-STANDALONE’ => 0,
‘with-MASON’ => 1,
‘with-MAILGATE’ => 1,
‘with-CORE’ => 1,
‘with-CLI’ => 1,
‘v’ => 1,
‘with-DEV’ => 0,
‘with-MYSQL’ => 1
};
perl:
users:
CLI dependencies:
CORE dependencies:
Text::Quoted 2.02…MISSING
Text::Autoformat …MISSING
Module::Versions::Report 1.03…MISSING
Module::Versions::Report version 1.03 required–this is
only version 1.02 at (eval 33) line 2.
MAILGATE dependencies:
MASON dependencies:
Text::WikiFormat 0.76…MISSING
XML::RSS 1.05…MISSING
MYSQL dependencies:

SOMETHING WAS MISSING!

So, no missing MySQL-related items. I can’t help but think that the
ones shown as missing couldn’t possibly have anything to do with RT not
connecting to the database.

Sorry I have n’t the rest of the thread available …
is your mysql and the web (where rt is )on the same server ??
can you from the command line connect to the rt3 (or whatever your rt
database) using the same username and password in RT_SiteConfig ??
Apologies if you have already checked that
Roy

John Oliver wrote:> On Wed, Jul 25, 2007 at 10:26:08PM -0500, James Moseley wrote:

I will still suggest you download the source and run ‘make testdeps’ on the
box you are trying to get RT working on.

[root@rt3 rt-3.6.4]# make testdeps | grep -v found
/usr/bin/perl ./sbin/rt-test-dependencies --verbose --with-mysql
$VAR1 = {
‘with-STANDALONE’ => 0,
‘with-MASON’ => 1,
‘with-MAILGATE’ => 1,
‘with-CORE’ => 1,
‘with-CLI’ => 1,
‘v’ => 1,
‘with-DEV’ => 0,
‘with-MYSQL’ => 1
};
perl:
users:
CLI dependencies:
CORE dependencies:
Text::Quoted 2.02…MISSING
Text::Autoformat …MISSING
Module::Versions::Report 1.03…MISSING
Module::Versions::Report version 1.03 required–this is
only version 1.02 at (eval 33) line 2.
MAILGATE dependencies:
MASON dependencies:
Text::WikiFormat 0.76…MISSING
XML::RSS 1.05…MISSING
MYSQL dependencies:

SOMETHING WAS MISSING!

So, no missing MySQL-related items. I can’t help but think that the
ones shown as missing couldn’t possibly have anything to do with RT not
connecting to the database.

Sorry I have n’t the rest of the thread available …
is your mysql and the web (where rt is )on the same server ??

No.

can you from the command line connect to the rt3 (or whatever your rt
database) using the same username and password in RT_SiteConfig ??

Yes.

Have you checked the mysql logs or done a ‘show processlist’ in a mysql
shell to see if the connection attempt by RT is even making it to the mysql
server?

James Moseley

         John Oliver                                                   
         <joliver@john-oli                                             
         ver.net>                                                   To 
         Sent by:                  rt-users@lists.bestpractical.com    
         rt-users-bounces@                                          cc 
         lists.bestpractic                                             
         al.com                                                Subject 
                                   Re: [rt-users] RT not connecting to 
                                   database?                           
         07/26/2007 05:09                                              
         PM                                                            

Sorry I have n’t the rest of the thread available …
is your mysql and the web (where rt is )on the same server ??

No.

can you from the command line connect to the rt3 (or whatever your rt
database) using the same username and password in RT_SiteConfig ??

Yes.

http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

John;
I would suggest you install the missing dependencies if you want a
working rt you’ll have to install them anyway.
I would agree with you that they appear not to be relevant, but it maybe
rt is coming across a missing module and its returning a default error
of mysql server not found or whatever its you are getting …
Also when you test your sql from command line, try to execute a select
from rt3 database, ie select * from Users or anything like that instead
of just show tables.

Roy

John Oliver wrote:> On Thu, Jul 26, 2007 at 07:02:53PM +0100, Roy El-Hames wrote:

Sorry I have n’t the rest of the thread available …
is your mysql and the web (where rt is )on the same server ??

No.

can you from the command line connect to the rt3 (or whatever your rt
database) using the same username and password in RT_SiteConfig ??

Yes.

Have you checked the mysql logs or done a ‘show processlist’ in a mysql
shell to see if the connection attempt by RT is even making it to the mysql
server?

From the RT host, I can connect to the database server via the mysql
command and:

mysql> show processlist;
| Id | User | Host | db | Command | Time | State
| Info |
| 56 | rt_user | rt3.xxxxxxxxxxxxx:40169 | rt3 | Query | 0 | NULL
| show processlist |
1 row in set (0.00 sec)

Nothing is logged to /var/log/mysqld.log when I try to access RT, but
nothing is logged if I log in via the CLI either.

BTW, I fixed all perl dependencies:

[root@rt3 rt-3.6.4]# make testdeps | grep -v found
/usr/bin/perl ./sbin/rt-test-dependencies --verbose --with-mysql
$VAR1 = {
‘with-STANDALONE’ => 0,
‘with-MASON’ => 1,
‘with-MAILGATE’ => 1,
‘with-CORE’ => 1,
‘with-CLI’ => 1,
‘v’ => 1,
‘with-DEV’ => 0,
‘with-MYSQL’ => 1
};
perl:
users:
CLI dependencies:
CORE dependencies:
MAILGATE dependencies:
MASON dependencies:
MYSQL dependencies:

[root@rt3 rt-3.6.4]#

John;
I would suggest you install the missing dependencies if you want a
working rt you’ll have to install them anyway.
I would agree with you that they appear not to be relevant, but it maybe
rt is coming across a missing module and its returning a default error
of mysql server not found or whatever its you are getting …

I’ve already fixed them all. No change.

Also when you test your sql from command line, try to execute a select
from rt3 database, ie select * from Users or anything like that instead
of just show tables.

[root@rt3 rt-3.6.4]# mysql -u rt_user -p -h 10.12.14.149
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.0.22

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> use rt3;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select * from Users;
Empty set (0.00 sec)

When I hit my RT install in a browser, I get an Internet Server Error.
The error_log says:

DBI connect(‘dbname=rt3;host=10.12.14.149’,‘rt_user’,…) failed: Can’t
connect to MySQL server on ‘10.12.14.149’ (13) at
/usr/lib/perl5/vendor_perl/5.8.8/DBIx/SearchBuilder/Handle.pm line 106
Connect Failed Can’t connect to MySQL server on ‘10.12.14.149’ (13)
at /usr/lib/perl5/vendor_perl/5.8.8/RT.pm line 205
[Mon Jul 23 13:20:52 2007] [warn] (104)Connection reset by peer:
mod_fcgid: read data from fastcgi server error.
[Mon Jul 23 13:20:52 2007] [error] [client 192.168.2.231] Premature end
of script headers: mason_handler.fcgi

But:

[root@rt3 ~]# mysqladmin -h 10.12.14.149 -u rt_user -p ping
Enter password:
mysqld is alive

The MySQL server is up, running, and available.

I’m still having this problem.

I have done zero customization. I’m working with this “out of the box”.
I cannot possibly be the only one who cannot get RT working. If I could
get a solution, I’ll happliy document it in the wiki.

John Oliver wrote:

I’m still having this problem.

I have done zero customization. I’m working with this “out of the box”.
I cannot possibly be the only one who cannot get RT working. If I could
get a solution, I’ll happliy document it in the wiki.

can you post my.cnf please