Skip to content
Latchkey

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.

traefik
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

  1. Add a service: key to the router pointing at a defined service.
  2. Confirm the service name matches a key under http.services.
  3. Reload and confirm the router builds without error.
traefik-dynamic.yml
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.

Terminal
traefik --configFile=traefik.yml --log.level=ERROR &
sleep 2 && grep -q "has no service" traefik.log && exit 1 || true

How 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.

Frequently asked questions

What causes "Traefik "router has no service""?
The router block sets a rule and entrypoint but no service, so Traefik has no backend to forward to.
How do I fix Traefik "router has no service"?
Reference an existing service on the router

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card