-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Healthcheck issue #7132
-
Hello.
I am experiencing a weird issue with healthcheck that prevents Code Server from working properly. Whenever I'm using an expression like this as a test
curl -fksSL http://localhost:8443/healthz | grep -o alive || exit 1
Code Server does not work - Web UI is not accessible, and healthz endpoint reports expired.
But when I use ['CMD', 'curl', '-fksSL', 'http://localhost:8443/healthz'] everything works fine, Code Server starts and within 10-20 seconds healthz reports 'alive'.
Does anyone know what could be the issue? Am I doing something wrong?
Here is my full docker-compose.yaml:
services:
code-server:
image: linuxserver/code-server:4.96.1
container_name: code-server
restart: unless-stopped
#ports:
# - 8443:8443
volumes:
- ./config:/config
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Kyiv
labels:
- "traefik.enable=true"
- "traefik.http.routers.code-server.rule=Host(`vscode.example.com`)"
- "traefik.http.routers.code-server.entrypoints=https"
- "traefik.http.routers.code-server.tls=true"
- "traefik.http.services.code-server.loadbalancer.server.port=8443"
- "traefik.docker.network=traefik"
security_opt:
- no-new-privileges:true
networks:
traefik:
healthcheck:
# causes Code Server to fail
test: "curl -fksSL http://localhost:8443/healthz | grep -o alive || exit 1"
# works fine
# test: ['CMD', 'curl', '-fksSL', 'http://localhost:8443/healthz']
start_period: 60s
interval: 60s
timeout: 20s
retries: 3
networks:
traefik:
external: true
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 1 reply
-
expired just means nothing has connected to it recently, code-server is still up and running as long as you get any valid 200 response from that endpoint.
Beta Was this translation helpful? Give feedback.
All reactions
-
expired does seem confusing though. It probably should have been "inactive" instead.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1