tobybatch / kimai2

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

[BUG] Cant login after docker pull #381

Closed gerroon closed 2 years ago

gerroon commented 2 years ago

Describe the bug I did a docker pull today. I stopped with docker-compose stop. I restarted the containers now I can't login. It says "invalid credentials" I tried both my admin and regular user name.

I am not a pro user so i cant be sure what happened. I do not believe that it would wipe my database :(

To Reproduce Steps to reproduce the behaviour: docker-compose pull docker-compose stop docker-compose up try to login

Desktop (please complete the following information):

Command used to run the container docker-compose up

Docker compose file (with passwords redacted)

version: '3.5'
services:

  sqldb:
    image: mysql:5.7
    environment:
      - MYSQL_DATABASE=kimai
      - MYSQL_USER=kimaiuser
      - MYSQL_PASSWORD=PASSSS
      - MYSQL_ROOT_PASSWORD=PASSS
    volumes:
      - kimai2/mysql:/var/lib/mysql
    command: --default-storage-engine innodb
    restart: unless-stopped

  kimai: 
    image: kimai/kimai2:apache
    environment:
      - ADMINMAIL=admin@kimai.local
      - ADMINPASS=PASSS
      - DATABASE_URL=mysql://kimaiuser:PASSS@sqldb/kimai
      - TRUSTED_HOSTS=nginx,localhost,127.0.0.1
    volumes:
      - kimai2/public:/opt/kimai/public
      - kimai2/var:/opt/kimai/var

    ports:
      - 8001:8001
    restart: unless-stopped

volumes:
    var:
    public:
    mysql:
docker-compose up -d && docker-compose logs -f
Creating kimai2_sqldb_1 ... done
Creating kimai2_kimai_1 ... done
Attaching to kimai2_kimai_1, kimai2_sqldb_1
kimai_1  |
kimai_1  | Wait for MySQL DB connection ...
kimai_1  | Testing DB:** new \PDO(mysql:host=sqldb;dbname=kimai;port=3306, kimaiuser, PASSSSSS, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
sqldb_1  | 2022-05-21 21:24:48+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.38-1debian10 started.
sqldb_1  | 2022-05-21 21:24:51+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
kimai_1  | Testing DB:** new \PDO(mysql:host=sqldb;dbname=kimai;port=3306, kimaiuser, PASSSSSS, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
sqldb_1  | 2022-05-21 21:24:51+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.38-1debian10 started.
sqldb_1  | 2022-05-21T21:24:52.127276Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
sqldb_1  | 2022-05-21T21:24:52.128595Z 0 [Note] mysqld (mysqld 5.7.38) starting as process 1 ...
sqldb_1  | 2022-05-21T21:24:52.131571Z 0 [Note] InnoDB: PUNCH HOLE support available
sqldb_1  | 2022-05-21T21:24:52.131586Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
sqldb_1  | 2022-05-21T21:24:52.131591Z 0 [Note] InnoDB: Uses event mutexes
sqldb_1  | 2022-05-21T21:24:52.131594Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
sqldb_1  | 2022-05-21T21:24:52.131598Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
sqldb_1  | 2022-05-21T21:24:52.131602Z 0 [Note] InnoDB: Using Linux native AIO
sqldb_1  | 2022-05-21T21:24:52.131807Z 0 [Note] InnoDB: Number of pools: 1
sqldb_1  | 2022-05-21T21:24:52.131900Z 0 [Note] InnoDB: Using CPU crc32 instructions
sqldb_1  | 2022-05-21T21:24:52.133585Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
sqldb_1  | 2022-05-21T21:24:52.144945Z 0 [Note] InnoDB: Completed initialization of buffer pool
sqldb_1  | 2022-05-21T21:24:52.147398Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
sqldb_1  | 2022-05-21T21:24:53.977522Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
kimai_1  | Testing DB:** new \PDO(mysql:host=sqldb;dbname=kimai;port=3306, kimaiuser, PASSSSSS, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
sqldb_1  | 2022-05-21T21:24:56.383083Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
sqldb_1  | 2022-05-21T21:24:56.383202Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
sqldb_1  | 2022-05-21T21:24:57.307111Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
sqldb_1  | 2022-05-21T21:24:57.314968Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
sqldb_1  | 2022-05-21T21:24:57.314997Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
sqldb_1  | 2022-05-21T21:24:57.315423Z 0 [Note] InnoDB: Waiting for purge to start
sqldb_1  | 2022-05-21T21:24:57.365512Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 5218ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
sqldb_1  | 2022-05-21T21:24:57.365537Z 0 [Note] InnoDB: 5.7.38 started; log sequence number 16288529
sqldb_1  | 2022-05-21T21:24:57.365974Z 0 [Note] Plugin 'FEDERATED' is disabled.
sqldb_1  | 2022-05-21T21:24:57.366187Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
kimai_1  | Testing DB:** new \PDO(mysql:host=sqldb;dbname=kimai;port=3306, kimaiuser, PASSSSSS, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
sqldb_1  | 2022-05-21T21:24:58.206569Z 0 [Warning] World-writable config file './auto.cnf' is ignored.
sqldb_1  | 2022-05-21T21:24:58.243865Z 0 [Warning] World-writable config file './auto.cnf' has been removed.
sqldb_1  |
sqldb_1  | 2022-05-21T21:24:58.243929Z 0 [Note] Salting uuid generator variables, current_pid: 1, server_start_time: 1653168292, bytes_sent: 0,
sqldb_1  | 2022-05-21T21:24:58.243986Z 0 [Note] Generated uuid: '77366b9a-d94c-11ec-9ce6-0242ac150003', server_start_time: 281476629878949, bytes_sent: 94203599649136
sqldb_1  | 2022-05-21T21:24:58.244010Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 77366b9a-d94c-11ec-9ce6-0242ac150003.
sqldb_1  | 2022-05-21T21:24:59.748867Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
sqldb_1  | 2022-05-21T21:24:59.748887Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
sqldb_1  | 2022-05-21T21:24:59.748894Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
sqldb_1  | 2022-05-21T21:24:59.748898Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
sqldb_1  | 2022-05-21T21:24:59.749914Z 0 [Warning] CA certificate ca.pem is self signed.
sqldb_1  | 2022-05-21T21:24:59.749977Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
sqldb_1  | 2022-05-21T21:24:59.750875Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
sqldb_1  | 2022-05-21T21:24:59.750922Z 0 [Note] IPv6 is available.
sqldb_1  | 2022-05-21T21:24:59.750950Z 0 [Note]   - '::' resolves to '::';
sqldb_1  | 2022-05-21T21:24:59.750985Z 0 [Note] Server socket created on IP: '::'.
sqldb_1  | 2022-05-21T21:24:59.913196Z 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.
sqldb_1  | 2022-05-21T21:25:00.946215Z 0 [Note] InnoDB: Buffer pool(s) load completed at 220521 21:25:00
sqldb_1  | 2022-05-21T21:25:04.543058Z 0 [Note] Event Scheduler: Loaded 0 events
sqldb_1  | 2022-05-21T21:25:04.543375Z 0 [Note] mysqld: ready for connections.
sqldb_1  | Version: '5.7.38'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)
kimai_1  | Testing DB:** new \PDO(mysql:host=sqldb;dbname=kimai;port=3306, kimaiuser, PASSSSSS, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*Connection established
kimai_1  | tar: public/avatars: Cannot utime: Operation not permitted
kimai_1  | tar: public/avatars: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: public/favicon: Cannot utime: Operation not permitted
kimai_1  | tar: public/favicon: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: public/build/images: Cannot utime: Operation not permitted
kimai_1  | tar: public/build/images: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: public/build/fonts: Cannot utime: Operation not permitted
kimai_1  | tar: public/build/fonts: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: public/build: Cannot utime: Operation not permitted
kimai_1  | tar: public/build: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: public/bundles/adminlte/images: Cannot utime: Operation not permitted
kimai_1  | tar: public/bundles/adminlte/images: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: public/bundles/adminlte/fonts: Cannot utime: Operation not permitted
kimai_1  | tar: public/bundles/adminlte/fonts: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: public/bundles/adminlte: Cannot utime: Operation not permitted
kimai_1  | tar: public/bundles/adminlte: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: public/bundles/nelmioapidoc/swagger-ui: Cannot utime: Operation not permitted
kimai_1  | tar: public/bundles/nelmioapidoc/swagger-ui: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: public/bundles/nelmioapidoc: Cannot utime: Operation not permitted
kimai_1  | tar: public/bundles/nelmioapidoc: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: public/bundles: Cannot utime: Operation not permitted
kimai_1  | tar: public/bundles: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: public: Cannot utime: Operation not permitted
kimai_1  | tar: public: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: Exiting with failure status due to previous errors
kimai_1  |
kimai_1  | Kimai installation running ...
kimai_1  | ==============================
kimai_1  |
kimai_1  |  ! [NOTE] Database is existing and connection could be established
kimai_1  |
kimai_1  |
kimai_1  |  [OK] Already at the latest version ("DoctrineMigrations\Version20220404150236")
sqldb_1  | 2022-05-21T21:25:00.946215Z 0 [Note] InnoDB: Buffer pool(s) load completed at 220521 21:25:00
sqldb_1  | 2022-05-21T21:25:04.543058Z 0 [Note] Event Scheduler: Loaded 0 events
sqldb_1  | 2022-05-21T21:25:04.543375Z 0 [Note] mysqld: ready for connections.
sqldb_1  | Version: '5.7.38'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)
kimai_1  | Testing DB:** new \PDO(mysql:host=sqldb;dbname=kimai;port=3306, kimaiuser, upward-subpanel-splashy, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*Connection established
kimai_1  | tar: public/avatars: Cannot utime: Operation not permitted
kimai_1  | tar: public/avatars: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: public/favicon: Cannot utime: Operation not permitted
kimai_1  | tar: public/favicon: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: public/build/images: Cannot utime: Operation not permitted
kimai_1  | tar: public/build/images: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: public/build/fonts: Cannot utime: Operation not permitted
kimai_1  | tar: public/build/fonts: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: public/build: Cannot utime: Operation not permitted
kimai_1  | tar: public/build: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: public/bundles/adminlte/images: Cannot utime: Operation not permitted
kimai_1  | tar: public/bundles/adminlte/images: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: public/bundles/adminlte/fonts: Cannot utime: Operation not permitted
kimai_1  | tar: public/bundles/adminlte/fonts: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: public/bundles/adminlte: Cannot utime: Operation not permitted
kimai_1  | tar: public/bundles/adminlte: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: public/bundles/nelmioapidoc/swagger-ui: Cannot utime: Operation not permitted
kimai_1  | tar: public/bundles/nelmioapidoc/swagger-ui: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: public/bundles/nelmioapidoc: Cannot utime: Operation not permitted
kimai_1  | tar: public/bundles/nelmioapidoc: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: public/bundles: Cannot utime: Operation not permitted
kimai_1  | tar: public/bundles: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: public: Cannot utime: Operation not permitted
kimai_1  | tar: public: Cannot change mode to rwxr-xr-x: Operation not permitted
kimai_1  | tar: Exiting with failure status due to previous errors
kimai_1  |
kimai_1  | Kimai installation running ...
kimai_1  | ==============================
kimai_1  |
kimai_1  |  ! [NOTE] Database is existing and connection could be established
kimai_1  |
kimai_1  |
kimai_1  |  [OK] Already at the latest version ("DoctrineMigrations\Version20220404150236")
kimai_1  |
kimai_1  |
kimai_1  |  Rebuilding your cache, please be patient ...
kimai_1  |
kimai_1  |  // Clearing the cache for the prod environment with debug
kimai_1  |  // false
kimai_1  |
kimai_1  |  [OK] Cache for the "prod" environment (debug=false) was successfully cleared.
kimai_1  |
kimai_1  |
kimai_1  |  // Warming up the cache for the prod environment with debug
kimai_1  |  // false
kimai_1  |
kimai_1  |  [OK] Cache for the "prod" environment (debug=false) was successfully warmed.
kimai_1  |
kimai_1  |
kimai_1  |  [OK] Congratulations! Successfully installed Kimai version 1.20.1
kimai_1  |
kimai_1  |
kimai_1  | Kimai updates running ...
kimai_1  | =========================
kimai_1  |
kimai_1  |
kimai_1  |  [OK] Already at the latest version ("DoctrineMigrations\Version20220404150236")
kimai_1  |
kimai_1  |
kimai_1  |  Rebuilding your cache, please be patient ...
kimai_1  |
kimai_1  |  // Clearing the cache for the prod environment with debug
kimai_1  |  // false
kimai_1  |
kimai_1  |  [OK] Cache for the "prod" environment (debug=false) was successfully cleared.
kimai_1  |
kimai_1  |
kimai_1  |  // Warming up the cache for the prod environment with debug
kimai_1  |  // false
kimai_1  |
kimai_1  |  [OK] Cache for the "prod" environment (debug=false) was successfully warmed.
kimai_1  |
kimai_1  |
kimai_1  |  [OK] Congratulations! Successfully updated Kimai to version 1.20.1
kimai_1  |
kimai_1  |
kimai_1  |  [ERROR] email (superadmin)
kimai_1  |              The email is already used.
kimai_1  |
kimai_1  |  [ERROR] username (superadmin)
kimai_1  |              The username is already used.
kimai_1  |
kimai_1  | Kimai2 ready
kimai_1  |
kimai_1  | Reloading configurations ...
kimai_1  | ============================
kimai_1  |
kimai_1  |
kimai_1  |  [OK] All 39 YAML files contain valid syntax.
kimai_1  |
kimai_1  |
kimai_1  |
kimai_1  |  [OK] All 512 XLIFF files contain valid syntax.
kimai_1  |
kimai_1  |
kimai_1  |  Rebuilding your cache, please be patient ...
kimai_1  |
kimai_1  |  // Clearing the cache for the prod environment with debug
kimai_1  |  // false
kimai_1  |
kimai_1  |  [OK] Cache for the "prod" environment (debug=false) was successfully cleared.
kimai_1  |
kimai_1  |
kimai_1  |  // Warming up the cache for the prod environment with debug
kimai_1  |  // false
kimai_1  |
kimai_1  |  [OK] Cache for the "prod" environment (debug=false) was successfully warmed.
kimai_1  |
kimai_1  |
kimai_1  |  [OK] Kimai config was reloaded
kimai_1  |
kimai_1  | [Sat May 21 23:25:26.658116 2022] [mpm_prefork:notice] [pid 76] AH00163: Apache/2.4.38 (Debian) configured -- resuming normal operations
kimai_1  | [Sat May 21 23:25:26.658157 2022] [core:notice] [pid 76] AH00094: Command line: '/usr/sbin/apache2 -D FOREGROUND'
kimai_1  | localhost:8001 127.0.0.1 - - [21/May/2022:23:25:27 +0200] "GET / HTTP/1.1" 302 562 "-" "curl/7.64.0"
kimai_1  | localhost:8001 192.168.2.119 - - [21/May/2022:23:25:31 +0200] "GET /en/login HTTP/1.1" 200 1324 "http://192.168.2.10:8001/en/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36"
kimai_1  | localhost:8001 192.168.2.119 - - [21/May/2022:23:25:36 +0200] "POST /en/login_check HTTP/1.1" 302 732 "http://192.168.2.10:8001/en/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36"
kimai_1  | localhost:8001 192.168.2.119 - - [21/May/2022:23:25:36 +0200] "GET /en/login HTTP/1.1" 200 1358 "http://192.168.2.10:8001/en/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36"
tobybatch commented 2 years ago

So I don't know if it's what's causing the issue but the permissions on your mounted public folder (at least) are wrong.

Try running in same folder as yout docker-compose.yml

docker-compose exec --user root web chown -R 33:33 /opt/kimai/public /opt/kimai/var

And try again.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.