Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can´t connect to database #1

Open
pacosta opened this issue Dec 20, 2018 · 2 comments
Open

Can´t connect to database #1

pacosta opened this issue Dec 20, 2018 · 2 comments

Comments

@pacosta
Copy link

pacosta commented Dec 20, 2018

I have the following error when i run the container with the command that you provide.
Any sugestions?

    -v `pwd`/RT_SiteConfig.d:/opt/rt/etc/RT_SiteConfig.d/ \
    -p 8000:8000 \
    quay.io/abh/rt:latest
[7] [Thu Dec 20 15:19:11 2018] [warning]: DBI connect('dbname=rt4;host=localhost','rt_user',...) failed: Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2 "No such file or directory") at /usr/local/share/perl5/site_perl/DBIx/SearchBuilder/Handle.pm line 106. (/usr/share/perl5/core_perl/Carp.pm:169)

RT couldn't connect to the database where tickets are stored.
If this is a new installation of RT, you should visit the URL below
to configure RT and initialize your database.

If this is an existing RT installation, this may indicate a database
connectivity problem.

The error RT got back when trying to connect to your database was:

Connect Failed Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2 "No such file or directory")
 at /opt/rt/sbin/../lib/RT.pm line 221.


[7] [Thu Dec 20 15:19:11 2018] [warning]: DBI connect('dbname=rt4;host=localhost','rt_user',...) failed: Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2 "No such file or directory") at /usr/local/share/perl5/site_perl/DBIx/SearchBuilder/Handle.pm line 106. (/usr/share/perl5/core_perl/Carp.pm:169)
[7] [Thu Dec 20 15:19:12 2018] [critical]: Can't call method "AddRight" on an undefined value at /opt/rt/local/plugins/RT-Authen-Token/lib/RT/Authen/Token.pm line 7.
Compilation failed in require at /opt/rt/sbin/../lib/RT.pm line 775. (/opt/rt/sbin/../lib/RT.pm:408)
Can't call method "AddRight" on an undefined value at /opt/rt/local/plugins/RT-Authen-Token/lib/RT/Authen/Token.pm line 7.
Compilation failed in require at /opt/rt/sbin/../lib/RT.pm line 775```
@abh
Copy link
Owner

abh commented Dec 20, 2018 via email

@pacosta
Copy link
Author

pacosta commented Dec 20, 2018

Did you provide a configuration file? It has to be mounted into the container. If so use 127.0.0.1 instead of localhost (or even the proper IP of your database server).

My config file looks like this:


#Set($WebPort, 8000);
Set($DatabaseHost , '127.0.0.1');
#Set($DatabaseName , 'rt4');
#Set($DatabaseType , 'mysql');
#Set($DatabaseUser, "rt_user");
#Set($DatabasePassword , '');
Plugin( "RT::Authen::Token" );
Plugin('RT::Extension::REST2');

1; 

And the error changed to:

DBI connect('dbname=rt4;host=127.0.0.1','rt_user',...) failed: Can't connect to MySQL server on '127.0.0.1' (111 "Connection refused") at /usr/local/share/perl5/site_perl/DBIx/SearchBuilder/Handle.pm line 106. (/usr/share/perl5/core_perl/Carp.pm:169)

RT couldn't connect to the database where tickets are stored.
If this is a new installation of RT, you should visit the URL below
to configure RT and initialize your database.

If this is an existing RT installation, this may indicate a database
connectivity problem.

The error RT got back when trying to connect to your database was:

Connect Failed Can't connect to MySQL server on '127.0.0.1' (111 "Connection refused")
 at /opt/rt/sbin/../lib/RT.pm line 221.


[9] [Thu Dec 20 18:08:51 2018] [warning]: DBI connect('dbname=rt4;host=127.0.0.1','rt_user',...) failed: Can't connect to MySQL server on '127.0.0.1' (111 "Connection refused") at /usr/local/share/perl5/site_perl/DBIx/SearchBuilder/Handle.pm line 106. (/usr/share/perl5/core_perl/Carp.pm:169)
[9] [Thu Dec 20 18:08:51 2018] [critical]: Can't call method "AddRight" on an undefined value at /opt/rt/local/plugins/RT-Authen-Token/lib/RT/Authen/Token.pm line 7.
Compilation failed in require at /opt/rt/sbin/../lib/RT.pm line 775. (/opt/rt/sbin/../lib/RT.pm:408)
Can't call method "AddRight" on an undefined value at /opt/rt/local/plugins/RT-Authen-Token/lib/RT/Authen/Token.pm line 7.
Compilation failed in require at /opt/rt/sbin/../lib/RT.pm line 775.```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants