socioboard / Socioboard-5.0

Socioboard is world's first and open source Social Technology Enabler. Socioboard Core is our flagship product.
http://www.socioboard.org
Other
1.07k stars 353 forks source link

Docker Setup fails #381

Closed krishnakanthpps closed 1 year ago

krishnakanthpps commented 2 years ago

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?

vaughngx4 commented 2 years ago

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

krishnakanthpps commented 2 years ago

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"

vaughngx4 commented 2 years ago

@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.

vaughngx4 commented 2 years ago

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

krishnakanthpps commented 1 year ago

This got fixed.