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] Container not starting after last commit #492

Closed Fernien closed 1 year ago

Fernien commented 1 year ago

Describe the bug PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /opt/kimai/vendor/twig/twig/src/NodeVisitor/SafeAnalysisNodeVisitor.php on line 71 kimai | PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65536 bytes) in /opt/kimai/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php on line 143

To Reproduce Steps to reproduce the behaviour:

  1. image: kimai/kimai2:apache
  2. docker-compose pull to newest version
  3. docker-compose logs -f

Docker compose file (with passwords redacted)

version: '3.5'
networks:
  traefik-public:
    external: true

volumes:
    public:

services:
  kimai:
    image: kimai/kimai2:apache
    container_name: kimai
    environment:
      - ADMINMAIL=info@example.net
      - ADMINPASS=
      - DATABASE_URL=mysql://kimaiuser:cb6C7q85WCi4WQxJpKuE9JCpF@kimai-sql/kimai
      - TRUSTED_HOSTS=traefik,nginx,localhost,127.0.0.1,kimai,kimai.example.net,time.example.net
      - APP_ENV=prod
      - MAILER_URL=smtp://
      - MAILER_FROM=noreply@example.de
    volumes:
      - public:/opt/kimai/public
      - ./var:/opt/kimai/var
      - ./plugins:/opt/kimai/var/plugins
    restart: unless-stopped
    networks:
      - default
      - traefik-public
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.kimai-secure.entrypoints=websecure"
      - "traefik.http.routers.kimai-secure.rule=Host(`time.example.net`)"    # Hier eure URL eingeben #
      - "traefik.http.routers.kimai-secure.tls=true"
      - "traefik.http.routers.kimai-secure.tls.certresolver=acme_autodns"
      - "traefik.http.routers.kimai-secure.service=kimai"
      - "traefik.http.services.kimai.loadbalancer.server.port=8001"
      - "traefik.docker.network=traefik-public"
      - "traefik.http.routers.kimai-secure.middlewares=secHeaders@file"

  kimai-sql:
    image: mariadb:latest
    container_name: kimai-sql
    environment:
      - MYSQL_DATABASE=kimai
      - MYSQL_USER=kimaiuser
      - MYSQL_PASSWORD=
      - MYSQL_ROOT_PASSWORD=
    volumes:
      - ./mysql:/var/lib/mysql
    command: --default-storage-engine innodb
    restart: unless-stopped
    networks:
      - default
Fernien commented 1 year ago

hmm now its starting but ill get a 500 when trying to access it image cant seem to find anything in the log so far

kevinpapst commented 1 year ago

That is Kimai 2.x - which is not yet officially released

Fernien commented 1 year ago

That is Kimai 2.x - which is not yet officially released

What do you mean? I ran this for months now. Its in the official documentation.

Fernien commented 1 year ago

https://www.kimai.org/documentation/docker.html

tobybatch commented 1 year ago

I've re-tagged and re-pushed all the images, I am now certain they are on 1.30.11

Fernien commented 1 year ago

I saw the 1.30.11 in the docker logs but i still get a 500 internal server error. Is there a problem with the database now?

tobybatch commented 1 year ago

Can I see the logs

Fernien commented 1 year ago

Here are the docker logs. https://pastebin.com/fFaCg5c2 cant find anything inside the container

tobybatch commented 1 year ago

can you save this into a file monolog.yaml

monolog:
  handlers:
    main:
      type: stream
      level: debug
      path: "php://stderr"

and execute

docker cp monolog.yaml WHATEVER_YOUR_DICKER_CALLED:/opt/kimai/config/packages/prod/monolog.yaml

And then post the logs please

Fernien commented 1 year ago

https://pastebin.com/JGEi54qL

I assume it has something to do with this?

kimai      |  [WARNING] You have 2 previously executed migrations in the database that are
kimai      |            not registered migrations.
kevinpapst commented 1 year ago

If you have been on the latest main branch (2.0.x), your database was migrated and is likely not compatible any longer with the 1.30 code now running.

tobybatch commented 1 year ago

Yeah looks like it. There was a brief period of time when kevin first published the v2 tag (https://github.com/kimai/kimai/releases/tag/2.0.2) we did build and tag latest as v2.

This is version 2.x of Kimai2. Kimai2 is a full rewrite of the original Kimai that was end of life years ago.

I think you have unknowingly, and accidentally, upgraded your DB schema to 2.x

Our best hope to help you is to get running your own build until we are ready to push out v2.

You are running apache prod so this command will build you a version 2 image just for you.

docker build -t fernien/kimai2:apache-2.0.11-prod --build-arg KIMAI=2.0.11 --build-arg BASE=apache --build-arg TZ=Europe/London --target=prod .

And the adjust your docker compose to reference your new image

services:
  kimai:
    image: fernien/kimai2:apache-2.0.11-prod
    container_name: kimai
    environment:
Fernien commented 1 year ago

Sounds like a good aproach. I'm getting this error when i run your command: ERROR: failed to solve: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount400830160/Dockerfile: no such file or directory Not to sure how it references the real image.

Well i run watchtower to keep it up to date. But i can remember a time when there was a new gui but a day later it was gone again. Was that V2?

tobybatch commented 1 year ago

Have you cloned this repo and run the command from the root of the clone?

Fernien commented 1 year ago

This one? https://github.com/kimai/kimai/releases/tag/2.0.2

tobybatch commented 1 year ago

No this repo! https://github.com/tobybatch/kimai2

Fernien commented 1 year ago

still a error 500

makeeno commented 1 year ago

I had the same issue. Pinning the image to kimai/kimai2:apache-2.0.10-prod fixes it for now. Everything I usually do works (for now), except for creating invoices with my custom .html.twig file, which causes a 500:

grafik

But I think that's a separate issue.

felix-walter commented 1 year ago

I am getting the same issue (error 500 and the "memory size exhausted" message) after upgrading to 1.3.11. Previously I was just mounting a custom php.ini to /usr/local/etc/php/php.ini-production to set the memory limit to 2G, but it seems this does not work anymore. Can you give me an indication where to properly set custom php.ini directives now?

Edit: I am using kimai/kimai2:apache-1.30.11-prod and the issue occurs when accessing the front page of Kimai.

Edit 2: Tried to set memory_limit=2048 via environment after checking the diff in this repo, did not help. phpinfo() showing 2048M, but the front page of Kimai still yields a HTTP 500 with a memory size exhausted message in prod.log mentioning a limit of 128M (134217728 bytes). Solution for now was to downgrade to kimai/kimai2:apache-1.30.5-prod and fix the permissions in /opt/kimai/var.

Fernien commented 1 year ago

I haven't found a solution for this problem. Haven't tested your approach Osman-Sodefa. I rolled back to a backup made in the night and exported all the entries of the day beforehand. So its a workaround for me i guess. I would close it if none of you guys wants me to keep it open.

tstrohmeier commented 1 year ago

@felix-walter It seams like /usr/local/etc/php/php.ini-production is not used anymore if you compare this two lines in the startup.sh: https://github.com/tobybatch/kimai2/blob/7212829d3dc8a3d0451cc4f70d99e13b49cd551a/assets/startup.sh#L42 https://github.com/tobybatch/kimai2/blob/a6e14b45270ade88974ba46a2cba759fb09a3e9f/assets/startup.sh#L25

felix-walter commented 1 year ago

Right, I also tried to change the mountpoint to /usr/local/etc/php/php.ini. However, this did not help. In fact, PHP was showing to be configured with a memory limit of 2G (even with just memory_limit=2048 in the Docker environment vars), but the error occurred anyway.

iFiNEXx commented 1 year ago

I got the same Problem. I used Kimai 1.30.11 and after the Kimai Docker-Image was updated, it shows "500 Internal Server Error". Now i also rolled back to an Backup before the Docker-Image update and disabled updating the Image.

tobybatch commented 1 year ago

I've opened #495 to track the mem limit. I'll get that fixed as soon as possible. Can we post updates about mem limits there please?

tobybatch commented 1 year ago

This issue will track the mis-tagging error #467

@Fernien take a look at this, I think it fixes both issues, the memory and the permissions https://github.com/tobybatch/kimai2/pull/496

swoop124 commented 1 year ago

Hello,

i've found this error: kimai2-nginx-1 [error] 8#8: *5 connect() failed (111: Connection refused) while connecting to upstream, client: 10.10.10.254, server: nginx, request: "GET / HTTP/1.1", upstream: "fastcgi://17.16.2.131:9000", host: "kimai.domain.tld"

The continer with ip 17.16.2.131 is the kimai container.

Any News on that?

swoop124 commented 1 year ago

and now, as i chanched the docker image from fqm to apache-2.0.0-prod i get this errors.

kimai2-kimai-1    | [Fri Mar 24 14:56:10.005637 2023] [mpm_prefork:notice] [pid 51] AH00163: Apache/2.4.38 (Debian) PHP/8.1.12 configured -- resuming normal operations      
kimai2-kimai-1    | [Fri Mar 24 14:56:10.005670 2023] [core:notice] [pid 51] AH00094: Command line: '/usr/sbin/apache2 -D FOREGROUND'
kimai2-kimai-1    | [Fri Mar 24 14:56:27.970400 2023] [php:error] [pid 52] [client 127.0.0.1:53950] PHP Fatal error:  Uncaught Error: Undefined constant Symfony\\Component\\HttpFoundation\\Request::HEADER_X_FORWARDED_ALL in /opt/kimai/public/index.php:23\nStack trace:\n#0 {main}\n  thrown in /opt/kimai/public/index.php on line 23
kimai2-kimai-1    | localhost:8001 127.0.0.1 - - [24/Mar/2023:14:56:27 +0100] "GET / HTTP/1.1" 500 211 "-" "curl/7.64.0"
kimai2-kimai-1    | [Fri Mar 24 14:56:48.044263 2023] [php:error] [pid 53] [client 127.0.0.1:44648] PHP Fatal error:  Uncaught Error: Undefined constant Symfony\\Component\\HttpFoundation\\Request::HEADER_X_FORWARDED_ALL in /opt/kimai/public/index.php:23\nStack trace:\n#0 {main}\n  thrown in /opt/kimai/public/index.php on line 23
kimai2-kimai-1    | localhost:8001 127.0.0.1 - - [24/Mar/2023:14:56:48 +0100] "GET / HTTP/1.1" 500 211 "-" "curl/7.64.0"
kimai2-kimai-1    | [Fri Mar 24 14:57:08.162312 2023] [php:error] [pid 54] [client 127.0.0.1:37382] PHP Fatal error:  Uncaught Error: Undefined constant Symfony\\Component\\HttpFoundation\\Request::HEADER_X_FORWARDED_ALL in /opt/kimai/public/index.php:23\nStack trace:\n#0 {main}\n  thrown in /opt/kimai/public/index.php on line 23
kimai2-kimai-1    | localhost:8001 127.0.0.1 - - [24/Mar/2023:14:57:08 +0100] "GET / HTTP/1.1" 500 211 "-" "curl/7.64.0"
kimai2-kimai-1    | [Fri Mar 24 14:57:28.259605 2023] [php:error] [pid 55] [client 127.0.0.1:55678] PHP Fatal error:  Uncaught Error: Undefined constant Symfony\\Component\\HttpFoundation\\Request::HEADER_X_FORWARDED_ALL in /opt/kimai/public/index.php:23\nStack trace:\n#0 {main}\n  thrown in /opt/kimai/public/index.php on line 23
kimai2-kimai-1    | localhost:8001 127.0.0.1 - - [24/Mar/2023:14:57:28 +0100] "GET / HTTP/1.1" 500 211 "-" "curl/7.64.0"
swoop124 commented 1 year ago

I just created a brand new kimai stack. This also results in the same error: docker-compose.yml

version: '3.5'
services:

  sqldb:
    image: mysql:5.7
    environment:
      - MYSQL_DATABASE=kimai
      - MYSQL_USER=<kimaiuser>
      - MYSQL_PASSWORD=<db-password>
      - MYSQL_ROOT_PASSWORD=<db-root-password>
    volumes:
      - ./db_data:/var/lib/mysql
      - ./:/db
    command: --default-storage-engine innodb
    restart: unless-stopped
    healthcheck:
      test: mysqladmin -p<db-root-password> ping -h localhost
      interval: 20s
      start_period: 10s
      timeout: 10s
      retries: 3

  nginx:
    image: tobybatch/nginx-fpm-reverse-proxy
    ports:
      - 8002: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:fpm
    # image: kimai/kimai2:fpm-1.30.11-prod
    environment:
      - ADMINMAIL=office@domain.tld
      - ADMINPASS=Password
      - DATABASE_URL=mysql://<kimaiuser>:<db-password>@sqldb/kimai
      - TRUSTED_HOSTS=nginx,localhost,127.0.0.1,docker3.domain.tld,192.168.251.59,kimai.domain.tld,docker.domain.tld
      - memory_limit=512
    volumes:
      - ./public:/opt/kimai/public
      - ./var/invoices:/opt/kimai/var/invoices
      - ./var/data:/opt/kimai/var/data
      # - ./ldap.conf:/etc/openldap/ldap.conf:z
      # - ./ROOT-CA.pem:/etc/ssl/certs/ROOT-CA.pem:z
    restart: unless-stopped

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

docker-compose logs

[+] Running 4/4
 ⠿ Container test-kimai-postfix-1  Created          0.0s 
 ⠿ Container test-kimai-kimai-1    Recreated        0.3s 
 ⠿ Container test-kimai-sqldb-1    Created          0.0s 
 ⠿ Container test-kimai-nginx-1    Recreated        0.1s
Attaching to test-kimai-kimai-1, test-kimai-nginx-1, test-kimai-postfix-1, test-kimai-sqldb-1
test-kimai-kimai-1    | ++ cat /opt/kimai/version.txt
test-kimai-kimai-1    | + KIMAI=1.30.11
test-kimai-kimai-1    | + echo 1.30.11
test-kimai-kimai-1    | + config
test-kimai-kimai-1    | + '[' -z 512 ']'
test-kimai-kimai-1    | + '[' '!' -z mysql://<kimai-db-user>:<db-password>@sqldb/kimai ']'
test-kimai-kimai-1    | ++ awk -F '[/:@]' '{print $1}'
test-kimai-kimai-1    | 1.30.11
test-kimai-kimai-1    | + DB_TYPE=mysql
test-kimai-kimai-1    | ++ awk -F '[/:@]' '{print $4}'
test-kimai-sqldb-1    | 2023-03-24 14:19:29+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.41-1.el7 started.
test-kimai-kimai-1    | + DB_USER=<kimai-db-user>
test-kimai-kimai-1    | ++ awk -F '[/:@]' '{print $5}'
test-kimai-kimai-1    | + DB_PASS=<db-password>
test-kimai-kimai-1    | ++ awk -F '[/:@]' '{print $6}'
test-kimai-kimai-1    | + DB_HOST=sqldb
test-kimai-kimai-1    | ++ awk -F '[/:@]' '{print $7}'
test-kimai-kimai-1    | + DB_PORT=kimai
test-kimai-kimai-1    | ++ awk -F '[/?]' '{print $4}'
test-kimai-kimai-1    | + DB_BASE=kimai
test-kimai-kimai-1    | + re='^[0-9]+$'
test-kimai-kimai-1    | + [[ kimai =~ ^[0-9]+$ ]]
test-kimai-kimai-1    | Wait for MySQL DB connection ...
test-kimai-kimai-1    | + DB_PORT=3306
test-kimai-kimai-1    | + echo 'Wait for MySQL DB connection ...'
test-kimai-kimai-1    | + php /dbtest.php sqldb kimai 3306 <kimai-db-user> <db-password>
test-kimai-kimai-1    | + echo Checking DB: 10
test-kimai-kimai-1    | + sleep 3
test-kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=sqldb;dbname=kimai;port=3306, <kimai-db-user>, <db-password>, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*SQLSTATE[HY000] [2002] Connection refused (?)Checking DB: 10
test-kimai-postfix-1  | 2023-03-24 14:19:30,007 CRIT Supervisor running as root (no user in config file)
test-kimai-postfix-1  | 2023-03-24 14:19:30,007 WARN Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
test-kimai-postfix-1  | Unlinking stale socket /var/run/supervisor.sock
test-kimai-sqldb-1    | 2023-03-24 14:19:30+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
test-kimai-sqldb-1    | 2023-03-24 14:19:30+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.41-1.el7 started.
test-kimai-sqldb-1    | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
test-kimai-postfix-1  | 2023-03-24 14:19:30,322 INFO RPC interface 'supervisor' initialized
test-kimai-postfix-1  | 2023-03-24 14:19:30,322 CRIT Server 'unix_http_server' running without any HTTP authentication checking
test-kimai-postfix-1  | 2023-03-24 14:19:30,322 INFO supervisord started with pid 8
test-kimai-sqldb-1    | 2023-03-24T14:19:30.411005Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
test-kimai-sqldb-1    | 2023-03-24T14:19:30.412070Z 0 [Note] mysqld (mysqld 5.7.41) starting as process 1 ...
test-kimai-sqldb-1    | 2023-03-24T14:19:30.414421Z 0 [Note] InnoDB: PUNCH HOLE support available
test-kimai-sqldb-1    | 2023-03-24T14:19:30.414444Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
test-kimai-sqldb-1    | 2023-03-24T14:19:30.414449Z 0 [Note] InnoDB: Uses event mutexes
test-kimai-sqldb-1    | 2023-03-24T14:19:30.414451Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
test-kimai-sqldb-1    | 2023-03-24T14:19:30.414453Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.12
test-kimai-sqldb-1    | 2023-03-24T14:19:30.414455Z 0 [Note] InnoDB: Using Linux native AIO
test-kimai-sqldb-1    | 2023-03-24T14:19:30.414644Z 0 [Note] InnoDB: Number of pools: 1
test-kimai-sqldb-1    | 2023-03-24T14:19:30.414716Z 0 [Note] InnoDB: Using CPU crc32 instructions
test-kimai-sqldb-1    | 2023-03-24T14:19:30.415846Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
test-kimai-sqldb-1    | 2023-03-24T14:19:30.421610Z 0 [Note] InnoDB: Completed initialization of buffer pool
test-kimai-sqldb-1    | 2023-03-24T14:19:30.423090Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
test-kimai-sqldb-1    | 2023-03-24T14:19:30.434431Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
test-kimai-sqldb-1    | 2023-03-24T14:19:30.445571Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
test-kimai-sqldb-1    | 2023-03-24T14:19:30.445626Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
test-kimai-sqldb-1    | 2023-03-24T14:19:30.489031Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
test-kimai-sqldb-1    | 2023-03-24T14:19:30.489688Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
test-kimai-sqldb-1    | 2023-03-24T14:19:30.489694Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
test-kimai-sqldb-1    | 2023-03-24T14:19:30.489994Z 0 [Note] InnoDB: Waiting for purge to start
test-kimai-sqldb-1    | 2023-03-24T14:19:30.540173Z 0 [Note] InnoDB: 5.7.41 started; log sequence number 15866602
test-kimai-sqldb-1    | 2023-03-24T14:19:30.540344Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
test-kimai-sqldb-1    | 2023-03-24T14:19:30.540477Z 0 [Note] Plugin 'FEDERATED' is disabled.
test-kimai-sqldb-1    | 2023-03-24T14:19:30.544649Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
test-kimai-sqldb-1    | 2023-03-24T14:19:30.544658Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
test-kimai-sqldb-1    | 2023-03-24T14:19:30.544661Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
test-kimai-sqldb-1    | 2023-03-24T14:19:30.544662Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
test-kimai-sqldb-1    | 2023-03-24T14:19:30.545111Z 0 [Warning] CA certificate ca.pem is self signed.
test-kimai-sqldb-1    | 2023-03-24T14:19:30.545142Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
test-kimai-sqldb-1    | 2023-03-24T14:19:30.545384Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
test-kimai-sqldb-1    | 2023-03-24T14:19:30.545413Z 0 [Note] IPv6 is available.
test-kimai-sqldb-1    | 2023-03-24T14:19:30.545424Z 0 [Note]   - '::' resolves to '::';
test-kimai-sqldb-1    | 2023-03-24T14:19:30.545438Z 0 [Note] Server socket created on IP: '::'.
test-kimai-sqldb-1    | 2023-03-24T14:19:30.547094Z 0 [Note] InnoDB: Buffer pool(s) load completed at 230324 14:19:30
test-kimai-sqldb-1    | 2023-03-24T14:19:30.548300Z 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.
test-kimai-sqldb-1    | 2023-03-24T14:19:30.554550Z 0 [Note] Event Scheduler: Loaded 0 events
test-kimai-sqldb-1    | 2023-03-24T14:19:30.554742Z 0 [Note] mysqld: ready for connections.
test-kimai-sqldb-1    | Version: '5.7.41'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)
test-kimai-postfix-1  | 2023-03-24 14:19:31,324 INFO spawned: 'postfix' with pid 11
test-kimai-postfix-1  | 2023-03-24 14:19:31,325 INFO spawned: 'rsyslog' with pid 12
test-kimai-postfix-1  | 2023-03-24 14:19:32,420 INFO success: postfix entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
test-kimai-postfix-1  | 2023-03-24 14:19:32,420 INFO success: rsyslog entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
test-kimai-kimai-1    | + php /dbtest.php sqldb kimai 3306 <kimai-db-user> <db-password>
test-kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=sqldb;dbname=kimai;port=3306, <kimai-db-user>, <db-password>, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*Connection established
test-kimai-kimai-1    | + echo 'Connection established'
test-kimai-kimai-1    | + handleStartup
test-kimai-kimai-1    | + set -x
test-kimai-kimai-1    | + '[' prod == prod ']'
test-kimai-kimai-1    | + sed -i s/128M/512M/g /usr/local/etc/php/php.ini
test-kimai-kimai-1    | + '[' 1 -lt 2 ']'
test-kimai-kimai-1    | + cp /assets/monolog-prod.yaml /opt/kimai/config/packages/monolog.yaml
test-kimai-kimai-1    | + set +x
test-kimai-nginx-1    | 172.16.1.129 - - [24/Mar/2023:14:19:49 +0000] "GET /de/login HTTP/1.1" 502 158 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0" "-"
test-kimai-nginx-1    | 2023/03/24 14:19:49 [error] 7#7: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.16.1.129, server: nginx, request: "GET /de/login HTTP/1.1", upstream: "fastcgi://172.16.1.132:9000", host: "docker.domain.tld:8002"
test-kimai-nginx-1    | 172.16.1.129 - - [24/Mar/2023:14:19:49 +0000] "GET /favicon.ico HTTP/1.1" 200 1150 "http://docker.domain.tld:8002/de/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0" "-"
test-kimai-nginx-1    | 172.16.1.133 - - [24/Mar/2023:14:19:50 +0000] "GET /health HTTP/1.1" 200 5 "-" "Wget" "-"
test-kimai-nginx-1    | 2023/03/24 14:20:04 [error] 7#7: *4 connect() failed (111: Connection refused) while connecting to upstream, client: 172.16.1.129, server: nginx, request: "GET /de/login HTTP/1.1", upstream: "fastcgi://172.16.1.132:9000", host: "docker.domain.tld:8002"
test-kimai-nginx-1    | 172.16.1.129 - - [24/Mar/2023:14:20:04 +0000] "GET /de/login HTTP/1.1" 502 158 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0" "-"
test-kimai-kimai-1    | /startup.sh: line 83: pwconv: command not found
test-kimai-kimai-1    | + waitForDB
test-kimai-kimai-1    | + '[' '!' -z mysql://<kimai-db-user>:<db-password>@sqldb/kimai ']'
test-kimai-kimai-1    | ++ awk -F '[/:@]' '{print $1}'
test-kimai-kimai-1    | + DB_TYPE=mysql
test-kimai-kimai-1    | ++ awk -F '[/:@]' '{print $4}'
test-kimai-kimai-1    | + DB_USER=<kimai-db-user>
test-kimai-kimai-1    | ++ awk -F '[/:@]' '{print $5}'
test-kimai-kimai-1    | + DB_PASS=<db-password>
test-kimai-kimai-1    | ++ awk -F '[/:@]' '{print $6}'
test-kimai-kimai-1    | + DB_HOST=sqldb
test-kimai-kimai-1    | ++ awk -F '[/:@]' '{print $7}'
test-kimai-kimai-1    | + DB_PORT=kimai
test-kimai-kimai-1    | ++ awk -F '[/?]' '{print $4}'
test-kimai-kimai-1    | + DB_BASE=kimai
test-kimai-kimai-1    | + re='^[0-9]+$'
test-kimai-kimai-1    | + [[ kimai =~ ^[0-9]+$ ]]
test-kimai-kimai-1    | + DB_PORT=3306
test-kimai-kimai-1    | + echo 'Wait for MySQL DB connection ...'
test-kimai-kimai-1    | + php /dbtest.php sqldb kimai 3306 <kimai-db-user> <db-password>
test-kimai-kimai-1    | Wait for MySQL DB connection ...
test-kimai-nginx-1    | 172.16.1.129 - - [24/Mar/2023:14:20:04 +0000] "GET /favicon.ico HTTP/1.1" 200 1150 "http://docker.domain.tld:8002/de/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0" "-"
test-kimai-kimai-1    | + echo 'Connection established'
test-kimai-kimai-1    | Testing DB:** new \PDO(mysql:host=sqldb;dbname=kimai;port=3306, <kimai-db-user>, <db-password>, [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION ]);*Connection established
test-kimai-kimai-1    | + handleStartup
test-kimai-kimai-1    | + /opt/kimai/bin/console -n kimai:install
test-kimai-kimai-1    | 
test-kimai-kimai-1    | Kimai installation running ...
test-kimai-kimai-1    | ==============================
test-kimai-kimai-1    |
test-kimai-kimai-1    | Database `kimai` for connection named default already exists. Skipped.
test-kimai-kimai-1    | 
test-kimai-kimai-1    |  [OK] Already at the latest version ("DoctrineMigrations\Version20220722125847")
test-kimai-kimai-1    |
test-kimai-kimai-1    |
test-kimai-kimai-1    |  Rebuilding your cache, please be patient ...
test-kimai-kimai-1    | 
test-kimai-kimai-1    |  // Clearing the cache for the prod environment with debug
test-kimai-kimai-1    |  // false
test-kimai-kimai-1    |
test-kimai-kimai-1    |  [OK] Cache for the "prod" environment (debug=false) was successfully cleared.  
test-kimai-kimai-1    |
test-kimai-kimai-1    |
test-kimai-kimai-1    |  // Warming up the cache for the prod environment with debug
test-kimai-kimai-1    |  // false
test-kimai-kimai-1    |
test-kimai-kimai-1    |  [OK] Cache for the "prod" environment (debug=false) was successfully warmed.   
test-kimai-kimai-1    |
test-kimai-kimai-1    |
test-kimai-kimai-1    |  [OK] Congratulations! Successfully installed Kimai version 1.30.11
test-kimai-kimai-1    |
test-kimai-kimai-1    | + /opt/kimai/bin/console -n kimai:update
test-kimai-kimai-1    | 
test-kimai-kimai-1    | Kimai updates running ...
test-kimai-kimai-1    | =========================
test-kimai-kimai-1    |
test-kimai-kimai-1    | 
test-kimai-kimai-1    |  [OK] Already at the latest version ("DoctrineMigrations\Version20220722125847")
test-kimai-kimai-1    |
test-kimai-kimai-1    |
test-kimai-kimai-1    |  Rebuilding your cache, please be patient ...
test-kimai-kimai-1    | 
test-kimai-kimai-1    |  // Clearing the cache for the prod environment with debug
test-kimai-kimai-1    |  // false
test-kimai-kimai-1    |
test-kimai-nginx-1    | 172.16.1.133 - - [24/Mar/2023:14:20:10 +0000] "GET /health HTTP/1.1" 200 5 "-" "Wget" "-"
test-kimai-kimai-1    |  [OK] Cache for the "prod" environment (debug=false) was successfully cleared.  
test-kimai-kimai-1    |
test-kimai-kimai-1    |
test-kimai-kimai-1    |  // Warming up the cache for the prod environment with debug
test-kimai-kimai-1    |  // false
test-kimai-kimai-1    |
test-kimai-kimai-1    |  [OK] Cache for the "prod" environment (debug=false) was successfully warmed.   
test-kimai-kimai-1    |
test-kimai-kimai-1    |
test-kimai-kimai-1    |  [OK] Congratulations! Successfully updated Kimai to version 1.30.11
test-kimai-kimai-1    |
test-kimai-kimai-1    | + '[' '!' -z bVv7roT85uH7Ws ']'
test-kimai-kimai-1    | + '[' '!' -a office@domain.tld ']'
test-kimai-kimai-1    | + /opt/kimai/bin/console kimai:create-user superadmin office@domain.tld ROLE_SUPER_ADMIN bVv7roT85uH7Ws
test-kimai-kimai-1    | 
test-kimai-kimai-1    |  [ERROR] email (superadmin)
test-kimai-kimai-1    |              The email is already used.
test-kimai-kimai-1    |
test-kimai-kimai-1    |  [ERROR] username (superadmin)
test-kimai-kimai-1    |              The username is already used.
test-kimai-kimai-1    |
test-kimai-kimai-1    | + echo 1.30.11
test-kimai-kimai-1    | + echo 'Kimai2 ready'
test-kimai-kimai-1    | Kimai2 ready
test-kimai-kimai-1    | + runServer
test-kimai-kimai-1    | + /opt/kimai/bin/console kimai:reload --env=prod
test-kimai-kimai-1    | 
test-kimai-kimai-1    | Reloading configurations ...
test-kimai-kimai-1    | ============================
test-kimai-kimai-1    |
test-kimai-kimai-1    | 
test-kimai-kimai-1    |  [OK] All 40 YAML files contain valid syntax.
test-kimai-kimai-1    |
test-kimai-kimai-1    |
test-kimai-kimai-1    | 
test-kimai-kimai-1    |  [OK] All 530 XLIFF files contain valid syntax.
test-kimai-kimai-1    |
test-kimai-kimai-1    |
test-kimai-kimai-1    |  Rebuilding your cache, please be patient ...
test-kimai-kimai-1    | 
test-kimai-kimai-1    |  // Clearing the cache for the prod environment with debug
test-kimai-kimai-1    |  // false
test-kimai-kimai-1    |
test-kimai-kimai-1    |  [OK] Cache for the "prod" environment (debug=false) was successfully cleared.  
test-kimai-kimai-1    |
test-kimai-kimai-1    |
test-kimai-kimai-1    |  // Warming up the cache for the prod environment with debug
test-kimai-kimai-1    |  // false
test-kimai-kimai-1    |
test-kimai-kimai-1    |  [OK] Cache for the "prod" environment (debug=false) was successfully warmed.   
test-kimai-kimai-1    |
test-kimai-kimai-1    |
test-kimai-kimai-1    |  [OK] Kimai config was reloaded
test-kimai-kimai-1    |
test-kimai-kimai-1    | + '[' -e /use_apache ']'
test-kimai-kimai-1    | + '[' -e /use_fpm ']'
test-kimai-kimai-1    | + exec php-fpm
test-kimai-kimai-1    | [24-Mar-2023 15:20:16] NOTICE: fpm is running, pid 41
test-kimai-kimai-1    | [24-Mar-2023 15:20:16] NOTICE: ready to handle connections
test-kimai-nginx-1    | 172.16.1.129 - - [24/Mar/2023:14:20:17 +0000] "GET /de/login HTTP/1.1" 500 1967 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0" "-"
test-kimai-kimai-1    | 172.16.1.133 -  24/Mar/2023:15:20:16 +0100 "GET /index.php" 500
test-kimai-nginx-1    | 172.16.1.129 - - [24/Mar/2023:14:20:17 +0000] "GET /build/runtime.b8e7bb04.js HTTP/1.1" 200 1891 "http://docker.domain.tld:8002/de/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0" "-"
test-kimai-nginx-1    | 172.16.1.129 - - [24/Mar/2023:14:20:17 +0000] "GET /apple-touch-icon.png HTTP/1.1" 200 24282 "http://docker.domain.tld:8002/de/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0" "-"
test-kimai-nginx-1    | 172.16.1.129 - - [24/Mar/2023:14:20:17 +0000] "GET /favicon.ico HTTP/1.1" 200 1150 "http://docker.domain.tld:8002/de/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0" "-"
tobybatch commented 1 year ago

There is a fix on the way for this, but for now run this:

docker exec -ti CONTAINER_NAME chown -R www-kimai /opt/kimai/var
swoop124 commented 1 year ago

thanks, that is working, for now ;-)

tobybatch commented 1 year ago

I'm going to close this for now. The new CI process is in place, building the new images.