Invidious stack in portainer 'Bad Gateway' error

Hi,
this is my invidious traefik stack.

services:

  invidious:
    image: quay.io/invidious/invidious:latest
    container_name: invidious
    restart: unless-stopped
    networks:
      - proxy
      - invidious
    volumes:
      - /etc/localtime:/etc/localtime:ro
    environment:
      INVIDIOUS_CONFIG: |
        db:
          dbname: invidious
          user: kemal
          password: kemal
          host: invidious-db
          port: 5432
        check_tables: true
        external_port: 443
        domain: invidious.example.com
        https_only: true
        statistics_enabled: false
#        signature_server: inv_sig_helper:12999
        hmac_key: "jkhasjkhjkas"
        visitor_data: ilasjljaskl
        po_token: askjaklsj

    logging:
      options:
        max-size: "1G"
        max-file: "4"
    depends_on:
      - invidious-db
      - inv_sig_helper

    labels:
      - traefik.enable=true
      - traefik.docker.network=proxy
      - traefik.http.routers.invidious.entrypoints=https
      - traefik.http.routers.invidious.rule=Host(`invidious.example.com`)
      - traefik.http.routers.invidious.middlewares=ipwhitelist@file,secureHeaders@file
      - traefik.http.routers.invidious.tls=true
      - traefik.http.services.invidious.loadbalancer.server.port=3000

  inv_sig_helper:
    container_name: inv_sig_helper
    image: quay.io/invidious/inv-sig-helper:latest
    command: ["--tcp", "0.0.0.0:12999"]
    environment:
      - RUST_LOG=info
    restart: unless-stopped
    networks:
      - invidious
    cap_drop:
      - ALL
    read_only: true
    security_opt:
      - no-new-privileges:true

  invidious-db:
    image: docker.io/library/postgres:14
    container_name: invidious-db
    restart: unless-stopped
    networks:
      - invidious
    volumes:
      - postgresdata:/var/lib/postgresql/data
      - ./config/sql:/config/sql
      - ./docker/init-invidious-db.sh:/docker-entrypoint-initdb.d/init-invidious-db.sh
      - /etc/localtime:/etc/localtime:ro
    environment:
      POSTGRES_DB: invidious
      POSTGRES_USER: kemal
      POSTGRES_PASSWORD: kemal
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]

volumes:
  postgresdata:
networks:
  proxy:
    external: true
  invidious:
    internal: true

This works and i can access the invidious instance via https://invidious.example.com

As soon as i uncomment the line

# signature_server: inv_sig_helper:12999

the browser shows 'Bad Gateway' when accessing the site.

Any ideas?

If it's about inv_sig_helper, it seems more like an application issue, not necessarily Traefik related.

If you think it’s Traefik related, you should have shared your full Traefik static and dynamic config.

Note that "Bad Gateway" usually happens when a target service has multiple network, which are not all shared with Traefik, and you have not set docker.network in static or dynamic config.

Yeah, i had that in mind as well, but tried posting here anyway, maybe somebody has had the same problem, because looking at the invidious github issues nobody seems to have an issue with the inv_sig_helper container, but nobody seems to use traefik either.

I have many stacks running behind the same traefik instance and its all running smoothly, so i doubt its a general traefik issue, more a specific issue running this invidious stack behind traefik.

The invidious container logs show, that it successfully found the inv_sig_helper container, so i guess that is working as intended.

No idea how to debug this.

Thanks for your reply.

apparently the inv_sig_helper container needs internet access as well so the working stack looks like this now.

services:

  invidious:
    image: quay.io/invidious/invidious:latest
    container_name: invidious
    restart: unless-stopped
    networks:
      - proxy
      - invidious
    volumes:
      - /etc/localtime:/etc/localtime:ro
    environment:
      INVIDIOUS_CONFIG: |
        db:
          dbname: invidious
          user: kemal
          password: kemal
          host: invidious-db
          port: 5432
        check_tables: true
        external_port: 443
        domain: invidious.example.com
        https_only: true
        statistics_enabled: false
#        signature_server: inv_sig_helper:12999
        hmac_key: "jkhasjkhjkas"
        visitor_data: ilasjljaskl
        po_token: askjaklsj

    logging:
      options:
        max-size: "1G"
        max-file: "4"
    depends_on:
      - invidious-db
      - inv_sig_helper

    labels:
      - traefik.enable=true
      - traefik.docker.network=proxy
      - traefik.http.routers.invidious.entrypoints=https
      - traefik.http.routers.invidious.rule=Host(`invidious.example.com`)
      - traefik.http.routers.invidious.middlewares=ipwhitelist@file,secureHeaders@file
      - traefik.http.routers.invidious.tls=true
      - traefik.http.services.invidious.loadbalancer.server.port=3000

  inv_sig_helper:
    container_name: inv_sig_helper
    image: quay.io/invidious/inv-sig-helper:latest
    command: ["--tcp", "0.0.0.0:12999"]
    environment:
      - RUST_LOG=info
    restart: unless-stopped
    networks:
      - invidious
      - proxy
    cap_drop:
      - ALL
    read_only: true
    security_opt:
      - no-new-privileges:true

  invidious-db:
    image: docker.io/library/postgres:14
    container_name: invidious-db
    restart: unless-stopped
    networks:
      - invidious
    volumes:
      - postgresdata:/var/lib/postgresql/data
      - ./config/sql:/config/sql
      - ./docker/init-invidious-db.sh:/docker-entrypoint-initdb.d/init-invidious-db.sh
      - /etc/localtime:/etc/localtime:ro
    environment:
      POSTGRES_DB: invidious
      POSTGRES_USER: kemal
      POSTGRES_PASSWORD: kemal
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]

volumes:
  postgresdata:
networks:
  proxy:
    external: true
  invidious:
    internal: true

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.