RT not connecting to database?

John Oliver wrote:> On Mon, Jul 23, 2007 at 01:25:23PM -0700, 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.

Do you perhaps have some really weird characters in the password?

.r’

Just to make it clear. The error you’re seeing has nothing to do with
access control or something like that: names of users, passwords and
etc. It has nothing to do with any perl modules other than DBD::mysql,
but I’m sure it has nothing to do with the latter.

This error means that mysql client library can not CONNECT to a
server. Quick search through mysql site confirm my assumption
http://dev.mysql.com/doc/refman/5.0/en/can-not-connect-to-server.html.
Another thing in the error is the number 13. Fast googling and
grepping though *.h files in my system suggest that it EACCESS error
code of the linux kernel, however it may be something else. Depends on
the system you’re using. Ok, let’s assume you’re using some linux
distro, then the error you’re seeing is generated by the host RT is
started on, otherwise you get some 1xx code. I see several reasons
that can cause it: firewall, selinux or another security extension of
the system. Why don’t you see the same error when connect to the mysql
server from command line? You start RT as part of apache server, the
sever runs under user xxx(web, apache, nobody…). During testing
you’re using another account.On 7/24/07, John Oliver joliver@john-oliver.net wrote:

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.




The rt-users Archives

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

Best regards, Ruslan.

Ruslan makes a good point. In FC6 and FC7, selinux is enabled by default.
You definitely want to turn that off. Make sure you add:

SELINUX=disabled

to the following file: /etc/selinux/config

Then reboot.

James Moseley

         "Ruslan Zakirov"                                              
         <ruz@bestpractica                                             
         l.com>                                                     To 
         Sent by:                  "John Oliver"                       
         rt-users-bounces@         <joliver@john-oliver.net>           
         lists.bestpractic                                          cc 
         al.com                    rt-users@lists.bestpractical.com    
                                                               Subject 
                                   Re: [rt-users] RT not connecting to 
         07/30/2007 08:05          database?                           
         PM                                                            

Just to make it clear. The error you’re seeing has nothing to do with
access control or something like that: names of users, passwords and
etc. It has nothing to do with any perl modules other than DBD::mysql,
but I’m sure it has nothing to do with the latter.

This error means that mysql client library can not CONNECT to a
server. Quick search through mysql site confirm my assumption
http://dev.mysql.com/doc/refman/5.0/en/can-not-connect-to-server.html.
Another thing in the error is the number 13. Fast googling and
grepping though *.h files in my system suggest that it EACCESS error
code of the linux kernel, however it may be something else. Depends on
the system you’re using. Ok, let’s assume you’re using some linux
distro, then the error you’re seeing is generated by the host RT is
started on, otherwise you get some 1xx code. I see several reasons
that can cause it: firewall, selinux or another security extension of
the system. Why don’t you see the same error when connect to the mysql
server from command line? You start RT as part of apache server, the
sever runs under user xxx(web, apache, nobody…). During testing
you’re using another account.On 7/24/07, John Oliver joliver@john-oliver.net wrote:

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.




The rt-users Archives

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

Best regards, Ruslan.
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

Good. I wouldn’t waste my time trying to tweak selinux. It sounds like
it’s behind a firewall on an internal netwrok, so why turn it on at all.
There are many other things that will break with selinux turned on…

James Moseley

         John Oliver                                                   
         <joliver@john-oli                                             
         ver.net>                                                   To 
                                   James Moseley                       
         07/31/2007 03:21          <jmoseley@corp.xanadoo.com>         
         PM                                                         cc 
                                                                       
                                                               Subject 
                                   Re: [rt-users] RT not connecting to 
                                   database?                           

Ruslan makes a good point. In FC6 and FC7, selinux is enabled by
default.
You definitely want to turn that off. Make sure you add:

SELINUX=disabled

HOLY CRAP THAT WAS IT!!!

I used to install with SELinux disabled by habit. After attending the
Red Hat Expo, I left it enabled… they had gone on and on about how
things were different, etc. and I believed them :slight_smile:

I may see if I can figure out the “right” fix for SELinux rather than
leaving it disabled. But this is an internal server with no connection
to the outside world, so I’m not going to get too bent out of shape
over this.

Thanks!!!

Good. I wouldn’t waste my time trying to tweak selinux. It sounds like
it’s behind a firewall on an internal netwrok, so why turn it on at all.
There are many other things that will break with selinux turned on…

Except, if nobody ever figures out the correct fixes for SELinux, then
everyone will keep defaulting to disabling it. And SELinux really is a
really, really good idea.

If I get it, I’ll add it to the wiki. If not… I know I’ll live!