# Invidious stack in portainer 'Bad Gateway' error

**URL:** <https://community.traefik.io/t/invidious-stack-in-portainer-bad-gateway-error/24582>\
**Category:** Traefik v3 (latest)\
**Tags:** docker\
**Created:** [September 27, 2024, 1:50pm UTC](https://community.traefik.io/t/invidious-stack-in-portainer-bad-gateway-error/24582 "2024-09-27T13:50:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kbhjkbhjggh](https://avatars.discourse-cdn.com/v4/letter/k/c5a1d2/32.png) [@kbhjkbhjggh](https://community.traefik.io/u/kbhjkbhjggh)\
**Post date:** [September 27, 2024, 1:50pm UTC](https://community.traefik.io/t/invidious-stack-in-portainer-bad-gateway-error/24582/1 "2024-09-27T13:50:22Z")

</div>

Hi,  
this is my invidious traefik stack.

```auto
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](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?

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [September 27, 2024, 5:20pm UTC](https://community.traefik.io/t/invidious-stack-in-portainer-bad-gateway-error/24582/2 "2024-09-27T17:20:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kbhjkbhjggh](https://avatars.discourse-cdn.com/v4/letter/k/c5a1d2/32.png) [@kbhjkbhjggh](https://community.traefik.io/u/kbhjkbhjggh)\
**Post date:** [September 27, 2024, 6:25pm UTC](https://community.traefik.io/t/invidious-stack-in-portainer-bad-gateway-error/24582/3 "2024-09-27T18:25:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kbhjkbhjggh](https://avatars.discourse-cdn.com/v4/letter/k/c5a1d2/32.png) [@kbhjkbhjggh](https://community.traefik.io/u/kbhjkbhjggh)\
**Post date:** [October 18, 2024, 12:07pm UTC](https://community.traefik.io/t/invidious-stack-in-portainer-bad-gateway-error/24582/4 "2024-10-18T12:07:06Z")

</div>

apparently the inv\_sig\_helper container needs internet access as well so the working stack looks like this now.

```auto
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

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/b/bd81ebdb578656e76e56ff3cc3eed021d3ba132d.png) [@system](https://community.traefik.io/u/system)\
**Post date:** [October 21, 2024, 12:07pm UTC](https://community.traefik.io/t/invidious-stack-in-portainer-bad-gateway-error/24582/5 "2024-10-21T12:07:56Z")

</div>

Closed on October 21, 2024, 12:07pm UTC

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