lloesche / valheim-server-docker

Valheim dedicated gameserver with automatic update, World backup, BepInEx and ValheimPlus mod support
https://hub.docker.com/r/lloesche/valheim-server
Apache License 2.0
1.96k stars 276 forks source link

Supervisor WebUI Gateway Error #382

Closed realdegrees closed 3 years ago

realdegrees commented 3 years ago

I am using docker-compose to run this image. The server runs fine and we've played on it for a few days. Now I wanted to enable to supervisor web UI for easier restarting. All supervisord functions work fine inside the container. The web UI always gives me a gateway error. Ports are open in UFW and everything works fine in other game containers which also provide web UIs.

This is my docker-compose

version: "3.8"
services:
  valheim:
    image: lloesche/valheim-server
    container_name: valheim
    ports:
      - "2456-2457:2456-2457/udp"
      - "9001:9001/tcp"
    volumes:
      - ~/games/valheim/config:/config
      - ~/games/valheim/data:/opt/valheim
    environment:
      - WORLD_NAME=[redacted]
      - SERVER_NAME=[redacted]
      - SERVER_PASS=[redacted]
      - SUPERVISOR_HTTP=true
      - SUPERVISOR_HTTP_PASS=[redacted]
    labels:
      traefik.enable: true
      traefik.http.routers.valheim.entrypoints: websecure
      traefik.http.routers.valheim.rule: Host(`valheim.domain.tld`)
      traefik.http.routers.valheim.tls: true
      traefik.http.services.valheim.loadbalancer.server.port: 9001
    networks: 
      - web
networks:
    web:
        external: true

Traefik has nothing to do with this error, my minecraft server running the exact same traefik config has no problem exposing its' web services. Here's that docker-compose for reference.

version: "3.8"
services:
  minecraft:
    image: docker.io/itzg/minecraft-server:java16
    container_name: minecraft
    ports:
      - "25565:25565"
      - "8100:8100"
    volumes:
      - ~/minecraft:/data
      - /etc/timezone:/etc/timezone:ro
    environment:
      EULA: "TRUE"
      TYPE: "PAPER"
    restart: always
    command: --noconsole
    labels:
      traefik.enable: true
      traefik.http.routers.bluemap.entrypoints: websecure
      traefik.http.routers.bluemap.rule: Host(`bluemap.domain.tld`)
      traefik.http.routers.bluemap.tls: true
      traefik.http.services.bluemap.loadbalancer.server.port: 8100
    networks: 
      - web
networks:
    web:
        external: true

It seems to me that the supervisord web UI just isn't running. I have already tried changing the port via the environment variable but that didn'T make a difference. However I think that the environment variable might not get passed to the container properly since the "LOG_FILTER" environment variables didn't change anything in the logs either, maybe there is a problem with that?

lloesche commented 3 years ago

What happens when you exec into the container and try something like curl localhost:9001?

The result should look like this:

root@8e9cc86c773f:/# curl localhost:9001
<head>
<title>Error response</title>
</head>
<body>
<h1>Error response</h1>
<p>Error code 401.
<p>Message: Unauthorized.
</body>

This should quickly tell us if the supervisor web UI is active or not.

Also check the container logs. One of the first lines should say something like

INFO - Supervisor http server activated
...
...
2021-07-22 10:04:26,397 INFO Included extra file "/usr/local/etc/supervisor/conf.d/http_server.conf" during parsing

which also indicates that the supervisor web server is being loaded.

lloesche commented 3 years ago

Closing for inactivity. Reopen if still an issue.