Scheduler stuck on old database name

Moderator: crythias

Post Reply
jbaptiste
Znuny advanced
Posts: 104
Joined: 01 Aug 2015, 03:45
Znuny Version: 6.0.x
Contact:

Scheduler stuck on old database name

Post by jbaptiste »

hi,

I'm having a very strange issue, I restored a backup on a different OTRS environment, where the difference between the two is that where the backup was taken, the database is external and is accessed through the hostname mariadb that has been added to /etc/hosts. Where I'm restoring the backup, the database server runs on the same machine as the OTRS install. Config.pm has been updated to point the database server to localhost, and everything seems to be working fine, BUT I have millions of log files in less than 24 hours with this error:

Code: Select all

Daemon]# more SchedulerFutureTaskManagerERR.log
[Thu Jul 27 06:08:12 2017] otrs.Daemon.pl: DBI connect('database=otrs;host=maria
db','otrs',...) failed: Unknown MySQL server host 'mariadb' (0) at /opt/otrs/Ker
nel/System/DB.pm line 202.
ERROR: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::Sched
ulerFutureTaskManager-100 Perl: 5.16.3 OS: linux Time: Thu Jul 27 06:08:12 2017

 Message: Unknown MySQL server host 'mariadb' (0)

 Traceback (22698): 
   Module: Kernel::System::DB::Ping Line: 1623
   Module: Kernel::System::Daemon::DaemonModules::SchedulerFutureTaskManager::Pr
eRun Line: 97
   Module: (eval) Line: 316
   Module: main::Start Line: 316
   Module: /opt/otrs/bin/otrs.Daemon.pl Line: 138
It's like the scheduler is getting the old host name from somewhere that isn't Config.pm which points to localhost:

Code: Select all

# more /opt/otrs/Kernel/Config.pm|grep DatabaseHost
    $Self->{'DatabaseHost'} = 'localhost';
The database connection test works too:

Code: Select all

# su -c "bin/otrs.Console.pl Maint::Database::Check" -s /bin/bash
Trying to connect to database 'DBI:mysql:database=otrs;host=localhost' with user 'otrs'...
Connection successful.
I have sweeped with grep all the installation directory and there's no mention of mariadb anywhere besides those logs. I also tried rebuilding the configuration or deleting the cache with no success, so I really don't get from where the scheduler is getting the old database name, if everything is working ok.

This is on an OTRS 5.0.18 install. Any ideas ??
Want to run OTRS on docker ? checkout my OTRS on docker HOWTO | Project's github page
jbaptiste
Znuny advanced
Posts: 104
Joined: 01 Aug 2015, 03:45
Znuny Version: 6.0.x
Contact:

Re: Scheduler stuck on old database name

Post by jbaptiste »

Any ideas on this one ? to try to stop the error message I added an entry /etc/hosts pointing to the server's IP address and added permissions to otrs@mariadb for the otrs database (which I tested successfully on the command line) and now I get a //permission denied// error

Code: Select all

Message: Access denied for user 'otrs'@'mariadb' (using password: YES)

 Traceback (4185): 
   Module: Kernel::System::DB::Ping Line: 1623
   Module: Kernel::System::Daemon::DaemonModules::SchedulerFutureTaskManager::Pr
eRun Line: 97
   Module: (eval) Line: 316
   Module: main::Start Line: 316
   Module: /opt/otrs/bin/otrs.Daemon.pl Line: 138

mysql -h mariadb -pXXXX -u otrs otrs
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 203661
Server version: 5.5.52-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [otrs]> 
Want to run OTRS on docker ? checkout my OTRS on docker HOWTO | Project's github page
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Scheduler stuck on old database name

Post by reneeb »

Did you check the password?
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Post Reply