tobybatch / kimai2

Docker containers for the kimai2 web application including docker-compose and kubernetes/helm deployment.
MIT License
181 stars 96 forks source link

[BUG] 500 Internal Server Error #521

Closed RottenSchnitzel closed 11 months ago

RottenSchnitzel commented 1 year ago

I tried it with docker-compose and it seems to be not working for me. I tried attaching it to the network of the jwilder/nginx-proxy but this doesn't seem to be the issue. It looks like it can't connect to the database for some reason.

Here the docker-compose.yml and the logs:

[+] Building 0.0s (0/0)
[+] Running 4/4
 ✔ Container kimai-postfix-1  Created                                                               0.0s
 ✔ Container kimai-kimai-1    Recreated                                                             0.1s
 ✔ Container kimai-db-1       Created                                                               0.0s
 ✔ Container kimai-nginx-1    Recreated                                                             0.1s
Attaching to kimai-db-1, kimai-kimai-1, kimai-nginx-1, kimai-postfix-1
kimai-db-1       | 2023-06-27 11:03:20+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.34-1debian10 started.
kimai-kimai-1    | ++ cat /opt/kimai/version.txt
kimai-kimai-1    | + KIMAI=2.0.26
kimai-kimai-1    | + echo 2.0.26
kimai-kimai-1    | 2.0.26
kimai-kimai-1    | + config
kimai-kimai-1    | + '[' -z 256M ']'
kimai-kimai-1    | + '[' '!' -z mysql://kimaiuser:kimaipassword@db/kimai ']'
kimai-kimai-1    | ++ awk -F '[/:@]' '{print $1}'
kimai-kimai-1    | + DB_TYPE=mysql
kimai-kimai-1    | ++ awk -F '[/:@]' '{print $4}'
kimai-kimai-1    | + DB_USER=kimaiuser
kimai-kimai-1    | ++ awk -F '[/:@]' '{print $5}'
kimai-kimai-1    | + DB_PASS=kimaipassword
kimai-kimai-1    | ++ awk -F '[/:@]' '{print $6}'
kimai-kimai-1    | + DB_HOST=db
kimai-kimai-1    | ++ awk -F '[/:@]' '{print $7}'
kimai-kimai-1    | + DB_PORT=kimai
kimai-kimai-1    | ++ awk -F '[/?]' '{print $4}'
kimai-kimai-1    | + DB_BASE=kimai
kimai-kimai-1    | + re='^[0-9]+$'
kimai-kimai-1    | + [[ kimai =~ ^[0-9]+$ ]]
kimai-kimai-1    | + DB_PORT=3306
kimai-kimai-1    | + echo 'Wait for MySQL DB connection ...'
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | Wait for MySQL DB connection ...
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-postfix-1  | 2023-06-27 11:03:20,830 CRIT Supervisor running as root (no user in config file)
kimai-postfix-1  | 2023-06-27 11:03:20,831 WARN Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
kimai-postfix-1  | Unlinking stale socket /var/run/supervisor.sock
kimai-postfix-1  | 2023-06-27 11:03:21,148 INFO RPC interface 'supervisor' initialized
kimai-postfix-1  | 2023-06-27 11:03:21,149 CRIT Server 'unix_http_server' running without any HTTP authentication checking
kimai-postfix-1  | 2023-06-27 11:03:21,149 INFO supervisord started with pid 8
kimai-postfix-1  | 2023-06-27 11:03:22,152 INFO spawned: 'postfix' with pid 11
kimai-postfix-1  | 2023-06-27 11:03:22,153 INFO spawned: 'rsyslog' with pid 12
kimai-postfix-1  | 2023-06-27 11:03:23,284 INFO success: postfix entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
kimai-postfix-1  | 2023-06-27 11:03:23,290 INFO success: rsyslog entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-nginx-1    | 192.168.160.5 - - [27/Jun/2023:11:03:41 +0000] "GET /health HTTP/1.1" 200 5 "-" "Wget" "-"
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-db-1       | 2023-06-27 11:03:58+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
kimai-db-1       | 2023-06-27 11:03:58+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.34-1debian10 started.
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-nginx-1    | 192.168.160.5 - - [27/Jun/2023:11:04:01 +0000] "GET /health HTTP/1.1" 200 5 "-" "Wget" "-"
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-nginx-1    | 192.168.160.5 - - [27/Jun/2023:11:04:22 +0000] "GET /health HTTP/1.1" 200 5 "-" "Wget" "-"
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-nginx-1    | 192.168.160.5 - - [27/Jun/2023:11:04:42 +0000] "GET /health HTTP/1.1" 200 5 "-" "Wget" "-"
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | + echo Checking DB: 10
kimai-kimai-1    | + sleep 3
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
kimai-db-1       | 2023-06-27T11:04:56.896553Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
kimai-db-1       | 2023-06-27T11:04:56.898951Z 0 [Note] mysqld (mysqld 5.7.34) starting as process 1 ...
kimai-db-1       | 2023-06-27T11:04:56.902691Z 0 [Note] InnoDB: PUNCH HOLE support available
kimai-db-1       | 2023-06-27T11:04:56.902711Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
kimai-db-1       | 2023-06-27T11:04:56.902713Z 0 [Note] InnoDB: Uses event mutexes
kimai-db-1       | 2023-06-27T11:04:56.902715Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
kimai-db-1       | 2023-06-27T11:04:56.902717Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
kimai-db-1       | 2023-06-27T11:04:56.902718Z 0 [Note] InnoDB: Using Linux native AIO
kimai-db-1       | 2023-06-27T11:04:56.903257Z 0 [Note] InnoDB: Number of pools: 1
kimai-db-1       | 2023-06-27T11:04:56.904202Z 0 [Note] InnoDB: Using CPU crc32 instructions
kimai-db-1       | 2023-06-27T11:04:56.906909Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
kimai-db-1       | 2023-06-27T11:04:56.912683Z 0 [Note] InnoDB: Completed initialization of buffer pool
kimai-db-1       | 2023-06-27T11:04:56.914049Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
kimai-db-1       | 2023-06-27T11:04:56.927652Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
kimai-db-1       | 2023-06-27T11:04:56.929303Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 14012580
kimai-db-1       | 2023-06-27T11:04:56.929309Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 14012589
kimai-db-1       | 2023-06-27T11:04:56.929313Z 0 [Note] InnoDB: Database was not shutdown normally!
kimai-db-1       | 2023-06-27T11:04:56.929315Z 0 [Note] InnoDB: Starting crash recovery.
kimai-db-1       | 2023-06-27T11:04:57.061508Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
kimai-db-1       | 2023-06-27T11:04:57.061525Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
kimai-db-1       | 2023-06-27T11:04:57.061561Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
kimai-db-1       | 2023-06-27T11:04:57.083735Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
kimai-db-1       | 2023-06-27T11:04:57.084428Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
kimai-db-1       | 2023-06-27T11:04:57.084433Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
kimai-db-1       | 2023-06-27T11:04:57.084850Z 0 [Note] InnoDB: Waiting for purge to start
kimai-db-1       | 2023-06-27T11:04:57.135259Z 0 [Note] InnoDB: 5.7.34 started; log sequence number 14012589
kimai-db-1       | 2023-06-27T11:04:57.135595Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
kimai-db-1       | 2023-06-27T11:04:57.135864Z 0 [Note] Plugin 'FEDERATED' is disabled.
kimai-db-1       | 2023-06-27T11:04:57.141687Z 0 [Note] InnoDB: Buffer pool(s) load completed at 230627 11:04:57
kimai-db-1       | 2023-06-27T11:04:57.143973Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
kimai-db-1       | 2023-06-27T11:04:57.143998Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
kimai-db-1       | 2023-06-27T11:04:57.145024Z 0 [Warning] CA certificate ca.pem is self signed.
kimai-db-1       | 2023-06-27T11:04:57.145065Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
kimai-db-1       | 2023-06-27T11:04:57.146500Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
kimai-db-1       | 2023-06-27T11:04:57.146545Z 0 [Note] IPv6 is available.
kimai-db-1       | 2023-06-27T11:04:57.146705Z 0 [Note]   - '::' resolves to '::';
kimai-db-1       | 2023-06-27T11:04:57.146753Z 0 [Note] Server socket created on IP: '::'.
kimai-db-1       | 2023-06-27T11:04:57.150703Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
kimai-db-1       | 2023-06-27T11:04:57.165336Z 0 [Note] Event Scheduler: Loaded 0 events
kimai-db-1       | 2023-06-27T11:04:57.165691Z 0 [Note] mysqld: ready for connections.
kimai-db-1       | Version: '5.7.34'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | + echo 'Connection established'
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*Connection established
kimai-kimai-1    | + handleStartup
kimai-kimai-1    | + sed -i 's/memory_limit.*/memory_limit=256M/g' /usr/local/etc/php/php.ini
kimai-kimai-1    | + '[' 2 -lt 2 ']'
kimai-kimai-1    | + cp /assets/monolog.yaml /opt/kimai/config/packages/monolog.yaml
kimai-kimai-1    | + tar -zx -C /opt/kimai -f /var/tmp/public.tgz
kimai-kimai-1    | + '[' -z '' ']'
kimai-kimai-1    | ++ id -u www-data
kimai-kimai-1    | + USER_ID=82
kimai-kimai-1    | + '[' -z '' ']'
kimai-kimai-1    | ++ id -g www-data
kimai-kimai-1    | + GROUP_ID=82
kimai-kimai-1    | + grep -w 82 /etc/group
kimai-kimai-1    | + echo Group already exists
kimai-kimai-1    | + id 82
kimai-kimai-1    | Group already exists
kimai-kimai-1    | + echo User already exists
kimai-kimai-1    | + '[' -e /use_apache ']'
kimai-kimai-1    | User already exists
kimai-kimai-1    | + '[' -e /use_fpm ']'
kimai-kimai-1    | + sed -i 's/user = .*/user = 82/g' /usr/local/etc/php-fpm.d/www.conf
kimai-kimai-1    | + sed -i 's/group = .*/group = 82/g' /usr/local/etc/php-fpm.d/www.conf
kimai-kimai-1    | + echo 'Setting fpm to run as 82:82'
kimai-kimai-1    | + /service.sh
kimai-kimai-1    | Setting fpm to run as 82:82
kimai-kimai-1    | + waitForDB
kimai-kimai-1    | + '[' '!' -z mysql://kimaiuser:kimaipassword@db/kimai ']'
kimai-kimai-1    | ++ awk -F '[/:@]' '{print $1}'
kimai-kimai-1    | + DB_TYPE=mysql
kimai-kimai-1    | ++ awk -F '[/:@]' '{print $4}'
kimai-kimai-1    | + DB_USER=kimaiuser
kimai-kimai-1    | ++ awk -F '[/:@]' '{print $5}'
kimai-kimai-1    | + DB_PASS=kimaipassword
kimai-kimai-1    | ++ awk -F '[/:@]' '{print $6}'
kimai-kimai-1    | + DB_HOST=db
kimai-kimai-1    | ++ awk -F '[/:@]' '{print $7}'
kimai-kimai-1    | + DB_PORT=kimai
kimai-kimai-1    | ++ awk -F '[/?]' '{print $4}'
kimai-kimai-1    | + DB_BASE=kimai
kimai-kimai-1    | + re='^[0-9]+$'
kimai-kimai-1    | + [[ kimai =~ ^[0-9]+$ ]]
kimai-kimai-1    | + DB_PORT=3306
kimai-kimai-1    | Wait for MySQL DB connection ...
kimai-kimai-1    | + echo 'Wait for MySQL DB connection ...'
kimai-kimai-1    | + php /dbtest.php db kimai 3306 kimaiuser kimaipassword
kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=db;dbname=kimai;port=3306, kimaiuser, kimaipassword, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*Connection established
kimai-kimai-1    | + echo 'Connection established'
kimai-kimai-1    | + handleStartup
kimai-kimai-1    | + /opt/kimai/bin/console -n kimai:install
kimai-kimai-1    | [2023-06-27T11:05:00.036191+00:00] deprecation.INFO: User Deprecated: The "Monolog\Logger" class is considered final. It may change without further notice as of its next major version. You should not extend it from "Symfony\Bridge\Monolog\Logger". {"exception":"[object] (ErrorException(code: 0): User Deprecated: The \"Monolog\\Logger\" class is considered final. It may change without further notice as of its next major version. You should not extend it from \"Symfony\\Bridge\\Monolog\\Logger\". at /opt/kimai/vendor/symfony/error-handler/DebugClassLoader.php:338)"} []
kimai-kimai-1    | [2023-06-27T11:05:00.036191+00:00] deprecation.INFO: User Deprecated: The "Monolog\Logger" class is considered final. It may change without further notice as of its next major version. You should not extend it from "Symfony\Bridge\Monolog\Logger". {"exception":"[object] (ErrorException(code: 0): User Deprecated: The \"Monolog\\Logger\" class is considered final. It may change without further notice as of its next major version. You should not extend it from \"Symfony\\Bridge\\Monolog\\Logger\". at /opt/kimai/vendor/symfony/error-handler/DebugClassLoader.php:338)"} []
kimai-kimai-1    |
kimai-kimai-1    | Kimai installation running ...
kimai-kimai-1    | ==============================
kimai-kimai-1    |
kimai-kimai-1    | [2023-06-27T11:05:00.047408+00:00] doctrine.INFO: Connecting with parameters array{"driver":"pdo_mysql","charset":"utf8mb4","host":"db","port":null,"user":"kimaiuser","password":"<redacted>","driverOptions":[],"serverVersion":null,"defaultTableOptions":{"charset":"utf8mb4","collate":"utf8mb4_unicode_ci"},"dbname":"kimai"} {"params":{"driver":"pdo_mysql","charset":"utf8mb4","host":"db","port":null,"user":"kimaiuser","password":"<redacted>","driverOptions":[],"serverVersion":null,"defaultTableOptions":{"charset":"utf8mb4","collate":"utf8mb4_unicode_ci"},"dbname":"kimai"}} []
kimai-kimai-1    | [2023-06-27T11:05:00.073005+00:00] doctrine.INFO: Connecting with parameters array{"driver":"pdo_mysql","charset":"utf8mb4","host":"db","port":null,"user":"kimaiuser","password":"<redacted>","driverOptions":[],"serverVersion":null,"defaultTableOptions":{"charset":"utf8mb4","collate":"utf8mb4_unicode_ci"}} {"params":{"driver":"pdo_mysql","charset":"utf8mb4","host":"db","port":null,"user":"kimaiuser","password":"<redacted>","driverOptions":[],"serverVersion":null,"defaultTableOptions":{"charset":"utf8mb4","collate":"utf8mb4_unicode_ci"}}} []
kimai-kimai-1    | [2023-06-27T11:05:00.075181+00:00] doctrine.INFO: Disconnecting [] []
kimai-kimai-1    | Database `kimai` for connection named default already exists. Skipped.
kimai-kimai-1    | [notice] Migrating up to DoctrineMigrations\Version20230606125948
kimai-kimai-1    | [error] Migration DoctrineMigrations\Version20190605171157 failed during Execution. Error: "The column "time_budget" on table "kimai2_customers" already exists."
kimai-kimai-1    |  [ERROR] Failed to set migration status: The column "time_budget" on table
kimai-kimai-1    |          "kimai2_customers" already exists.
kimai-kimai-1    |
kimai-kimai-1    | [2023-06-27T11:05:00.144279+00:00] doctrine.INFO: Disconnecting [] []
kimai-kimai-1    | + /opt/kimai/bin/console -n kimai:update
kimai-kimai-1    |
kimai-kimai-1    | Kimai updates running ...
kimai-kimai-1    | =========================
kimai-kimai-1    |
kimai-kimai-1    | [2023-06-27T11:05:00.326380+00:00] doctrine.INFO: Connecting with parameters array{"driver":"pdo_mysql","charset":"utf8mb4","host":"db","port":null,"user":"kimaiuser","password":"<redacted>","driverOptions":[],"serverVersion":null,"defaultTableOptions":{"charset":"utf8mb4","collate":"utf8mb4_unicode_ci"},"dbname":"kimai"} {"params":{"driver":"pdo_mysql","charset":"utf8mb4","host":"db","port":null,"user":"kimaiuser","password":"<redacted>","driverOptions":[],"serverVersion":null,"defaultTableOptions":{"charset":"utf8mb4","collate":"utf8mb4_unicode_ci"},"dbname":"kimai"}} []
kimai-kimai-1    | [notice] Migrating up to DoctrineMigrations\Version20230606125948
kimai-kimai-1    | [error] Migration DoctrineMigrations\Version20190605171157 failed during Execution. Error: "The column "time_budget" on table "kimai2_customers" already exists."
kimai-kimai-1    |  [ERROR] The column "time_budget" on table "kimai2_customers" already exists.
kimai-kimai-1    |
kimai-kimai-1    | [2023-06-27T11:05:00.401572+00:00] doctrine.INFO: Disconnecting [] []
kimai-kimai-1    | + '[' '!' -z 'Bt53qSkz4MW%dkan&YKBBrk9' ']'
kimai-kimai-1    | + '[' '!' -a m.dorighelli@gmail.com ']'
kimai-kimai-1    | + /opt/kimai/bin/console kimai:user:create superadmin m.dorighelli@gmail.com ROLE_SUPER_ADMIN 'Bt53qSkz4MW%dkan&YKBBrk9'
kimai-kimai-1    | [2023-06-27T11:05:00.606833+00:00] doctrine.INFO: Connecting with parameters array{"driver":"pdo_mysql","charset":"utf8mb4","host":"db","port":null,"user":"kimaiuser","password":"<redacted>","driverOptions":[],"serverVersion":null,"defaultTableOptions":{"charset":"utf8mb4","collate":"utf8mb4_unicode_ci"},"dbname":"kimai"} {"params":{"driver":"pdo_mysql","charset":"utf8mb4","host":"db","port":null,"user":"kimaiuser","password":"<redacted>","driverOptions":[],"serverVersion":null,"defaultTableOptions":{"charset":"utf8mb4","collate":"utf8mb4_unicode_ci"},"dbname":"kimai"}} []
kimai-kimai-1    | [2023-06-27T11:05:00.716822+00:00] console.CRITICAL: Error thrown while running command "kimai:user:create superadmin 'm.dorighelli@gmail.com' ROLE_SUPER_ADMIN 'Bt53qSkz4MW%dkan&YKBBrk9'". Message: "An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.auth' in 'field list'" {"exception":"[object] (Doctrine\\DBAL\\Exception\\InvalidFieldNameException(code: 1054): An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.auth' in 'field list' at /opt/kimai/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:67)\n[previous exception] [object] (Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 1054): SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.auth' in 'field list' at /opt/kimai/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28)\n[previous exception] [object] (PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.auth' in 'field list' at /opt/kimai/vendor/doctrine/dbal/src/Driver/PDO/Statement.php:121)","command":"kimai:user:create superadmin 'm.dorighelli@gmail.com' ROLE_SUPER_ADMIN 'Bt53qSkz4MW%dkan&YKBBrk9'","message":"An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.auth' in 'field list'"} []
kimai-kimai-1    |
kimai-kimai-1    | In ExceptionConverter.php line 67:
kimai-kimai-1    |
kimai-kimai-1    |   An exception occurred while executing a query: SQLSTATE[42S22]: Column not
kimai-kimai-1    |   found: 1054 Unknown column 't0.auth' in 'field list'
kimai-kimai-1    |
kimai-kimai-1    |
kimai-kimai-1    | In Exception.php line 28:
kimai-kimai-1    |
kimai-kimai-1    |   SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.auth' in 'field
kimai-kimai-1    |   list'
kimai-kimai-1    |
kimai-kimai-1    |
kimai-kimai-1    | In Statement.php line 121:
kimai-kimai-1    |
kimai-kimai-1    |   SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.auth' in 'field
kimai-kimai-1    |   list'
kimai-kimai-1    |
kimai-kimai-1    |
kimai-kimai-1    | kimai:user:create <username> <email> [<role> [<password>]]
kimai-kimai-1    |
kimai-kimai-1    | [2023-06-27T11:05:00.721574+00:00] doctrine.INFO: Disconnecting [] []
kimai-kimai-1    | + echo 2.0.26
kimai-kimai-1    | + echo 'Kimai2 ready'
kimai-kimai-1    | + runServer
kimai-kimai-1    | Kimai2 ready
kimai-kimai-1    | + /opt/kimai/bin/console kimai:reload --env=dev
kimai-kimai-1    |
kimai-kimai-1    | Reloading configurations ...
kimai-kimai-1    | ============================
kimai-kimai-1    |
kimai-kimai-1    |
kimai-kimai-1    |  [OK] All 25 YAML files contain valid syntax.
kimai-kimai-1    |
kimai-kimai-1    |
kimai-nginx-1    | 192.168.160.5 - - [27/Jun/2023:11:05:02 +0000] "GET /health HTTP/1.1" 200 5 "-" "Wget" "-"
kimai-kimai-1    |
kimai-kimai-1    |  [OK] All 578 XLIFF files contain valid syntax.
kimai-kimai-1    |
kimai-kimai-1    |
kimai-kimai-1    |  Rebuilding your cache, please be patient ...
kimai-kimai-1    |
kimai-kimai-1    |  // Clearing the cache for the dev environment with debug true
kimai-kimai-1    |
kimai-db-1 exited with code 0
kimai-kimai-1    | [2023-06-27T11:05:22.498955+00:00] doctrine.INFO: Connecting with parameters array{"driver":"pdo_mysql","charset":"utf8mb4","host":"db","port":null,"user":"kimaiuser","password":"<redacted>","driverOptions":[],"serverVersion":null,"defaultTableOptions":{"charset":"utf8mb4","collate":"utf8mb4_unicode_ci"},"dbname":"kimai"} {"params":{"driver":"pdo_mysql","charset":"utf8mb4","host":"db","port":null,"user":"kimaiuser","password":"<redacted>","driverOptions":[],"serverVersion":null,"defaultTableOptions":{"charset":"utf8mb4","collate":"utf8mb4_unicode_ci"},"dbname":"kimai"}} []
kimai-kimai-1    | [2023-06-27T11:05:22.517364+00:00] doctrine.INFO: Connecting with parameters array{"driver":"pdo_mysql","charset":"utf8mb4","host":"db","port":null,"user":"kimaiuser","password":"<redacted>","driverOptions":[],"serverVersion":null,"defaultTableOptions":{"charset":"utf8mb4","collate":"utf8mb4_unicode_ci"}} {"params":{"driver":"pdo_mysql","charset":"utf8mb4","host":"db","port":null,"user":"kimaiuser","password":"<redacted>","driverOptions":[],"serverVersion":null,"defaultTableOptions":{"charset":"utf8mb4","collate":"utf8mb4_unicode_ci"}}} []
kimai-kimai-1    |
kimai-kimai-1    |  [ERROR] An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection
kimai-kimai-1    |          refused
kimai-kimai-1    |
kimai-kimai-1    |  [WARNING] Cache could not be rebuilt.
kimai-kimai-1    |
kimai-kimai-1    |            Please run these commands to rebuild the cache manually:
kimai-kimai-1    |
kimai-kimai-1    |            rm -r var/cache/*
kimai-kimai-1    |            bin/console cache:clear --env=dev
kimai-kimai-1    |            bin/console cache:warmup --env=dev
kimai-kimai-1    |
kimai-kimai-1    | + chown -R 82:82 /opt/kimai/var
kimai-kimai-1    | + '[' -e /use_apache ']'
kimai-kimai-1    | + '[' -e /use_fpm ']'
kimai-kimai-1    | + exec php-fpm
kimai-nginx-1    | 192.168.160.5 - - [27/Jun/2023:11:05:22 +0000] "GET /health HTTP/1.1" 200 5 "-" "Wget" "-"
kimai-kimai-1    | [27-Jun-2023 12:05:22] NOTICE: fpm is running, pid 117
kimai-kimai-1    | [27-Jun-2023 12:05:22] NOTICE: ready to handle connections
kimai-nginx-1    | 192.168.160.5 - - [27/Jun/2023:11:05:43 +0000] "GET /health HTTP/1.1" 200 5 "-" "Wget" "-"
kimai-kimai-1    | 127.0.0.1 -  27/Jun/2023:12:05:43 +0100 "GET /ping" 404
kimai-db-1       | 2023-06-27 11:05:54+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
kimai-db-1       | 2023-06-27 11:05:54+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.34-1debian10 started.

docker-compose.yml:

version: '3.5'
services:
  db:
    image: mysql:5.7
    environment:
      - MYSQL_DATABASE=kimai
      - MYSQL_USER=kimaiuser
      - MYSQL_PASSWORD=kimaipassword
      - MYSQL_ROOT_PASSWORD=changemeplease
    volumes:
      - mysql:/var/lib/mysql
    command: --default-storage-engine innodb
    restart: unless-stopped
    healthcheck:
      test: mysqladmin -p$$MYSQL_ROOT_PASSWORD ping -h localhost
      interval: 20s
      start_period: 10s
      timeout: 10s
      retries: 3
    networks:
      - kimai

  nginx:
    image: tobybatch/nginx-fpm-reverse-proxy
    volumes:
      - public:/opt/kimai/public:ro
    restart: unless-stopped
    environment:
      LETSENCRYPT_HOST: time.my.domain
      LETSENCRYPT_EMAIL: my@email.com
      VIRTUAL_HOST: time.my.domain
    depends_on:
      - kimai
    healthcheck:
      test:  wget --spider http://nginx/health || exit 1
      interval: 20s
      start_period: 10s
      timeout: 10s
      retries: 3
    networks:
      - nginx-proxy
      - kimai

  kimai: # This is the latest FPM image of kimai
    image: kimai/kimai2:fpm
    environment:
      - ADMINMAIL=my@email.com
      - ADMINPASS=Bt53qSkz4MW%dkan&YKBBrk9
      - DATABASE_URL=mysql://kimaiuser:kimaipassword@db/kimai
      - TRUSTED_HOSTS=time.my.domain,nginx,localhost,127.0.0.1
    volumes:
      - public:/opt/kimai/public
      # - var:/opt/kimai/var
      # - ./ldap.conf:/etc/openldap/ldap.conf:z
      # - ./ROOT-CA.pem:/etc/ssl/certs/ROOT-CA.pem:z
    restart: unless-stopped
    networks:
      - kimai

  postfix:
    image: catatnight/postfix:latest
    environment:
      maildomain: my.domain
      smtp_user: kimai:kimai
    restart: unless-stopped
    networks:
      - kimai

volumes:
    var:
    public:
    mysql:

networks:
  kimai:
    name: kimai
    driver: bridge

  nginx-proxy:
    name: nginx-proxy
    external: false
JayJohnsen commented 1 year ago

@RottenSchnitzel could you solve your error 500 problem? i had a error 500 after updating from Kimai 2.0.26 to 2.0.27/2.0.28. i could easily solve the problem. I had not set the memory_limit in the docker-compose.yaml. After setting ' - memory_limit=500M' in the compose file, e.g. by @tobybatch in his example compose file, everything works as it should. Good Luck or Viel Glück

tobybatch commented 1 year ago

The memory limits should be fixed in the latest images.