Traefik "router ... has no service" in CI
Traefik parsed your dynamic config and a router declares no service. A router must point at a service to forward traffic, so Traefik logs an error and drops the router.
What this error means
Traefik logs "error while building configuration" with "router X has no service" at startup or on a config reload, and the route does not work.
level=error msg="router my-router has no service" routerName=my-router@file
Common causes
The router omits the service field
The router block sets a rule and entrypoint but no service, so Traefik has no backend to forward to.
A typo in the service reference
The router names a service that does not match any defined service key, so Traefik treats it as missing.
How to fix it
Reference an existing service on the router
- Add a
service:key to the router pointing at a defined service. - Confirm the service name matches a key under
http.services. - Reload and confirm the router builds without error.
http:
routers:
my-router:
rule: "Host(`app.example.com`)"
service: my-service
services:
my-service:
loadBalancer:
servers:
- url: "http://127.0.0.1:8080"Validate dynamic config in CI
Run Traefik with the config in a dry start so a router missing its service fails the pipeline early.
traefik --configFile=traefik.yml --log.level=ERROR &
sleep 2 && grep -q "has no service" traefik.log && exit 1 || trueHow to prevent it
- Always pair a router with a defined service.
- Keep service names consistent between routers and services blocks.
- Lint dynamic config in CI before deploying.