[GH-ISSUE #889] Get Error 400 after docker-compose up #626

Closed
opened 2026-02-25 23:43:05 +03:00 by kerem · 5 comments
Owner

Originally created by @pthoelken on GitHub (Sep 6, 2023).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/889

Hello Community,

I got the Error 400, when I startup the container from lastest version.

image

Originally created by @pthoelken on GitHub (Sep 6, 2023). Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/889 Hello Community, I got the Error 400, when I startup the container from lastest version. ![image](https://github.com/healthchecks/healthchecks/assets/12643853/3dc3ca6f-f314-41eb-ba3a-cac0f170bc5c)
kerem closed this issue 2026-02-25 23:43:05 +03:00
Author
Owner

@cuu508 commented on GitHub (Sep 8, 2023):

@pthoelken can you please post your docker-compose.yml file (with the sensitive values redacted of course)?

<!-- gh-comment-id:1711257202 --> @cuu508 commented on GitHub (Sep 8, 2023): @pthoelken can you please post your docker-compose.yml file (with the sensitive values redacted of course)?
Author
Owner

@pthoelken commented on GitHub (Sep 8, 2023):

I will do this later. Thanks for your response.

<!-- gh-comment-id:1711501386 --> @pthoelken commented on GitHub (Sep 8, 2023): I will do this later. Thanks for your response.
Author
Owner

@pthoelken commented on GitHub (Sep 21, 2023):

So much sorry for my late reply, here is the needed informations.

Latest log entries from docker-compose logs -f

web_1  |   Applying sessions.0001_initial... OK
web_1  | WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x7f1630d616b8 pid: 1 (default app)
web_1  | *** uWSGI is running in multiple interpreter mode ***
web_1  | spawned uWSGI master process (pid: 1)
web_1  | spawned uWSGI worker 1 (pid: 12, cores: 1)
web_1  | spawned uWSGI worker 2 (pid: 13, cores: 1)
web_1  | spawned uWSGI worker 3 (pid: 14, cores: 1)
web_1  | spawned uWSGI worker 4 (pid: 15, cores: 1)
web_1  | [uwsgi-daemons] spawning "./manage.py sendalerts" (uid: 999 gid: 999)
web_1  | [uwsgi-daemons] spawning "./manage.py sendreports --loop" (uid: 999 gid: 999)
web_1  | sendalerts is now running
web_1  | sendreports is now running
web_1  | [pid: 12|app: 0|req: 1/1] 192.168.178.27 () {34 vars in 811 bytes} [Thu Sep 21 07:31:45 2023] GET / => generated 143 bytes in 145 msecs (HTTP/1.1 400) 4 headers in 172 bytes (1 switches on core 0)
web_1  | [pid: 13|app: 0|req: 1/2] 192.168.178.27 () {34 vars in 771 bytes} [Thu Sep 21 07:31:45 2023] GET /favicon.ico => generated 143 bytes in 148 msecs (HTTP/1.1 400) 4 headers in 172 bytes (1 switches on core 0)

This is my docker-compose.yml file

version: "3"
volumes:
    db-data:

services:
  db:
    image: postgres:12
    volumes:
      - db-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=$DB_NAME
      - POSTGRES_PASSWORD=$DB_PASSWORD
  web:
    image: local/healthcheck:latest
    env_file:
        - .env
    ports:
        - "8008:8000"
    depends_on:
        - db
    command: bash -c 'while !</dev/tcp/db/5432; do sleep 1; done; uwsgi /opt/healthchecks/docker/uwsgi.ini'

I've builded the docker image from your master branch repo first locally and put it into my docker-compose.yml file. The only thing what I changed in the .env file was the db password.

Build command: docker buildx build -t local/healthcheck:latest .

After starting the container I get the following error:
image

<!-- gh-comment-id:1729020427 --> @pthoelken commented on GitHub (Sep 21, 2023): So much sorry for my late reply, here is the needed informations. Latest log entries from `docker-compose logs -f` ``` web_1 | Applying sessions.0001_initial... OK web_1 | WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x7f1630d616b8 pid: 1 (default app) web_1 | *** uWSGI is running in multiple interpreter mode *** web_1 | spawned uWSGI master process (pid: 1) web_1 | spawned uWSGI worker 1 (pid: 12, cores: 1) web_1 | spawned uWSGI worker 2 (pid: 13, cores: 1) web_1 | spawned uWSGI worker 3 (pid: 14, cores: 1) web_1 | spawned uWSGI worker 4 (pid: 15, cores: 1) web_1 | [uwsgi-daemons] spawning "./manage.py sendalerts" (uid: 999 gid: 999) web_1 | [uwsgi-daemons] spawning "./manage.py sendreports --loop" (uid: 999 gid: 999) web_1 | sendalerts is now running web_1 | sendreports is now running web_1 | [pid: 12|app: 0|req: 1/1] 192.168.178.27 () {34 vars in 811 bytes} [Thu Sep 21 07:31:45 2023] GET / => generated 143 bytes in 145 msecs (HTTP/1.1 400) 4 headers in 172 bytes (1 switches on core 0) web_1 | [pid: 13|app: 0|req: 1/2] 192.168.178.27 () {34 vars in 771 bytes} [Thu Sep 21 07:31:45 2023] GET /favicon.ico => generated 143 bytes in 148 msecs (HTTP/1.1 400) 4 headers in 172 bytes (1 switches on core 0) ``` This is my docker-compose.yml file ``` version: "3" volumes: db-data: services: db: image: postgres:12 volumes: - db-data:/var/lib/postgresql/data environment: - POSTGRES_DB=$DB_NAME - POSTGRES_PASSWORD=$DB_PASSWORD web: image: local/healthcheck:latest env_file: - .env ports: - "8008:8000" depends_on: - db command: bash -c 'while !</dev/tcp/db/5432; do sleep 1; done; uwsgi /opt/healthchecks/docker/uwsgi.ini' ``` I've builded the docker image from your master branch repo first locally and put it into my docker-compose.yml file. The only thing what I changed in the .env file was the db password. Build command: `docker buildx build -t local/healthcheck:latest .` After starting the container I get the following error: ![image](https://github.com/healthchecks/healthchecks/assets/12643853/0038a96f-cf15-42a8-8ab4-5cba5bcf9535)
Author
Owner

@cuu508 commented on GitHub (Sep 21, 2023):

Thanks for the additional information @pthoelken.

The only thing what I changed in the .env file was the db password.

The issue might be with the ALLOWED_HOSTS setting. The default value in the .env file is localhost but the screenshot shows you are accessing it as 192.168.178.231. Try this in the .env file:

ALLOWED_HOSTS=192.168.178.231
<!-- gh-comment-id:1729469989 --> @cuu508 commented on GitHub (Sep 21, 2023): Thanks for the additional information @pthoelken. > The only thing what I changed in the .env file was the db password. The issue might be with the [ALLOWED_HOSTS](https://healthchecks.io/docs/self_hosted_configuration/#ALLOWED_HOSTS) setting. The default value in the .env file is `localhost` but the screenshot shows you are accessing it as `192.168.178.231`. Try this in the .env file: ``` ALLOWED_HOSTS=192.168.178.231 ```
Author
Owner

@pthoelken commented on GitHub (Sep 21, 2023):

Thanks a lot. Works like charm

<!-- gh-comment-id:1729571921 --> @pthoelken commented on GitHub (Sep 21, 2023): Thanks a lot. Works like charm
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/healthchecks#626
No description provided.