Missing routers in traefik
To Reproduce
Pretty new to dokploy and loving it but about to give up on it due to one of the most interesting features to me.... domain handling for stacks.
Current vs. Expected behavior
I create domains (either traefik.me without SSL or letsencrypt ones) but even if I redeploy the stack/container after they just do not appear in traefik.
dns are validated, just keept getting a 404, then checked the traefik dashboard and the routers are just not defined.
Is it anyway to reset completely traefiks domain list so all certs and routes are recreated?
UPDATE: after a container reboot, traefik seems completely gone (?) I can access dokply interface via :3000 and apps are there but traefik seems gone. I'll have to resinstall or give up ;(
Provide environment information
LXC on debian 12
Dokploy latest
Which area(s) are affected? (Select all that apply)
Traefik
Are you deploying the applications where Dokploy is installed or on a remote server?
Same server where Dokploy is installed
Additional context
I activated traefik dashboard to confirm... none of the domains I create are there. This is a raw compose but had similar issues with templates.
Sometimes also with the project dashboard, main domain... need to access via :3000
No logs on traefik.
Tried restarting the container too.
This is my traefik.yml
global:
sendAnonymousUsage: false
providers:
swarm:
exposedByDefault: false
watch: true
docker:
exposedByDefault: false
watch: true
network: dokploy-network
file:
directory: /etc/dokploy/traefik/dynamic
watch: true
entryPoints:
web:
address: :80
websecure:
address: :443
http3:
advertisedPort: 443
http:
tls:
certResolver: letsencrypt
api:
insecure: true
certificatesResolvers:
letsencrypt:
acme:
email: [email protected]
storage: /etc/dokploy/traefik/dynamic/acme.json
httpChallenge:
entryPoint: web
Will you send a PR to fix it?
No
Hello, could you clarify this further? For example:
- I have the following Docker Compose: ....
- These environment variables:
- I have this domain configured and am using Cloudflare or another DNS provider.
Thanks
@Siumauricio I am also having a similar issue.
I am also facing the same issue. Steps to reproduce
- Deploy the compose file (raw) via
composemethod -> domain works - Deploy the same compose file via
stackmethod -> domain does not work
I am running a 3-managers-2-workers swarm set up.
Here's the compose file
services:
metabase:
image: metabase/metabase:v0.50.8
volumes:
- /dev/urandom:/dev/random:ro
environment:
MB_DB_TYPE: postgres
MB_DB_DBNAME: metabaseappdb
MB_DB_PORT: 5432
MB_DB_USER: metabase
MB_DB_PASS: mysecretpassword
MB_DB_HOST: postgres
healthcheck:
test: curl --fail -I http://localhost:3000/api/health || exit 1
interval: 15s
timeout: 5s
retries: 5
postgres:
image: postgres:14
environment:
POSTGRES_USER: metabase
POSTGRES_DB: metabaseappdb
POSTGRES_PASSWORD: mysecretpassword
Here's the Previewed Compose File in stack mode
services:
metabase:
image: metabase/metabase:v0.50.8
volumes:
- /dev/urandom:/dev/random:ro
environment:
MB_DB_TYPE: postgres
MB_DB_DBNAME: metabaseappdb
MB_DB_PORT: 5432
MB_DB_USER: metabase
MB_DB_PASS: mysecretpassword
MB_DB_HOST: postgres
healthcheck:
test: curl --fail -I http://localhost:3000/api/health || exit 1
interval: 15s
timeout: 5s
retries: 5
deploy:
labels:
- traefik.swarm.network=dokploy-network
- traefik.http.routers.hnnoncritical-metabase-qpbaqx-7-web.rule=Host(`hnnoncritical-metabase-qpbaqx-bd0ace-******.traefik.me`)
- traefik.http.routers.hnnoncritical-metabase-qpbaqx-7-web.entrypoints=web
- traefik.http.services.hnnoncritical-metabase-qpbaqx-7-web.loadbalancer.server.port=3000
- traefik.http.routers.hnnoncritical-metabase-qpbaqx-7-web.service=hnnoncritical-metabase-qpbaqx-7-web
- traefik.enable=true
networks:
- dokploy-network
postgres:
image: postgres:14
environment:
POSTGRES_USER: metabase
POSTGRES_DB: metabaseappdb
POSTGRES_PASSWORD: mysecretpassword
networks:
dokploy-network:
external: true
I tested again, and got it to work by hardcoding the labels inside the compose file.
There might by a bug where the Previewed Compose File with the labels is not being used for deploy.
I was having a similar issue: unable to get traefik dashboard to display new routers for template apps (umami v2.19.0 in my case), and solved as @HouseNowAdmin suggested: Hardcoding the Previewed Composed File labels to the undeployed compose file.
I'm encountering the same error, but when using the Compose deploy method.
My project consists of several services defined in different Compose files. Only one of these services is having trouble creating the Traefik routers. I tried your workaround of hardcoding the final version’s Compose file, but it still doesn’t work.
Inspecting the container, I can see that the labels are correctly applied. However, even after reloading Traefik, the route isn’t created, and no warnings or errors appear in the logs...
Hello, i may have found the problems
I noticed the health check on the examples I know I have one on my service so I try by just override in docker compose file example
healthcheck:
test: exit 0
interval: 15s
timeout: 5s
retries: 5
And my service works properly
I confirm it's the localhost not working inside the container. You can see the health status in the docker menu and in the show log of your container for more details of the error
Exactly! In my case, I had defined a health check for the service that used wget, but the container image didn’t include it. As a result, the service was marked as unhealthy, and Traefik didn’t create the router
What helped me identify the issue was setting the logging level to debug in the Traefik configuration
That's right, using an invalid or non-functioning health check will prevent Traefik from ever routing to the container.
I am also facing the same issue. Steps to reproduce
- Deploy the compose file (raw) via
composemethod -> domain works- Deploy the same compose file via
stackmethod -> domain does not workI am running a 3-managers-2-workers swarm set up.
Here's the compose file
services: metabase: image: metabase/metabase:v0.50.8 volumes: - /dev/urandom:/dev/random:ro environment: MB_DB_TYPE: postgres MB_DB_DBNAME: metabaseappdb MB_DB_PORT: 5432 MB_DB_USER: metabase MB_DB_PASS: mysecretpassword MB_DB_HOST: postgres healthcheck: test: curl --fail -I http://localhost:3000/api/health || exit 1 interval: 15s timeout: 5s retries: 5 postgres: image: postgres:14 environment: POSTGRES_USER: metabase POSTGRES_DB: metabaseappdb POSTGRES_PASSWORD: mysecretpassword Here's the Previewed Compose File in
stackmodeservices: metabase: image: metabase/metabase:v0.50.8 volumes: - /dev/urandom:/dev/random:ro environment: MB_DB_TYPE: postgres MB_DB_DBNAME: metabaseappdb MB_DB_PORT: 5432 MB_DB_USER: metabase MB_DB_PASS: mysecretpassword MB_DB_HOST: postgres healthcheck: test: curl --fail -I http://localhost:3000/api/health || exit 1 interval: 15s timeout: 5s retries: 5 deploy: labels: - traefik.swarm.network=dokploy-network - traefik.http.routers.hnnoncritical-metabase-qpbaqx-7-web.rule=Host(
hnnoncritical-metabase-qpbaqx-bd0ace-******.traefik.me) - traefik.http.routers.hnnoncritical-metabase-qpbaqx-7-web.entrypoints=web - traefik.http.services.hnnoncritical-metabase-qpbaqx-7-web.loadbalancer.server.port=3000 - traefik.http.routers.hnnoncritical-metabase-qpbaqx-7-web.service=hnnoncritical-metabase-qpbaqx-7-web - traefik.enable=true networks: - dokploy-network postgres: image: postgres:14 environment: POSTGRES_USER: metabase POSTGRES_DB: metabaseappdb POSTGRES_PASSWORD: mysecretpassword networks: dokploy-network: external: true
Quick catch there, you need to also join manually the postgres container to dokploy network in the compose file
I'll close this issue due to inactivity