juanluisbaptiste / docker-otrs

The unofficial Znuny/OTRS Ticketing System docker image
https://www.juanbaptiste.tech/category/otrs
GNU Lesser General Public License v3.0
173 stars 101 forks source link

Can't connect to MySQL server #52

Closed abaum26 closed 5 years ago

abaum26 commented 5 years ago

Hello,

I insert Docker on a Synology DS918 +. Your packages from MariaDB and Postfix each run in a separate container. I will start your OTRS package with the following environment variables:

OTRS_HOSTNAME helpdesk.test.de OTRS_DB_NAME otrs OTRS_DB_USER otrs OTRS_DB_PASSWORD qwer1234 OTRS_ROOT_PASSWORD qwer1234 MYSQL_ROOT_PASSWORD qwer1234 OTRS_LANGUAGE de OTRS_TICKET_COUNTER 1 OTRS_NUMBER_GENERATOR AutoIncrement OTRS_DB_HOST 192.168.178.75 OTRS_DB_PORT 3308

After starting the OTRS package, I get the following Synology-Docker log:

[INFO] Starting a clean OTRS 6.0.14-01 Free installation ready to be configured !! stdout 17:41:06 stdout 17:41:06 ls: cannot access /opt/otrs/Kernel/: No such file or directory stdout 17:41:06 [INFO] Found empty /opt/otrs/Kernel/, copying default configuration to it... stdout 17:41:27 [INFO] Done. stdout 17:41:27 [INFO] Copying default skins... stdout 17:41:30 [INFO] Done. stdout 17:41:30 [INFO] Updating configuration option DatabaseUser with value: otrs stdout 17:41:30 [INFO] Updating configuration option DatabasePw with value: qwer1234 stdout 17:41:30 [INFO] Updating configuration option DatabaseHost with value: 192.168.178.75 stdout 17:41:30 [INFO] Adding configuration option DatabasePort with value: 3308 stdout 17:41:30 [INFO] Updating configuration option Database with value: otrs stdout 17:41:30 [INFO] Adding configuration option DefaultLanguage with value: de stdout 17:41:30 [INFO] Adding configuration option FQDN with value: helpdesk.test.de stdout 17:41:30 [INFO] Adding configuration option SendmailModule with value: Kernel::System::Email::SMTP stdout 17:41:30 [INFO] Adding configuration option SendmailModule::Host with value: postfix stdout 17:41:30 [INFO] Adding configuration option SendmailModule::Port with value: 25 stdout 17:41:30 [INFO] Adding configuration option SecureMode with value: 1 stdout 17:41:30 ERROR 1049 (42000) at line 1: Unknown database 'otrs' stdout 17:41:30 [INFO] Creating OTRS database... stdout 17:41:30 [INFO] Loading default db schemas... stdout 17:41:57 [INFO] Loading initial db inserts... stdout 17:42:25 [INFO] Loading initial schema constraints... stdout 17:44:45 [INFO] Setting password for default admin account root@localhost to: qwer1234 stdout 17:44:47 Error: The terminal encoding should be set to 'utf-8', but is 'ansi_x3.4-1968'. Some characters might not be displayed correctly. stdout 17:44:47 [Fri Dec 14 17:44:47 2018] otrs.Console.pl: DBI connect('database=otrs;host=192.168.178.75;','otrs',...) failed: Can't connect to MySQL server on '192.168.178.75' (111) at /opt/otrs/Kernel/System/DB.pm line 204. stdout 17:44:47 ERROR: OTRS-otrs.Console.pl-Admin::User::SetPassword-10 Perl: 5.16.3 OS: linux Time: Fri Dec 14 17:44:47 2018 stdout 17:44:47 stdout 17:44:47 Message: Can't connect to MySQL server on '192.168.178.75' (111) stdout 17:44:47 stdout 17:44:47 Traceback (51): stdout 17:44:47 Module: Kernel::System::DB::Prepare Line: 682 stdout 17:44:47 Module: Kernel::System::Valid::ValidList Line: 74 stdout 17:44:47 Module: Kernel::System::Valid::ValidLookup Line: 120 stdout 17:44:47 Module: Kernel::System::Valid::ValidIDsGet Line: 160 stdout 17:44:47 Module: Kernel::System::User::UserSearch Line: 729 stdout 17:44:47 Module: Kernel::System::Console::Command::Admin::User::SetPassword::Run Line: 47 stdout 17:44:47 Module: (eval) Line: 460 stdout 17:44:47 Module: Kernel::System::Console::BaseCommand::Execute Line: 454 stdout 17:44:47 Module: Kernel::System::Console::InterfaceConsole::Run Line: 80 stdout 17:44:47 Module: /opt/otrs/bin/otrs.Console.pl Line: 36 stdout 17:44:47 stdout 17:44:47 ERROR: OTRS-otrs.Console.pl-Admin::User::SetPassword-10 Perl: 5.16.3 OS: linux Time: Fri Dec 14 17:44:47 2018 stdout 17:44:47 stdout 17:44:47 Message: No Valid for valid found! stdout 17:44:47 stdout 17:44:47 Traceback (51): stdout 17:44:47 Module: Kernel::System::Valid::ValidLookup Line: 139 stdout 17:44:47 Module: Kernel::System::Valid::ValidIDsGet Line: 160 stdout 17:44:47 Module: Kernel::System::User::UserSearch Line: 729

This means that OTRS can connect to the database for the installation. No more after installation. How can I fix this. Can it be that the database root is root@localhost and therefore does not get a share, because the database does not run in the same container?

Can I ignore the error message regarding utf-8?

I would be very grateful for your help.

Christmas greetings

Andreas

juanluisbaptiste commented 5 years ago

The error is very clear, your db server is not accepting connections, it has nothing to do with this container.

Closing ticket.

abaum26 commented 5 years ago

Hello,

I am a bit confused. Why then did the setup script of the otrs container access the database server container (juanluisbaptiste/otrs-mariadb). The script could at least create the otrs database and the structure etc. The MySQL Administrator program also gives me access to the database server from my PC.

Greetings

Andreas

abaum26 commented 5 years ago

I tried it alternatively with another OTRS-container (ligero/otrs), which calls however "classical" the installer.pl. This container can access the database server...

Greetings

Andreas

juanluisbaptiste commented 5 years ago

Please post your docker-compose.yml file

abaum26 commented 5 years ago

Apparently, I or Synology's docker system can not handle this comparatively complex configuration. At least the Synology and the DSM have no influence on the configuration files.

I solved the problem completely differently and created a ubunto server with docker-compose via the Synology VMM and installed it via this OTRS container.

Everything worked out great. Only the SMTP settings still cause me problems. Where can I get help for this? However, this is another problem and this post can be closed.

Thanks for your help!

juanluisbaptiste commented 5 years ago

Go to OTRS forums