Issue with Planka and Traefik. #706

Closed
opened 2025-10-09 18:57:56 +03:00 by OVERLORD · 9 comments
Owner

Originally created by @Zeropeace on GitHub.

Hi all,

I want to run Planka in docker container with Traefik as a reverse Proxy . But i have encountered a problem. If i route Planka thru Traefik i can only get to the Log In page and then after i log in it keeps loading for ever. This does not occur when i acces it with the IP:PORT combo. I have added my docker-compose and traefik config. I also found a cryptic log from Traefik wich might be useful.

docker-compose:



version: '3'

services:
  planka:
    image: meltyshev/planka:latest
    command: >
      bash -c
        "for i in `seq 1 30`; do
          ./start.sh &&
          s=$$? && break || s=$$?;
          echo \"Tried $$i times. Waiting 5 seconds...\";
          sleep 5;
        done; (exit $$s)"
    restart: unless-stopped
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - user-avatars:/app/public/user-avatars
      - project-background-images:/app/public/project-background-images
      - attachments:/app/public/attachments
    networks:
      - proxy
    ports:
      - 3000:1337
    environment:
      - BASE_URL=http://planka.mydomain.com
      - DATABASE_URL=postgresql://postgres@postgres/planka
      - SECRET_KEY=added a realy secret key here
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.planka.entrypoints=http"
      - "traefik.http.routers.planka.rule=Host(`planka.mydomain.com`)"
      - "traefik.http.middlewares.planka-https-redirect.redirectscheme.scheme=https"
      - "traefik.http.routers.planka.middlewares=planka-https-redirect"
      - "traefik.http.routers.planka-secure.entrypoints=https"
      - "traefik.http.routers.planka-secure.rule=Host(`planka.mydomain.com`)"
      - "traefik.http.routers.planka-secure.tls=true"
      - "traefik.http.routers.planka-secure.service=planka"
      - "traefik.http.services.planka.loadbalancer.server.port=1337"
      - "traefik.docker.network=proxy"
    depends_on:
      - postgres

  postgres:
    image: postgres:alpine
    restart: unless-stopped
    volumes:
      - db-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=planka
      - POSTGRES_HOST_AUTH_METHOD=trust

volumes:
  user-avatars:
  project-background-images:
  attachments:
  db-data:

networks:
  proxy:
    external: true

Traefik config: 

http:
  routers:
    pihole:
      entryPoints:
        - "https"
        - "http"
      rule: "Host(`pihole.my.domain`)"
      middlewares:
        - default-headers
        - addprefix-pihole
      tls: {}
      service: pihole
    heimdall:
      entryPoints:
        - "https"
        - "http"
      rule: "Host(`heimdall.my.domain`)"
      middlewares:
        - default-headers
      tls: {}
      service: heimdall
    wq:
      entryPoints:
        - "https"
        - "http"
      rule: "Host(`wq.my.domain`)"
      middlewares:
        - default-headers
      tls: {}
      service: wq
    planka:
      entryPoints:
        - "https"
        - "http"
      rule: "Host(`planka.my.domain`)"
      middlewares:
        - default-headers
      tls: {}
      service: planka

  services:
    pihole:
      loadBalancer:
        servers:
          - url: "http://192.168.178.65:80"
        passHostHeader: true
    heimdall:
      loadBalancer:
        servers:
          - url: "http://192.168.178.52:8080"
        passHostHeader: true
    wq:
      loadBalancer:
        servers:
          - url: "http://192.168.178.43:3000"
        passHostHeader: true
    planka:
      loadBalancer:
        servers:
          - url: "http://192.168.178.85:3000"
        passHostHeader: true

  middlewares:
    addprefix-pihole:
      addPrefix:
        prefix: "/admin"
    https-redirect:
      redirectScheme:
        scheme: https

    default-headers:
      headers:
        frameDeny: true
        sslRedirect: true
        browserXssFilter: true
        contentTypeNosniff: true
        forceSTSHeader: true
        stsIncludeSubdomains: true
        stsPreload: true
        stsSeconds: 15552000
        customFrameOptionsValue: SAMEORIGIN
        customRequestHeaders:
          X-Forwarded-Proto: https

    default-whitelist:
      ipWhiteList:
        sourceRange:
        - "10.0.0.0/24"
        - "192.168.0.0/16"
        - "172.0.0.0/8"

    secured:
      chain:
        middlewares:
        - default-whitelist
        - default-headers

Screenshot 2021-08-30 230220

Originally created by @Zeropeace on GitHub. Hi all, I want to run Planka in docker container with Traefik as a reverse Proxy . But i have encountered a problem. If i route Planka thru Traefik i can only get to the Log In page and then after i log in it keeps loading for ever. This does not occur when i acces it with the IP:PORT combo. I have added my docker-compose and traefik config. I also found a cryptic log from Traefik wich might be useful. ``` docker-compose: version: '3' services: planka: image: meltyshev/planka:latest command: > bash -c "for i in `seq 1 30`; do ./start.sh && s=$$? && break || s=$$?; echo \"Tried $$i times. Waiting 5 seconds...\"; sleep 5; done; (exit $$s)" restart: unless-stopped volumes: - /etc/localtime:/etc/localtime:ro - /var/run/docker.sock:/var/run/docker.sock:ro - user-avatars:/app/public/user-avatars - project-background-images:/app/public/project-background-images - attachments:/app/public/attachments networks: - proxy ports: - 3000:1337 environment: - BASE_URL=http://planka.mydomain.com - DATABASE_URL=postgresql://postgres@postgres/planka - SECRET_KEY=added a realy secret key here labels: - "traefik.enable=true" - "traefik.http.routers.planka.entrypoints=http" - "traefik.http.routers.planka.rule=Host(`planka.mydomain.com`)" - "traefik.http.middlewares.planka-https-redirect.redirectscheme.scheme=https" - "traefik.http.routers.planka.middlewares=planka-https-redirect" - "traefik.http.routers.planka-secure.entrypoints=https" - "traefik.http.routers.planka-secure.rule=Host(`planka.mydomain.com`)" - "traefik.http.routers.planka-secure.tls=true" - "traefik.http.routers.planka-secure.service=planka" - "traefik.http.services.planka.loadbalancer.server.port=1337" - "traefik.docker.network=proxy" depends_on: - postgres postgres: image: postgres:alpine restart: unless-stopped volumes: - db-data:/var/lib/postgresql/data environment: - POSTGRES_DB=planka - POSTGRES_HOST_AUTH_METHOD=trust volumes: user-avatars: project-background-images: attachments: db-data: networks: proxy: external: true ``` ``` Traefik config: http: routers: pihole: entryPoints: - "https" - "http" rule: "Host(`pihole.my.domain`)" middlewares: - default-headers - addprefix-pihole tls: {} service: pihole heimdall: entryPoints: - "https" - "http" rule: "Host(`heimdall.my.domain`)" middlewares: - default-headers tls: {} service: heimdall wq: entryPoints: - "https" - "http" rule: "Host(`wq.my.domain`)" middlewares: - default-headers tls: {} service: wq planka: entryPoints: - "https" - "http" rule: "Host(`planka.my.domain`)" middlewares: - default-headers tls: {} service: planka services: pihole: loadBalancer: servers: - url: "http://192.168.178.65:80" passHostHeader: true heimdall: loadBalancer: servers: - url: "http://192.168.178.52:8080" passHostHeader: true wq: loadBalancer: servers: - url: "http://192.168.178.43:3000" passHostHeader: true planka: loadBalancer: servers: - url: "http://192.168.178.85:3000" passHostHeader: true middlewares: addprefix-pihole: addPrefix: prefix: "/admin" https-redirect: redirectScheme: scheme: https default-headers: headers: frameDeny: true sslRedirect: true browserXssFilter: true contentTypeNosniff: true forceSTSHeader: true stsIncludeSubdomains: true stsPreload: true stsSeconds: 15552000 customFrameOptionsValue: SAMEORIGIN customRequestHeaders: X-Forwarded-Proto: https default-whitelist: ipWhiteList: sourceRange: - "10.0.0.0/24" - "192.168.0.0/16" - "172.0.0.0/8" secured: chain: middlewares: - default-whitelist - default-headers ``` ![Screenshot 2021-08-30 230220](https://user-images.githubusercontent.com/73104116/131405215-ea1cf546-10cd-4203-8da0-5e9218eb778c.png)
Author
Owner

@nickbe commented on GitHub:

I don't think anyone has ever tested Traefik. But anyway Traefik is supposed to detect the needed configuration as far as I know. If it doesn't (and I quote from its community) you're more than often fucked. There's simply not the time to experiment with non-standard proxy software. Sorry

@nickbe commented on GitHub: I don't think anyone has ever tested Traefik. But anyway Traefik is supposed to detect the needed configuration as far as I know. If it doesn't (and I quote from its community) you're more than often fucked. There's simply not the time to experiment with non-standard proxy software. Sorry
Author
Owner

@Underknowledge commented on GitHub:

Have been fighting this for a couple of hours now. apparently the planka container has issues with multiple networks

planka_1    | Error: connect EHOSTUNREACH 192.168.0.2:5432
planka_1    |     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1138:16) {
planka_1    |   errno: -113,
planka_1    |   code: 'EHOSTUNREACH',
planka_1    |   syscall: 'connect',
planka_1    |   address: '192.168.0.2',
planka_1    |   port: 5432
planka_1    | }

at some point I tryed to bindmount the Unix socket into the container, but the DATABASE_URL didn't took this and always failed back to localhost, bummer..

not working:

version: '3'

# as per https://github.com/plankanban/planka/blob/master/docker-compose.yml
services:
  planka:
    image: meltyshev/planka:latest
    command: >
      bash -c
        "for i in `seq 1 30`; do
          ./start.sh &&
          s=$$? && break || s=$$?;
          echo \"Tried $$i times. Waiting 5 seconds...\";
          sleep 5;
        done; (exit $$s)"
    restart: unless-stopped
    volumes:
      - ${PROJECT_FOLDER}/user-avatars:/app/public/user-avatars
      - ${PROJECT_FOLDER}/project-background-images:/app/public/project-background-images
      - ${PROJECT_FOLDER}/attachments:/app/public/attachments
      - ${PROJECT_FOLDER}/pg-run:/var/run/postgresql 
    env_file:
      - ${PROJECT_FOLDER}/.env
#    ports:
#      - 3000:1337
    networks:
      - traefik
      - internal_planka
    environment:
      - BASE_URL=${BASE_URL}
      - TRUST_PROXY=0
      - DATABASE_URL=postgresql://postgres@postgres_planka/planka
      - SECRET_KEY=${SECRET_KEY}
    depends_on:
      - postgres_planka
    labels:
      - traefik.http.routers.planka.rule=Host(`kanban.${DOMAINNAME}`)
      - traefik.http.services.planka.loadbalancer.server.port=1337
      - traefik.docker.network=traefik


  postgres_planka: 
    image: postgres:alpine
    container_name: postgres_planka
    restart: unless-stopped
    volumes:
      - ${PROJECT_FOLDER}/db-data:/var/lib/postgresql/data
    networks:
      - internal_planka
#    expose: # no diffrence
#      - 5432
    environment:
      - POSTGRES_DB=planka
      - POSTGRES_HOST_AUTH_METHOD=trust

networks:
  internal_planka:
    name: internal_planka
    internal: true
  traefik:
    name: traefik
    external: true

working:

version: '3'

# as per https://github.com/plankanban/planka/blob/master/docker-compose.yml
services:
  planka:
    image: meltyshev/planka:latest
    command: >
      bash -c
        "for i in `seq 1 30`; do
          ./start.sh &&
          s=$$? && break || s=$$?;
          echo \"Tried $$i times. Waiting 5 seconds...\";
          sleep 5;
        done; (exit $$s)"
    restart: unless-stopped
    volumes:
      - ${PROJECT_FOLDER}/user-avatars:/app/public/user-avatars
      - ${PROJECT_FOLDER}/project-background-images:/app/public/project-background-images
      - ${PROJECT_FOLDER}/attachments:/app/public/attachments
      - ${PROJECT_FOLDER}/pg-run:/var/run/postgresql 
    env_file:
      - ${PROJECT_FOLDER}/.env
#    ports:
#      - 3000:1337
    networks:
      - traefik
    environment:
      - BASE_URL=${BASE_URL}
      - TRUST_PROXY=0
      - DATABASE_URL=postgresql://postgres@postgres_planka/planka
      - SECRET_KEY=${SECRET_KEY}
    depends_on:
      - postgres_planka
    labels:
      - traefik.http.routers.planka.rule=Host(`kanban.${DOMAINNAME}`)
      - traefik.http.services.planka.loadbalancer.server.port=1337
      - traefik.docker.network=traefik


  postgres_planka: 
    image: postgres:alpine
    container_name: postgres_planka
    restart: unless-stopped
    volumes:
      - ${PROJECT_FOLDER}/db-data:/var/lib/postgresql/data
    networks:
      - traefik
#    expose: # no diffrence
#      - 5432
    environment:
      - POSTGRES_DB=planka
      - POSTGRES_HOST_AUTH_METHOD=trust

networks:
  traefik:
    name: traefik
    external: true

Why this is the case, I really have no idea.
The only container that displayed this absurd behaviour was keycloak.

on a personal note,
@loranger cool trick with the collapsible code snippets, when I try it the shared code gets all wonky, care to share how you did this?

@Underknowledge commented on GitHub: Have been fighting this for a couple of hours now. apparently the planka container has issues with multiple networks ``` planka_1 | Error: connect EHOSTUNREACH 192.168.0.2:5432 planka_1 | at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1138:16) { planka_1 | errno: -113, planka_1 | code: 'EHOSTUNREACH', planka_1 | syscall: 'connect', planka_1 | address: '192.168.0.2', planka_1 | port: 5432 planka_1 | } ``` at some point I tryed to bindmount the `Unix socket` into the container, but the `DATABASE_URL` didn't took this and always failed back to localhost, bummer.. not working: ```yaml version: '3' # as per https://github.com/plankanban/planka/blob/master/docker-compose.yml services: planka: image: meltyshev/planka:latest command: > bash -c "for i in `seq 1 30`; do ./start.sh && s=$$? && break || s=$$?; echo \"Tried $$i times. Waiting 5 seconds...\"; sleep 5; done; (exit $$s)" restart: unless-stopped volumes: - ${PROJECT_FOLDER}/user-avatars:/app/public/user-avatars - ${PROJECT_FOLDER}/project-background-images:/app/public/project-background-images - ${PROJECT_FOLDER}/attachments:/app/public/attachments - ${PROJECT_FOLDER}/pg-run:/var/run/postgresql env_file: - ${PROJECT_FOLDER}/.env # ports: # - 3000:1337 networks: - traefik - internal_planka environment: - BASE_URL=${BASE_URL} - TRUST_PROXY=0 - DATABASE_URL=postgresql://postgres@postgres_planka/planka - SECRET_KEY=${SECRET_KEY} depends_on: - postgres_planka labels: - traefik.http.routers.planka.rule=Host(`kanban.${DOMAINNAME}`) - traefik.http.services.planka.loadbalancer.server.port=1337 - traefik.docker.network=traefik postgres_planka: image: postgres:alpine container_name: postgres_planka restart: unless-stopped volumes: - ${PROJECT_FOLDER}/db-data:/var/lib/postgresql/data networks: - internal_planka # expose: # no diffrence # - 5432 environment: - POSTGRES_DB=planka - POSTGRES_HOST_AUTH_METHOD=trust networks: internal_planka: name: internal_planka internal: true traefik: name: traefik external: true ``` --- working: ```yaml version: '3' # as per https://github.com/plankanban/planka/blob/master/docker-compose.yml services: planka: image: meltyshev/planka:latest command: > bash -c "for i in `seq 1 30`; do ./start.sh && s=$$? && break || s=$$?; echo \"Tried $$i times. Waiting 5 seconds...\"; sleep 5; done; (exit $$s)" restart: unless-stopped volumes: - ${PROJECT_FOLDER}/user-avatars:/app/public/user-avatars - ${PROJECT_FOLDER}/project-background-images:/app/public/project-background-images - ${PROJECT_FOLDER}/attachments:/app/public/attachments - ${PROJECT_FOLDER}/pg-run:/var/run/postgresql env_file: - ${PROJECT_FOLDER}/.env # ports: # - 3000:1337 networks: - traefik environment: - BASE_URL=${BASE_URL} - TRUST_PROXY=0 - DATABASE_URL=postgresql://postgres@postgres_planka/planka - SECRET_KEY=${SECRET_KEY} depends_on: - postgres_planka labels: - traefik.http.routers.planka.rule=Host(`kanban.${DOMAINNAME}`) - traefik.http.services.planka.loadbalancer.server.port=1337 - traefik.docker.network=traefik postgres_planka: image: postgres:alpine container_name: postgres_planka restart: unless-stopped volumes: - ${PROJECT_FOLDER}/db-data:/var/lib/postgresql/data networks: - traefik # expose: # no diffrence # - 5432 environment: - POSTGRES_DB=planka - POSTGRES_HOST_AUTH_METHOD=trust networks: traefik: name: traefik external: true ``` Why this is the case, I really have no idea. The only container that displayed this absurd behaviour was keycloak. on a personal note, @loranger cool trick with the collapsible code snippets, when I try it the shared code gets all wonky, care to share how you did this?
Author
Owner

@johnchristopher commented on GitHub:

I want to run Planka in docker container with Traefik as a reverse Proxy . But i have encountered a problem. If i route Planka thru Traefik i can only get to the Log In page and then after i log in it keeps loading for ever. This does not occur when i acces it with the IP:PORT combo. I have added my docker-compose and traefik config. I also found a cryptic log from Traefik wich might be useful.

Here's an alternative: run Traefik in a container. It's easier to manage your services and network, no IP or port to configure on your host.

If you want I can dust off a pi and give you a running config for both Traefik and Planka.

The configuration you posted is a bit weird to me because I read some pihole and plank.my.domain in the same Traefik config but you can't run it on a local network in front of a pihole and on public server. What's your network setup ?

What it means is that your planka container's IP may change everytime you recreate the container:

     planka:
      loadBalancer:
        servers:
          - url: "http://192.168.178.85:3000"

Traefik can only read a container's labels when linked to the docker socket.

@johnchristopher commented on GitHub: > I want to run Planka in docker container with Traefik as a reverse Proxy . But i have encountered a problem. If i route Planka thru Traefik i can only get to the Log In page and then after i log in it keeps loading for ever. This does not occur when i acces it with the IP:PORT combo. I have added my docker-compose and traefik config. I also found a cryptic log from Traefik wich might be useful. Here's an alternative: run Traefik in a container. It's easier to manage your services and network, no IP or port to configure on your host. If you want I can dust off a pi and give you a running config for both Traefik and Planka. The configuration you posted is a bit weird to me because I read some pihole and plank.my.domain in the same Traefik config but you can't run it on a local network in front of a pihole and on public server. What's your network setup ? What it means is that your planka container's IP may change everytime you recreate the container: ``` planka: loadBalancer: servers: - url: "http://192.168.178.85:3000" ``` Traefik can only read a container's labels when linked to the docker socket.
Author
Owner

@shamoon commented on GitHub:

Yea as he said, in so many words, traefik is awesome when it just works but a little mysterious when it doesnt. I have it working in my setup FWIW (+ authelia), biggest difference is I use traefik docker labels which does the auto configuration magic, see below in case it helps you...

  planka:
    image: meltyshev/planka:latest
    container_name: planka
    command: >
      bash -c
        "for i in `seq 1 30`; do
          ./start.sh &&
          s=$$? && break || s=$$?;
          echo \"Tried $$i times. Waiting 5 seconds...\";
          sleep 5;
        done; (exit $$s)"
    restart: unless-stopped
    volumes:
      - /path/to/planka/avatars:/app/public/user-avatars
      - /path/to/planka/background-images:/app/public/project-background-images
      - /path/to/planka/attachments:/app/public/attachments
    ports:
      - 1337:1337
    environment:
      - BASE_URL=https://tasks.domain.com
      - DATABASE_URL=postgresql://postgres@planka-db/planka
      - SECRET_KEY=***
    depends_on:
      - planka-db
    networks:
      - macvlan_network
      - traefik_proxy
      - default
    labels:
      - traefik.http.routers.planka.rule=Host(`tasks.domain.com`)
      - traefik.http.routers.planka.tls.certresolver=le
      - traefik.http.routers.planka.entrypoints=websecure
      - traefik.http.routers.planka.middlewares=chain-authelia
      - traefik.http.services.planka.loadbalancer.server.port=1337
      - traefik.docker.network=traefik_proxy
@shamoon commented on GitHub: Yea as he said, in so many words, traefik is awesome when it just works but a little mysterious when it doesnt. I have it working in my setup FWIW (+ authelia), biggest difference is I use traefik docker labels which does the auto configuration magic, see below in case it helps you... ``` planka: image: meltyshev/planka:latest container_name: planka command: > bash -c "for i in `seq 1 30`; do ./start.sh && s=$$? && break || s=$$?; echo \"Tried $$i times. Waiting 5 seconds...\"; sleep 5; done; (exit $$s)" restart: unless-stopped volumes: - /path/to/planka/avatars:/app/public/user-avatars - /path/to/planka/background-images:/app/public/project-background-images - /path/to/planka/attachments:/app/public/attachments ports: - 1337:1337 environment: - BASE_URL=https://tasks.domain.com - DATABASE_URL=postgresql://postgres@planka-db/planka - SECRET_KEY=*** depends_on: - planka-db networks: - macvlan_network - traefik_proxy - default labels: - traefik.http.routers.planka.rule=Host(`tasks.domain.com`) - traefik.http.routers.planka.tls.certresolver=le - traefik.http.routers.planka.entrypoints=websecure - traefik.http.routers.planka.middlewares=chain-authelia - traefik.http.services.planka.loadbalancer.server.port=1337 - traefik.docker.network=traefik_proxy ```
Author
Owner

@loranger commented on GitHub:

I use traefik as a container, auto-discovering docker containers.
I also had this forever loading bug until I changed the BASE_URLenvironment variable, matching the https (instead of http) traefik rule I defined in order to make planka reachable from outside.

My conf is a little bit different, but in case it may help, here it is

.env
APP_PROJECT=planka
APP_DOMAIN=kanban.my.domain

POSTGRES_HOST=${APP_PROJECT}-postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=planka
# POSTGRES_HOST_AUTH_METHOD=trust

BASE_URL=https://${APP_DOMAIN}
DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}/${POSTGRES_DB}
SECRET_KEY=my-secret-key
docker-compose.yml
version: '3'

services:
  planka:
    image: meltyshev/planka:latest
    command: >
      bash -c
        "for i in `seq 1 30`; do
          ./start.sh &&
          s=$$? && break || s=$$?;
          echo \"Tried $$i times. Waiting 5 seconds...\";
          sleep 5;
        done; (exit $$s)"
    restart: unless-stopped
    volumes:
      - user-avatars:/app/public/user-avatars
      - project-background-images:/app/public/project-background-images
      - attachments:/app/public/attachments
    # ports:
    #   - 3000:1337
    env_file:
      - .env
    labels:
      - "traefik.http.routers.${APP_PROJECT}.entrypoints=http"
      - "traefik.http.routers.${APP_PROJECT}.rule=Host(`${APP_DOMAIN}`)"
      - "traefik.http.routers.${APP_PROJECT}.middlewares=redirect-without-www@file,redirect-to-https@file"
      - "traefik.http.routers.${APP_PROJECT}-secure.entrypoints=https"
      - "traefik.http.routers.${APP_PROJECT}-secure.rule=Host(`${APP_DOMAIN}`)"
      - "traefik.http.routers.${APP_PROJECT}-secure.tls=true"
      - "traefik.http.routers.${APP_PROJECT}-secure.tls.certresolver=letsencrypt"
      - "traefik.http.routers.${APP_PROJECT}-secure.middlewares=redirect-without-www@file"
      - "com.centurylinklabs.watchtower.enable=true"
    depends_on:
      - postgres

  postgres:
    image: postgres:alpine
    restart: unless-stopped
    container_name: ${APP_PROJECT}-postgres
    volumes:
      - db-data:/var/lib/postgresql/data
    env_file:
      - .env
    labels:
      - "traefik.enable=false"

volumes:
  user-avatars:
  project-background-images:
  attachments:
  db-data:

networks:
  default:
    name: traefik-shared-network
@loranger commented on GitHub: I use traefik as a container, auto-discovering docker containers. I also had this _forever loading_ bug until I changed the `BASE_URL`environment variable, matching the **https** (instead of **http**) traefik rule I defined in order to make planka reachable from outside. My conf is a little bit different, but in case it may help, here it is <details> <summary> <code>.env</code> </summary> ```shell APP_PROJECT=planka APP_DOMAIN=kanban.my.domain POSTGRES_HOST=${APP_PROJECT}-postgres POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres POSTGRES_DB=planka # POSTGRES_HOST_AUTH_METHOD=trust BASE_URL=https://${APP_DOMAIN} DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}/${POSTGRES_DB} SECRET_KEY=my-secret-key ``` </details> <details> <summary> <code>docker-compose.yml</code> </summary> ```yaml version: '3' services: planka: image: meltyshev/planka:latest command: > bash -c "for i in `seq 1 30`; do ./start.sh && s=$$? && break || s=$$?; echo \"Tried $$i times. Waiting 5 seconds...\"; sleep 5; done; (exit $$s)" restart: unless-stopped volumes: - user-avatars:/app/public/user-avatars - project-background-images:/app/public/project-background-images - attachments:/app/public/attachments # ports: # - 3000:1337 env_file: - .env labels: - "traefik.http.routers.${APP_PROJECT}.entrypoints=http" - "traefik.http.routers.${APP_PROJECT}.rule=Host(`${APP_DOMAIN}`)" - "traefik.http.routers.${APP_PROJECT}.middlewares=redirect-without-www@file,redirect-to-https@file" - "traefik.http.routers.${APP_PROJECT}-secure.entrypoints=https" - "traefik.http.routers.${APP_PROJECT}-secure.rule=Host(`${APP_DOMAIN}`)" - "traefik.http.routers.${APP_PROJECT}-secure.tls=true" - "traefik.http.routers.${APP_PROJECT}-secure.tls.certresolver=letsencrypt" - "traefik.http.routers.${APP_PROJECT}-secure.middlewares=redirect-without-www@file" - "com.centurylinklabs.watchtower.enable=true" depends_on: - postgres postgres: image: postgres:alpine restart: unless-stopped container_name: ${APP_PROJECT}-postgres volumes: - db-data:/var/lib/postgresql/data env_file: - .env labels: - "traefik.enable=false" volumes: user-avatars: project-background-images: attachments: db-data: networks: default: name: traefik-shared-network ``` </details>
Author
Owner

@loranger commented on GitHub:

5432 is the PostgreSQL default port.
It could be postgres which is not started, or incorrect credentials or connections not allowed from 192.168.0.2.
The latter should be the real issue because planka seems working fine with one network only.
I'm no specialist, but you should take a look at the postgresql conf (maybe pg_hba.conf file) use by default inside postgres:alpine image

Regarding the collapsible markup, you should take a look at the cheatsheet and then figure out your code was certainly messy because of the missing blank lines. Now you can use it as soon as you have too much lines to share. At least that's what I do ;)

@loranger commented on GitHub: `5432` is the PostgreSQL default port. It could be postgres which is not started, or incorrect credentials or connections not allowed from 192.168.0.2. The latter should be the real issue because planka seems working fine with one network only. I'm no specialist, but you should take a look at the postgresql conf (maybe pg_hba.conf file) use by default inside postgres:alpine image Regarding the collapsible markup, you should take a look at the [cheatsheet](https://michaelcurrin.github.io/dev-cheatsheets/cheatsheets/markdown/collapsible-items.html) and then figure out your code was certainly messy because of the missing blank lines. Now you can use it as soon as you have too much lines to share. At least that's what I do ;)
Author
Owner

@Underknowledge commented on GitHub:

I installed telnet inside of the app container and tried to reach the the PG database.
I think I was getting a Connection refused but cant be certain anymore. The resolved IP was right, but even a nmap scan didn't showed a open PG port.
But on the other side, the name resolution works. I thought the POSTGRES_HOST_AUTH_METHOD var would work around this.
Had like 15 edidts, but the yaml code-block just thew up on my tryes .

test title, ignore me

version: '3'

as per https://github.com/plankanban/planka/blob/master/docker-compose.yml

services:
planka:
image: meltyshev/planka:latest
command: >
bash -c
"for i in seq 1 30; do
./start.sh &&
s=? && break || s=?;
echo "Tried $$i times. Waiting 5 seconds...";
sleep 5;
done; (exit $$s)"
restart: unless-stopped
volumes:
- ${PROJECT_FOLDER}/user-avatars:/app/public/user-avatars
- ${PROJECT_FOLDER}/project-background-images:/app/public/project-background-images
- ${PROJECT_FOLDER}/attachments:/app/public/attachments
- ${PROJECT_FOLDER}/pg-run:/var/run/postgresql
env_file:
- ${PROJECT_FOLDER}/.env

ports:

- 3000:1337

networks:
  - traefik
environment:
  - BASE_URL=${BASE_URL}
  - TRUST_PROXY=0
  - DATABASE_URL=postgresql://postgres@postgres_planka/planka
  - SECRET_KEY=${SECRET_KEY}
depends_on:
  - postgres_planka
labels:
  - traefik.http.routers.planka.rule=Host(`kanban.${DOMAINNAME}`)
  - traefik.http.services.planka.loadbalancer.server.port=1337
  - traefik.docker.network=traefik

postgres_planka:
image: postgres:alpine
container_name: postgres_planka
restart: unless-stopped
volumes:
- ${PROJECT_FOLDER}/db-data:/var/lib/postgresql/data
networks:
- traefik

expose: # no diffrence

- 5432

environment:
  - POSTGRES_DB=planka
  - POSTGRES_HOST_AUTH_METHOD=trust

networks:
traefik:
name: traefik
external: true

edit: yea, still looks like ****

edit:
Didnt closed the shell window

/app # bash
bash-5.0# telnet postgres_planka
telnet: can't connect to remote host (172.28.0.2): Host is unreachable
bash-5.0# telnet postgres_planka ^C
bash-5.0# ^C
bash-5.0# ping postgres_planka
PING postgres_planka (172.28.0.2): 56 data bytes
64 bytes from 172.28.0.2: seq=0 ttl=64 time=0.112 ms
64 bytes from 172.28.0.2: seq=1 ttl=64 time=0.221 ms
^C
--- postgres_planka ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.112/0.166/0.221 ms
bash-5.0# telnet postgres_planka
telnet: can't connect to remote host (172.28.0.2): Host is unreachable
bash-5.0# telnet postgres_planka 5432
telnet: can't connect to remote host (172.28.0.2): Host is unreachable
Host is up (0.00011s latency).
rDNS record for 172.28.0.2: postgres_planka.kanban-planka_internal
All 1000 scanned ports on postgres_planka (172.28.0.2) are filtered
MAC Address: 02:42:AC:1C:00:02 (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 5.54 seconds
@Underknowledge commented on GitHub: I installed telnet inside of the app container and tried to reach the the PG database. I think I was getting a ` Connection refused ` but cant be certain anymore. The resolved IP was right, but even a nmap scan didn't showed a open PG port. But on the other side, the name resolution works. I thought the `POSTGRES_HOST_AUTH_METHOD` var would work around this. Had like 15 edidts, but the yaml code-block just thew up on my tryes . <details> <summary><b>test title, ignore me</b></summary> version: '3' # as per https://github.com/plankanban/planka/blob/master/docker-compose.yml services: planka: image: meltyshev/planka:latest command: > bash -c "for i in `seq 1 30`; do ./start.sh && s=$$? && break || s=$$?; echo \"Tried $$i times. Waiting 5 seconds...\"; sleep 5; done; (exit $$s)" restart: unless-stopped volumes: - ${PROJECT_FOLDER}/user-avatars:/app/public/user-avatars - ${PROJECT_FOLDER}/project-background-images:/app/public/project-background-images - ${PROJECT_FOLDER}/attachments:/app/public/attachments - ${PROJECT_FOLDER}/pg-run:/var/run/postgresql env_file: - ${PROJECT_FOLDER}/.env # ports: # - 3000:1337 networks: - traefik environment: - BASE_URL=${BASE_URL} - TRUST_PROXY=0 - DATABASE_URL=postgresql://postgres@postgres_planka/planka - SECRET_KEY=${SECRET_KEY} depends_on: - postgres_planka labels: - traefik.http.routers.planka.rule=Host(`kanban.${DOMAINNAME}`) - traefik.http.services.planka.loadbalancer.server.port=1337 - traefik.docker.network=traefik postgres_planka: image: postgres:alpine container_name: postgres_planka restart: unless-stopped volumes: - ${PROJECT_FOLDER}/db-data:/var/lib/postgresql/data networks: - traefik # expose: # no diffrence # - 5432 environment: - POSTGRES_DB=planka - POSTGRES_HOST_AUTH_METHOD=trust networks: traefik: name: traefik external: true </details> edit: yea, still looks like **** edit: Didnt closed the shell window ```bash /app # bash bash-5.0# telnet postgres_planka telnet: can't connect to remote host (172.28.0.2): Host is unreachable bash-5.0# telnet postgres_planka ^C bash-5.0# ^C bash-5.0# ping postgres_planka PING postgres_planka (172.28.0.2): 56 data bytes 64 bytes from 172.28.0.2: seq=0 ttl=64 time=0.112 ms 64 bytes from 172.28.0.2: seq=1 ttl=64 time=0.221 ms ^C --- postgres_planka ping statistics --- 2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max = 0.112/0.166/0.221 ms bash-5.0# telnet postgres_planka telnet: can't connect to remote host (172.28.0.2): Host is unreachable bash-5.0# telnet postgres_planka 5432 telnet: can't connect to remote host (172.28.0.2): Host is unreachable ``` ```bash Host is up (0.00011s latency). rDNS record for 172.28.0.2: postgres_planka.kanban-planka_internal All 1000 scanned ports on postgres_planka (172.28.0.2) are filtered MAC Address: 02:42:AC:1C:00:02 (Unknown) Nmap done: 1 IP address (1 host up) scanned in 5.54 seconds ```
Author
Owner

@itobetter commented on GitHub:

hi guys i have the same error, my solution it was set the same BASE_URL as traefik.http.routers.server.rule traefik parameter, in others worlds

@itobetter commented on GitHub: hi guys i have the same error, my solution it was set the same BASE_URL as traefik.http.routers.server.rule traefik parameter, in others worlds
Author
Owner

@PPC-Toolz commented on GitHub:

Hi, I do not use labels, but config.yaml and I faced the same problem
My default headers Middleware configuration

    default-headers:
      headers:
        frameDeny: true
        browserXssFilter: true
        contentTypeNosniff: true
        forceSTSHeader: true
        stsIncludeSubdomains: true
        stsPreload: true
        stsSeconds: 15552000
        customFrameOptionsValue: SAMEORIGIN
        customRequestHeaders:
          X-Forwarded-Proto: https

So my problem was related to - BASE_URL in docker-compose.yml
it should be https and someboard.yourdomain.com

  • BASE_URL=https:/someboard.yourdomain.com
@PPC-Toolz commented on GitHub: Hi, I do not use labels, but config.yaml and I faced the same problem My default headers Middleware configuration ``` default-headers: headers: frameDeny: true browserXssFilter: true contentTypeNosniff: true forceSTSHeader: true stsIncludeSubdomains: true stsPreload: true stsSeconds: 15552000 customFrameOptionsValue: SAMEORIGIN customRequestHeaders: X-Forwarded-Proto: https ``` So my problem was related to - BASE_URL in docker-compose.yml it should be https and someboard.yourdomain.com - BASE_URL=https:/someboard.yourdomain.com
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#706