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

Database Server is not available #28

Closed houstek closed 6 years ago

houstek commented 6 years ago

Hi, thank you for the provision of this image :) I have a problem with the database which is not available when everything seems correct. Here are the logs

DB Running mysql_install_db ..., Installing MariaDB/MySQL system tables in '/var/lib/mysql' ..., 180425 15:01:37 [Note] /usr/libexec/mysqld (mysqld 5.5.56-MariaDB) starting as process 33 ..., OK, Filling help tables..., 180425 15:01:38 [Note] /usr/libexec/mysqld (mysqld 5.5.56-MariaDB) starting as process 40 ..., OK, , To start mysqld at boot time you have to copy, support-files/mysql.server to the right place for your system, , PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !, To do so, start the server, then issue the following commands:, , '/usr/bin/mysqladmin' -u root password 'new-password', '/usr/bin/mysqladmin' -u root -h xxxxxxx password 'new-password', , Alternatively you can run:, '/usr/bin/mysql_secure_installation', , which will also give you the option of removing the test, databases and anonymous user created by default. This is, strongly recommended for production servers., , See the MariaDB Knowledgebase at http://mariadb.com/kb or the, MySQL manual for more instructions., , You can start the MariaDB daemon with:, cd '/usr' ; /usr/bin/mysqld_safe --datadir='/var/lib/mysql', , You can test the MariaDB daemon with mysql-test-run.pl, cd '/usr/mysql-test' ; perl mysql-test-run.pl, , Please report any problems at http://mariadb.org/jira, , The latest information about MariaDB is available at http://mariadb.org/., You can find additional information about the MySQL part at:, http://dev.mysql.com, Consider joining MariaDB's strong and vibrant community:, https://mariadb.org/get-involved/, , Finished mysql_install_db, 180425 15:01:38 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'., 180425 15:01:38 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql,

OTRS: otrs_1 | [INFO] Database server is not available. Waiting 2 seconds... otrs_1 | [INFO] Database server is not available. Waiting 2 seconds... otrs_1 | [INFO] Database server is not available. Waiting 2 seconds... otrs_1 | [INFO] Database server is not available. Waiting 2 seconds...

Docker Compose

services: otrs: image: juanluisbaptiste/otrs:latest build: otrs ports: - '80:80' depends_on: - mariadb env_file: otrs-setup.env volumes: - './volumes/config:/opt/otrs/Kernel' - './otrs/backup:/var/otrs/backups' - '/etc/localtime:/etc/localtime:ro' mariadb: image: juanluisbaptiste/otrs-mariadb:latest build: mariadb expose: - "3306" env_file: otrs-setup.env volumes: - './volumes/mysql:/var/lib/mysql' - '/etc/localtime:/etc/localtime:ro'

otrs-setup.env : OTRS_ROOT_PASSWORD=changeme OTRS_DB_NAME=otrs OTRS_DB_HOST=mariadb OTRS_DB_PORT=3306 OTRS_DB_USER=otrs OTRS_LANGUAGE=fr

Permission : ls -l ./volumes/mysql/ -rw-rw---- 1 27 sudo 16384 avril 25 15:01 aria_log.00000001 -rw-rw---- 1 27 sudo 52 avril 25 15:01 aria_log_control -rw-rw---- 1 27 sudo 18874368 avril 25 15:01 ibdata1 -rw-rw---- 1 27 sudo 268435456 avril 25 15:01 ib_logfile0 -rw-rw---- 1 27 sudo 268435456 avril 25 15:01 ib_logfile1 drwx------ 2 27 sudo 4096 avril 25 15:01 mysql srwxrwxrwx 1 27 sudo 0 avril 25 15:01 mysql.sock drwx------ 2 27 sudo 4096 avril 25 15:01 performance_schema

juanluisbaptiste commented 6 years ago

I don't see MYSQL_ROOT_PASSWORD defined....

kadashy commented 6 years ago

Hi @houstek the MYSQL_ROOT_PASSWORD must be defined in the credentials-smtp.env by example for this file: OTRS_HOSTNAME=vistro OTRS_DB_NAME=otrs OTRS_DB_PORT=3306 OTRS_DB_USER=otrs OTRS_DB_PASSWORD=otrs OTRS_ROOT_PASSWORD=my-secret-pw OTRS_LANGUAGE="es" OTRS_TICKET_COUNTER=0 OTRS_NUMBER_GENERATOR=AutoIncrement MYSQL_ROOT_PASSWORD=mysql-pass

juanluisbaptiste commented 6 years ago

It has nothing to do with the SMTP SERVER env file, you are putting them in the wrong place. Read the README file carefully and it will work.