socioboard / Socioboard-5.0

Socioboard is world's first and open source Social Technology Enabler. Socioboard Core is our flagship product.

Home Page:http://www.socioboard.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker Setup fails

krishnakanthpps opened this issue · comments

I am getting this error and MySQL is not starting.

Running on Amazon Linux EC2 instance.

docker logs socioboard
Waiting for MySQL database to be ready
PHP Warning: mysqli_connect(): (HY000/2002): Connection refused in /sql-ping.php on line 2
Waiting for MySQL database to be ready
PHP Warning: mysqli_connect(): php_network_getaddresses: getaddrinfo failed: Name does not resolve in /sql-ping.php on line 2
PHP Warning: mysqli_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name does not resolve in /sql-ping.php on line 2
Waiting for MySQL database to be ready

docker logs socioboard-mysql
2022-07-08 08:10:05+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1.el8 started.
2022-07-08 08:10:05+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-07-08 08:10:05+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1.el8 started.
2022-07-08 08:10:05+00:00 [ERROR] [Entrypoint]: Database is uninitialized and password option is not specified
You need to specify one of the following:
- MYSQL_ROOT_PASSWORD
- MYSQL_ALLOW_EMPTY_PASSWORD
- MYSQL_RANDOM_ROOT_PASSWORD

Do we need the MYSQL_ROOT_PASSWORD in the .env file? or in the entrypoint.sh file?

@krishnakanthpps in the .env file yes. Root password and all other database details are required. Is this error after setting root password in .env?

The .env files has the root password. But I don't see it being utilized anywhere in the other files. I am kind of new to Docker so didnt change much tweaking.

The error does come despite the root password existing in the .env file.

SQL_DB_NAME="scbsql"
SQL_DB_USER="scbadmin"
SQL_DB_PASS="sqlpass"
SQL_DB_ROOT_PASS="sqlrootpass"

@krishnakanthpps The root password is required for the database(root user is required). However the socioboard container does not need to connect using this password, it connects using the user specified. By any chance did you try to set it up with no root password at first? Try deleting the db volumes( should be default_scb-mysql and default_scb-mongo and setting up from scratch.

@krishnakanthpps Also, if your password contains a $ try adding another $ to make $$. the $ could need to be escaped.

This got fixed.