Skip to content
Latchkey

Traefik "the service ... does not exist" in CI

A Traefik router references a service that is not defined anywhere in the dynamic config. The name is present on the router but has no matching http.services entry, so routing fails.

What this error means

Traefik logs "the service X does not exist" and the affected router returns 404 or 502 instead of reaching a backend.

traefik
level=error msg="the service my-service does not exist" routerName=my-router@file

Common causes

The service name is misspelled

The router references my-service but the services block defines myservice, so no match is found.

The service lives in a provider that was not loaded

The service is defined in a file or provider Traefik did not load, so from the router's view it does not exist.

How to fix it

Define the referenced service

  1. Confirm the exact service name the router uses.
  2. Add or correct the matching entry under http.services.
  3. Reload and verify the router resolves to a backend.
traefik-dynamic.yml
http:
  services:
    my-service:
      loadBalancer:
        servers:
          - url: "http://backend:8080"

Ensure the provider that holds it is loaded

If the service is in another file, make sure the file provider watches that directory so Traefik sees it.

traefik.yml
providers:
  file:
    directory: /etc/traefik/dynamic
    watch: true

How to prevent it

  • Keep router service references in sync with defined services.
  • Load every dynamic config file via the file provider directory.
  • Validate the merged config in CI before deploying.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →