linuxserver / docker-kimai

GNU General Public License v3.0
15 stars 3 forks source link

[BUG] Kimai fails to start due to bad argument call #4

Closed Elbullazul closed 1 year ago

Elbullazul commented 1 year ago

Is there an existing issue for this?

Current Behavior

The container cannot start the web service, as it errors out when starting with the following error message:

ContainerOhKxVGM\App_KernelProdContainer::__construct(): Argument #1 ($buil  
  dParameters) must be of type array, Doctrine\DBAL\Connection given, called   
  in /config/www/var/cache/prod/ContainerOhKxVGM/App_KernelProdContainer.php   
  on line 265 

Expected Behavior

The previous release (v2.0.34) didn't have trouble starting, the new version should also start the web service.

Steps To Reproduce

Pull the latest kimai image (2.0.35) and start the container, it doesn't start the web service and errors out.

Environment

- OS: Debian 12 (Bookworm)
- How docker service was installed: docker-compose

CPU architecture

x86-64

Docker creation

version: "2.1"

services:
  kimai:
    image: lscr.io/linuxserver/kimai:latest
    container_name: kimai
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=$TIMEZONE
      - DATABASE_URL=mysql://${DB_USER}:${DB_PASS}@kimai-db:3306/${DB_NAME}?charset=utf8&serverVersion=$DB_VER
    volumes:
      - ${BINDS}/kimai/config:/config
    restart: unless-stopped
    depends_on:
      - kimai-db

  kimai-db:
    image: lscr.io/linuxserver/mariadb:latest
    container_name: kimai-db
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=$TIMEZONE
      - MYSQL_ROOT_PASSWORD=$ROOT_PASSWORD
      - MYSQL_DATABASE=$DB_NAME
      - MYSQL_USER=$DB_USER
      - MYSQL_PASSWORD=$DB_PASS
    volumes:
      - ${BINDS}/kimai/mariadb:/config
    restart: unless-stopped

Container logs

[migrations] started
[migrations] 01-nginx-site-confs-default: skipped
[migrations] done
───────────────────────────────────────
      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 
   Brought to you by linuxserver.io
───────────────────────────────────────
To support the app dev(s) visit:
Kimai: https://www.kimai.org/donate/
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID:    1000
User GID:    1000
───────────────────────────────────────
using keys found in /config/keys
Waiting for DB to be available
Kimai installation running ...
==============================
Database `kmdb` for connection named default already exists. Skipped.
20:22:06 CRITICAL  [console] Error thrown while running command "kimai:install -n". Message: "ContainerOhKxVGM\App_KernelProdContainer::__construct(): Argument #1 ($buildParameters) must be of type array, Doctrine\DBAL\Connection given, called in /config/www/var/cache/prod/ContainerOhKxVGM/App_KernelProdContainer.php on line 265" ["exception" => TypeError { …},"command" => "kimai:install -n","message" => "ContainerOhKxVGM\App_KernelProdContainer::__construct(): Argument #1 ($buildParameters) must be of type array, Doctrine\DBAL\Connection given, called in /config/www/var/cache/prod/ContainerOhKxVGM/App_KernelProdContainer.php on line 265"]
In App_KernelProdContainer.php line 25:

  ContainerOhKxVGM\App_KernelProdContainer::__construct(): Argument #1 ($buil  
  dParameters) must be of type array, Doctrine\DBAL\Connection given, called   
  in /config/www/var/cache/prod/ContainerOhKxVGM/App_KernelProdContainer.php   
  on line 265                                                                  

kimai:install [--no-cache]
Kimai updates running ...
=========================
20:22:06 CRITICAL  [console] Error thrown while running command "kimai:update -n". Message: "ContainerOhKxVGM\App_KernelProdContainer::__construct(): Argument #1 ($buildParameters) must be of type array, Doctrine\DBAL\Connection given, called in /config/www/var/cache/prod/ContainerOhKxVGM/App_KernelProdContainer.php on line 265" ["exception" => TypeError { …},"command" => "kimai:update -n","message" => "ContainerOhKxVGM\App_KernelProdContainer::__construct(): Argument #1 ($buildParameters) must be of type array, Doctrine\DBAL\Connection given, called in /config/www/var/cache/prod/ContainerOhKxVGM/App_KernelProdContainer.php on line 265"]
In App_KernelProdContainer.php line 25:

  ContainerOhKxVGM\App_KernelProdContainer::__construct(): Argument #1 ($buil  
  dParameters) must be of type array, Doctrine\DBAL\Connection given, called   
  in /config/www/var/cache/prod/ContainerOhKxVGM/App_KernelProdContainer.php   
  on line 265                                                                  


github-actions[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

Elbullazul commented 1 year ago

could maybe be related to the upgrade to Symfony 6.3?

https://github.com/kimai/kimai/releases/tag/2.0.35

nemchik commented 1 year ago

https://github.com/kimai/kimai/discussions/4320 Seems like a cache issue. Can you try deleting /config/www/var/cache and restarting the container? If this works we may need to build something into the container to delete the cache on startup, or to exclude the cache from the user config and just keep it in the container (which would mean it gets recreated when the container gets recreated)

Elbullazul commented 1 year ago

Clearing the cache fixed the issue, thanks a lot!