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] 400: Bad Request #484

Closed AdriSchmi closed 1 year ago

AdriSchmi commented 1 year ago

Describe the bug i get allways the error "400: Bad Request A critical error occurred, please try again. You may have found a software problem, please contact your administrator if the problem persists." when i go to the webpage localhost:8001. In the protokol i get the text: localhost:8001 127.0.0.1 - - [14/Mar/2023:18:49:09 +0100] "GET / HTTP/1.1" 302 607 "-" "curl/7.64.0" localhost:8001 10.0.0.12 - - [14/Mar/2023:18:49:14 +0100] "GET /de/homepage HTTP/1.1" 400 675 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"

To Reproduce Steps to reproduce the behaviour:

  1. Start the container
  2. go to the website 10.0.0.10:48013

Desktop (please complete the following information):

Command used to run the container

tobybatch commented 1 year ago

Can you share how you started the container please. See the bug template for the information I need to help you.

AdriSchmi commented 1 year ago

docker run -d --name='Kimai' --net='bridge' -e TZ="Europe/Berlin" -e HOST_OS="Unraid" -e HOST_HOSTNAME="Tower" -e HOST_CONTAINERNAME="Kimai" -e 'DATABASE_URL'='mysql://kimai:kimai@10.0.0.10:3306/kimai' -l net.unraid.docker.managed=dockerman -l net.unraid.docker.webui='http://[IP]:[PORT:8001]/' -l net.unraid.docker.icon='https://www.kimai.org/assets/icon/apple-touch-icon.png' -p '48013:8001/tcp' 'kimai/kimai2:apache' e8e52014d95996678444fc4229b1dc4a44968eccafe55b57958b1aac3b4d680c

that is how i start the docker

AdriSchmi commented 1 year ago

What do you mean with bug template?

kevinpapst commented 1 year ago

All the default text that you see when opening a bug issue: https://github.com/tobybatch/kimai2/issues/new?assignees=&labels=&template=bug_report.md&title=%5BBUG%5D+

AdriSchmi commented 1 year ago

Sorry fixed the post

AdriSchmi commented 1 year ago

Is there a Bug in the Docker or should I start the container differently?

kaergel commented 1 year ago

I've got the same issue. Containers started from standard docker-compose.yml as documented in https://github.com/tobybatch/kimai2/blob/main/compose/docker-compose.fpm.prod.yml . If you keep reloading the page it sometimes loads, but a login also leads to error 400

kaergel commented 1 year ago

i think this has to do with TRUSTED_HOSTS environment variable. try setting it to correct hostname/IP i.e. 10.0.0.10 in your case...

AdriSchmi commented 1 year ago

I changed the docker run but it is still not working image

Logs

Kimai installation running ...

Database kimai for connection named default already exists. Skipped.

[OK] Already at the latest version ("DoctrineMigrations\Version20220722125847")

Rebuilding your cache, please be patient ...

// Clearing the cache for the prod environment with debug
// false

[OK] Cache for the "prod" environment (debug=false) was successfully cleared.

// Warming up the cache for the prod environment with debug
// false

[OK] Cache for the "prod" environment (debug=false) was successfully warmed.

[OK] Congratulations! Successfully installed Kimai version 1.30.11

Kimai updates running ...

[OK] Already at the latest version ("DoctrineMigrations\Version20220722125847")

Rebuilding your cache, please be patient ...

// Clearing the cache for the prod environment with debug
// false

[OK] Cache for the "prod" environment (debug=false) was successfully cleared.

// Warming up the cache for the prod environment with debug
// false

[OK] Cache for the "prod" environment (debug=false) was successfully warmed.

[OK] Congratulations! Successfully updated Kimai to version 1.30.11

Kimai2 ready

Reloading configurations ...

[OK] All 40 YAML files contain valid syntax.

[OK] All 530 XLIFF files contain valid syntax.

Rebuilding your cache, please be patient ...

// Clearing the cache for the prod environment with debug
// false

[OK] Cache for the "prod" environment (debug=false) was successfully cleared.

// Warming up the cache for the prod environment with debug
// false

[OK] Cache for the "prod" environment (debug=false) was successfully warmed.

[OK] Kimai config was reloaded

localhost:8001 127.0.0.1 - - [17/Mar/2023:11:27:45 +0100] "GET / HTTP/1.1" 400 574 "-" "curl/7.64.0" localhost:8001 127.0.0.1 - - [17/Mar/2023:11:28:05 +0100] "GET / HTTP/1.1" 400 574 "-" "curl/7.64.0" localhost:8001 127.0.0.1 - - [17/Mar/2023:11:28:25 +0100] "GET / HTTP/1.1" 400 574 "-" "curl/7.64.0" localhost:8001 172.17.0.1 - - [17/Mar/2023:11:28:28 +0100] "GET /de/homepage HTTP/1.1" 400 675 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36" localhost:8001 127.0.0.1 - - [17/Mar/2023:11:28:45 +0100] "GET / HTTP/1.1" 400 574 "-" "curl/7.64.0" localhost:8001 172.17.0.1 - - [17/Mar/2023:11:29:04 +0100] "GET /de/homepage HTTP/1.1" 400 675 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36" localhost:8001 127.0.0.1 - - [17/Mar/2023:11:29:05 +0100] "GET / HTTP/1.1" 400 574 "-" "curl/7.64.0" localhost:8001 127.0.0.1 - - [17/Mar/2023:11:29:25 +0100] "GET / HTTP/1.1" 400 574 "-" "curl/7.64.0"

AdriSchmi commented 1 year ago

This was missing TRUSTED_PROXIES=10.0.0.10,172.17.0.23,localhost,127.0.0.1,172.17.0.1