Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker compose option seems to be not working #183

Open
zhum opened this issue Feb 1, 2023 · 7 comments
Open

Docker compose option seems to be not working #183

zhum opened this issue Feb 1, 2023 · 7 comments

Comments

@zhum
Copy link

zhum commented Feb 1, 2023

I've just cloned the project, executed sudo docker-compose up and (after successful start) pointed my browser to the http://localhost. I get a message about not completed installation, then I go to the installer (I should note, there is missing the GD module, so the mos important part - Gant diagram is unavailable, how fix it?). After pressing "install db & write cfg" I get an error about no Mysql connection and failing to write the config. If I create the config manually (just copy "-dist{ one), then I get an error:

Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /var/www/html/lib/adodb/drivers/adodb-mysqli.inc.php on line 124
FATAL ERROR: Connection to database server failed

I use Ubuntu 22.04.1
docker-compose version 1.29.2, build unknown
docker-py version: 5.0.3
CPython version: 3.10.6
OpenSSL version: OpenSSL 3.0.2 15 Mar 2022

@vdufloth
Copy link

I am having the same issue with this on the devel branch.

The check brings two errors:

  • LDAP Support not enabled (could not find how to enable it, installed openldap in the host machine restarted the images but nothing changed)
  • GD Support (for GANTT Charts) not enabled (tried installing gd on host machine but didn't work)

It shows that could not create the database, and then on the index page shows:

Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /var/www/html/lib/adodb/drivers/adodb-mysqli.inc.php on line 124
FATAL ERROR: Connection to database server failed

Result of docker-compose logs:

dotproject-nginx-1  | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
dotproject-nginx-1  | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
dotproject-nginx-1  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
dotproject-nginx-1    | 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
dotproject-nginx-1    | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
dotproject-nginx-1    | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
dotproject-nginx-1    | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
dotproject-nginx-1    | /docker-entrypoint.sh: Configuration complete; ready for start up
dotproject-nginx-1    | 2023/03/20 00:40:25 [notice] 1#1: using the "epoll" event method
dotproject-nginx-1    | 2023/03/20 00:40:25 [notice] 1#1: nginx/1.23.3
dotproject-nginx-1    | 2023/03/20 00:40:25 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6) 
dotproject-nginx-1    | 2023/03/20 00:40:25 [notice] 1#1: OS: Linux 5.15.90.1-microsoft-standard-WSL2
dotproject-nginx-1    | 2023/03/20 00:40:25 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1073741816:1073741816
dotproject-nginx-1    | 2023/03/20 00:40:25 [notice] 1#1: start worker processes
dotproject-nginx-1    | 2023/03/20 00:40:25 [notice] 1#1: start worker process 28
dotproject-nginx-1    | 2023/03/20 00:40:25 [notice] 1#1: start worker process 29
dotproject-nginx-1    | 2023/03/20 00:40:25 [notice] 1#1: start worker process 30
dotproject-nginx-1    | 2023/03/20 00:40:25 [notice] 1#1: start worker process 31
dotproject-nginx-1    | 2023/03/20 00:40:25 [notice] 1#1: start worker process 32
dotproject-nginx-1    | 2023/03/20 00:40:25 [notice] 1#1: start worker process 33
dotproject-nginx-1    | 2023/03/20 00:40:25 [notice] 1#1: start worker process 34
dotproject-nginx-1    | 2023/03/20 00:40:25 [notice] 1#1: start worker process 35
dotproject-nginx-1    | 2023/03/20 00:40:25 [notice] 1#1: start worker process 36
dotproject-nginx-1    | 2023/03/20 00:40:25 [notice] 1#1: start worker process 37
dotproject-nginx-1    | 2023/03/20 00:40:25 [notice] 1#1: start worker process 38
dotproject-nginx-1    | 2023/03/20 00:40:25 [notice] 1#1: start worker process 39
dotproject-nginx-1    | 2023/03/20 00:42:39 [error] 28#28: *1 FastCGI sent in stderr: "PHP message: PHP Notice:  Undefined variable: baseDir in /var/www/html/includes/config.php on line 18PHP message: PHP Notice:  Undefined variable: baseUrl in /var/www/html/includes/config.php on line 19PHP message: DB Upgrade Check: Failed to connect to databasePHP message: PHP Warning:  mysqli_real_connect(): (HY000/2002): No such file or directory in /var/www/html/lib/adodb/drivers/adodb-mysqli.inc.php on line 124" while reading response header from upstream, client: 172.23.0.1, server: , request: "POST /install/do_install_db.php HTTP/1.1", upstream: "fastcgi://172.23.0.3:9000", host: "localhost", referrer: "http://localhost/install/db.php"
dotproject-nginx-1    | 172.23.0.1 - - [20/Mar/2023:00:42:39 +0000] "POST /install/do_install_db.php HTTP/1.1" 200 1579 "http://localhost/install/db.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0" "-"
dotproject-nginx-1    | 2023/03/20 00:42:39 [error] 28#28: *1 open() "/var/www/html/favicon.ico" failed (2: No such file or directory), client: 172.23.0.1, server: , request: "GET /favicon.ico HTTP/1.1", host: "localhost", referrer: "http://localhost/install/do_install_db.php"
dotproject-nginx-1    | 2023/03/20 00:42:49 [error] 29#29: *3 FastCGI sent in stderr: "PHP message: PHP Warning:  mysqli_real_connect(): (HY000/2002): No such file or directory in /var/www/html/lib/adodb/drivers/adodb-mysqli.inc.php on line 124" while reading response header from upstream, client: 172.23.0.1, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://172.23.0.3:9000", host: "localhost"
dotproject-nginx-1    | 172.23.0.1 - - [20/Mar/2023:00:42:49 +0000] "GET / HTTP/1.1" 200 235 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0" "-"
dotproject-nginx-1    | 2023/03/20 00:42:49 [error] 29#29: *3 open() "/var/www/html/favicon.ico" failed (2: No such file or directory), client: 172.23.0.1, server: , request: "GET /favicon.ico HTTP/1.1", host: "localhost", referrer: "http://localhost/"
dotproject-nginx-1    | 2023/03/20 00:42:53 [error] 30#30: *5 FastCGI sent in stderr: "PHP message: PHP Warning:  mysqli_real_connect(): (HY000/2002): No such file or directory in /var/www/html/lib/adodb/drivers/adodb-mysqli.inc.php on line 124" while reading response header from upstream, client: 172.23.0.1, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://172.23.0.3:9000", host: "localhost"
dotproject-nginx-1    | 172.23.0.1 - - [20/Mar/2023:00:42:53 +0000] "GET / HTTP/1.1" 200 235 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0" "-"
dotproject-phpfpm-1   | [20-Mar-2023 00:40:24] NOTICE: fpm is running, pid 1
dotproject-phpfpm-1   | [20-Mar-2023 00:40:24] NOTICE: ready to handle connections
dotproject-phpfpm-1   | [20-Mar-2023 00:40:24] NOTICE: systemd monitor interval set to 10000ms
dotproject-phpfpm-1   | NOTICE: PHP message: PHP Notice:  Undefined variable: baseDir in /var/www/html/includes/config.php on line 18
dotproject-mariadb-1  | 2023-03-20 00:40:24+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.11.2+maria~ubu2204 started.
dotproject-phpfpm-1   | NOTICE: PHP message: PHP Notice:  Undefined variable: baseUrl in /var/www/html/includes/config.php on line 19
dotproject-phpfpm-1   | NOTICE: PHP message: DB Upgrade Check: Failed to connect to database
dotproject-phpfpm-1   | NOTICE: PHP message: PHP Warning:  mysqli_real_connect(): (HY000/2002): No such file or directory in /var/www/html/lib/adodb/drivers/adodb-mysqli.inc.php on line 124
dotproject-phpfpm-1   | 172.23.0.4 -  20/Mar/2023:00:42:39 +0000 "POST /install/do_install_db.php" 200
dotproject-phpfpm-1   | NOTICE: PHP message: PHP Warning:  mysqli_real_connect(): (HY000/2002): No such file or directory in /var/www/html/lib/adodb/drivers/adodb-mysqli.inc.php on line 124
dotproject-phpfpm-1   | 172.23.0.4 -  20/Mar/2023:00:42:49 +0000 "GET /index.php" 200
dotproject-phpfpm-1   | NOTICE: PHP message: PHP Warning:  mysqli_real_connect(): (HY000/2002): No such file or directory in /var/www/html/lib/adodb/drivers/adodb-mysqli.inc.php on line 124
dotproject-phpfpm-1   | 172.23.0.4 -  20/Mar/2023:00:42:53 +0000 "GET /index.php" 200
dotproject-mariadb-1  | 2023-03-20 00:40:24+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
dotproject-mariadb-1  | 2023-03-20 00:40:24+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.11.2+maria~ubu2204 started.
dotproject-mariadb-1  | 2023-03-20 00:40:24+00:00 [Note] [Entrypoint]: Initializing database files
dotproject-mariadb-1  | 
dotproject-mariadb-1  | 
dotproject-mariadb-1  | PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
dotproject-mariadb-1  | To do so, start the server, then issue the following command:
dotproject-mariadb-1  | 
dotproject-mariadb-1  | '/usr/bin/mariadb-secure-installation'
dotproject-mariadb-1  | 
dotproject-mariadb-1  | which will also give you the option of removing the test
dotproject-mariadb-1  | databases and anonymous user created by default.  This is
dotproject-mariadb-1  | strongly recommended for production servers.
dotproject-mariadb-1  | 
dotproject-mariadb-1  | See the MariaDB Knowledgebase at https://mariadb.com/kb
dotproject-mariadb-1  | 
dotproject-mariadb-1  | Please report any problems at https://mariadb.org/jira
dotproject-mariadb-1  | 
dotproject-mariadb-1  | The latest information about MariaDB is available at https://mariadb.org/.
dotproject-mariadb-1  | 
dotproject-mariadb-1  | Consider joining MariaDB's strong and vibrant community:
dotproject-mariadb-1  | https://mariadb.org/get-involved/
dotproject-mariadb-1  | 
dotproject-mariadb-1  | 2023-03-20 00:40:28+00:00 [Note] [Entrypoint]: Database files initialized
dotproject-mariadb-1  | 2023-03-20 00:40:28+00:00 [Note] [Entrypoint]: Starting temporary server
dotproject-mariadb-1  | 2023-03-20 00:40:28+00:00 [Note] [Entrypoint]: Waiting for server startup
dotproject-mariadb-1  | 2023-03-20  0:40:28 0 [Note] Starting MariaDB 10.11.2-MariaDB-1:10.11.2+maria~ubu2204 source revision cafba8761af55ae16cc69c9b53a341340a845b36 as process 111
dotproject-mariadb-1  | 2023-03-20  0:40:28 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
dotproject-mariadb-1  | 2023-03-20  0:40:28 0 [Note] InnoDB: Number of transaction pools: 1
dotproject-mariadb-1  | 2023-03-20  0:40:28 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
dotproject-mariadb-1  | 2023-03-20  0:40:28 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
dotproject-mariadb-1  | 2023-03-20  0:40:28 0 [Note] InnoDB: Using liburing
dotproject-mariadb-1  | 2023-03-20  0:40:28 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
dotproject-mariadb-1  | 2023-03-20  0:40:28 0 [Note] InnoDB: Completed initialization of buffer pool
dotproject-mariadb-1  | 2023-03-20  0:40:28 0 [Note] InnoDB: File system buffers for log disabled (block size=4096 bytes)
dotproject-mariadb-1  | 2023-03-20  0:40:28 0 [Note] InnoDB: 128 rollback segments are active.
dotproject-mariadb-1  | 2023-03-20  0:40:28 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
dotproject-mariadb-1  | 2023-03-20  0:40:28 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
dotproject-mariadb-1  | 2023-03-20  0:40:28 0 [Note] InnoDB: log sequence number 46560; transaction id 14
dotproject-mariadb-1  | 2023-03-20  0:40:28 0 [Note] Plugin 'FEEDBACK' is disabled.
dotproject-mariadb-1  | 2023-03-20  0:40:28 0 [Warning] 'user' entry 'root@1307bbd1830b' ignored in --skip-name-resolve mode.
dotproject-mariadb-1  | 2023-03-20  0:40:28 0 [Warning] 'proxies_priv' entry '@% root@1307bbd1830b' ignored in --skip-name-resolve mode.
dotproject-mariadb-1  | 2023-03-20  0:40:28 0 [Note] mariadbd: ready for connections.
dotproject-mariadb-1  | Version: '10.11.2-MariaDB-1:10.11.2+maria~ubu2204'  socket: '/run/mysqld/mysqld.sock'  port: 0  mariadb.org binary distribution
dotproject-mariadb-1  | 2023-03-20 00:40:29+00:00 [Note] [Entrypoint]: Temporary server started.
dotproject-mariadb-1  | 2023-03-20 00:40:31+00:00 [Note] [Entrypoint]: Creating database dotproject
dotproject-mariadb-1  | 2023-03-20 00:40:31+00:00 [Note] [Entrypoint]: Creating user dotproject
dotproject-mariadb-1  | 2023-03-20 00:40:31+00:00 [Note] [Entrypoint]: Giving user dotproject access to schema dotproject
dotproject-mariadb-1  | 2023-03-20 00:40:31+00:00 [Note] [Entrypoint]: Securing system users (equivalent to running mysql_secure_installation)
dotproject-mariadb-1  | 
dotproject-mariadb-1  | 2023-03-20 00:40:31+00:00 [Note] [Entrypoint]: Stopping temporary server
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] mariadbd (initiated by: unknown): Normal shutdown
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] InnoDB: FTS optimize thread exiting.
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] InnoDB: Starting shutdown...
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] InnoDB: Buffer pool(s) dump completed at 230320  0:40:31
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] InnoDB: Shutdown completed; log sequence number 46560; transaction id 15
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] mariadbd: Shutdown complete
dotproject-mariadb-1  | 
dotproject-mariadb-1  | 2023-03-20 00:40:31+00:00 [Note] [Entrypoint]: Temporary server stopped
dotproject-mariadb-1  | 
dotproject-mariadb-1  | 2023-03-20 00:40:31+00:00 [Note] [Entrypoint]: MariaDB init process done. Ready for start up.
dotproject-mariadb-1  | 
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] Starting MariaDB 10.11.2-MariaDB-1:10.11.2+maria~ubu2204 source revision cafba8761af55ae16cc69c9b53a341340a845b36 as process 1
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] InnoDB: Number of transaction pools: 1
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] InnoDB: Using liburing
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] InnoDB: Completed initialization of buffer pool
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] InnoDB: File system buffers for log disabled (block size=4096 bytes)
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] InnoDB: 128 rollback segments are active.
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] InnoDB: log sequence number 46560; transaction id 14
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] Plugin 'FEEDBACK' is disabled.
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] Server socket created on IP: '0.0.0.0'.
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] InnoDB: Buffer pool(s) load completed at 230320  0:40:31
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] Server socket created on IP: '::'.
dotproject-mariadb-1  | 2023-03-20  0:40:31 0 [Note] mariadbd: ready for connections.
dotproject-mariadb-1  | Version: '10.11.2-MariaDB-1:10.11.2+maria~ubu2204'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution

Running on Arch Linux on WSL2 (I bealive it's not relevant, but just in case)

@SaturnusDJ
Copy link

I have no experience with docker compose, but got it working. It is not complex but there are some differences compared to normal configuration of applications, so don't take assumptions.

docker-compose.yaml.
Set vars.

      MYSQL_ROOT_PASSWORD: secretpw1234
      MYSQL_USER: dotproject
      MYSQL_PASSWORD: pass12345
      MYSQL_DATABASE: dotproject

docker-compose up

Do not create an empty config.php file, it will give an error. Go to the web address.

Fatal Error. You haven't created a config file yet.
[Click Here To Start Installation and Create One!](http://10.61.53.193:8008/install/index.php) (forwarded in 5 sec.)

Some errors indeed on the next screen. Moving on.
image
Database Host Name is the name of the database service from the yaml file.
Database Name is MYSQL_DATABASE.
Database Table Prefix ... I leave this empty.
Database User Name is MYSQL_USER.
Database User Password is MYSQL_PASSWORD.

Do not proceed but create the config file with correct permissions.

touch includes/config.php
chmod go-rwx includes/config.php
chown 33:33 includes/config.php

Now complete the installation.
image

Notes:

  • All above commands relative to the project root.
  • If you decide to restart, delete includes/config.php, because with that file present there is always an error, no matter what permissions are set.
  • An alternative is to apply the permissions before starting but I do not know the implications of this. For sure is that they cannot be applied on the project root, that results in 403 Forbidden. Maybe applying them to ./includes is safe.

Gonna look at GD Support now.

@SaturnusDJ
Copy link

Fix GD:

First thing after docker-compose up:

docker exec -ti dotproject-devel_phpfpm_1 apt-get install php7.4-gd -y
docker restart dotproject-devel_phpfpm_1
docker restart dotproject-devel_nginx_1

(Paste them in per block.)

'Files' folder permissions can also be fixed with:
chown -R 33:33 ./files

@vdufloth

This comment was marked as resolved.

@vdufloth

This comment was marked as resolved.

@SaturnusDJ
Copy link

@vdufloth
Did you try mariadb for Database Host Name? As in my screenshot.

@vdufloth
Copy link

Changed and that solved it. Didn't pay attention to that indeed. Thanks!

If it is intended to have this docker setup on the master branch it would be very helpfull to have this steps on the readme, or solved by docker-compose commands. But for me it's all setup now on docker, thanks again @SaturnusDJ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants