tobybatch / kimai2

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

Kimai Docker ImportBundle PasswordHasher error #459

Closed sinethra closed 1 year ago

sinethra commented 1 year ago

Describe the bug Hi I have spun up a kimai instance on docker using this docker-compose file (https://github.com/tobybatch/kimai2/blob/main/compose/docker-compose.fpm.prod.yml).

I have copied the ImportBundle plugin https://github.com/kevinpapst/ImportBundle to the plugins directory and when I run "bin/console kimai:reload --env=prod" i get the below error

Cannot autowire service "KimaiPlugin\ImportBundle\Command\KimaiImporterCommand": argument "$passwordHasher" of method ___construct()" has type "Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface" but this class was not found.

I think the latest kimai FPM image is not really V2, cuz the about page says the version is 1.30.5

This could be the reason why i get the above error when trying to install ImportBundle 2.0

To Reproduce Steps to reproduce the behaviour:

  1. Start the containers 'https://github.com/tobybatch/kimai2/blob/main/compose/docker-compose.fpm.prod.yml'
  2. Copy 'https://github.com/kevinpapst/ImportBundle.git' to the plugins directory
  3. cd /opt/kimai
  4. bin/console kimai:reload --env=prod

Desktop (please complete the following information):

Docker compose file (with passwords redacted)

services:

  sqldb:
    image: mysql:5.7
    environment:
      - MYSQL_DATABASE=kimai
      - MYSQL_USER=kimaiuser
      - MYSQL_PASSWORD=kimaipassword
      - MYSQL_ROOT_PASSWORD=changemeplease
    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

  nginx:
    image: tobybatch/nginx-fpm-reverse-proxy
    ports:
      - 8001:80
    volumes:
      - public:/opt/kimai/public:ro
    restart: unless-stopped
    depends_on:
      - kimai
    healthcheck:
      test:  wget --spider http://nginx/health || exit 1
      interval: 20s
      start_period: 10s
      timeout: 10s
      retries: 3

  kimai: # This is the latest FPM image of kimai
    image: kimai/kimai2:latest
    environment:
      - ADMINMAIL=admin@kimai.local
      - ADMINPASS=changemeplease
      - DATABASE_URL=mysql://kimaiuser:kimaipassword@sqldb/kimai
      - TRUSTED_HOSTS=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

volumes:
    var:
    public:

2023-01-25 23_08_12-EME Time Tracker – Time Tracking

kevinpapst commented 1 year ago

Use the correct version of the plugin.

Read these issues: https://github.com/kevinpapst/ImportBundle/issues?q=is%3Aissue+is%3Aclosed

sinethra commented 1 year ago

Yes it works if get the plugin from the 1.x branch because the kimai about page says the version I'm using is 1.30.5. How could the version be 1.30.5 if im using the kimai/kimai2:latest image according the above docker-compose file ?

kevinpapst commented 1 year ago

I don't know, but I assume latest does not include pre-releases. Which would be highly suprising and a terrible bug IMO.

2.0 is not yet released and only available as beta.

sinethra commented 1 year ago

Yes, this could be a bug. According to the docker hub, it's the V2 image https://hub.docker.com/r/kimai/kimai2

I guess, for now, I'll use the plugin versions compatible with Kimai V1

kevinpapst commented 1 year ago

Don't mix up Kimai2 with the release 2.0.

Kimai2 is the name of the software, while 2.0 is the release version which is in beta right now.

sinethra commented 1 year ago

Thanks @kevinpapst . Understood