Skip to content
Latchkey

Compose "no such service" in CI

A docker compose up/run/build <service> command referenced a service name that is not defined in the active compose files. Compose resolves the merged config and finds no service by that name, so it stops.

What this error means

A compose command fails with "no such service: <name>". The name is misspelled, defined in a file that was not loaded, or hidden behind a profile.

compose
no such service: web

Common causes

A misspelled service name

The command argument does not match any key under services: in the merged compose configuration.

The service lives in a file not loaded

The service is defined in an override or alternate compose file that was not passed with -f, so it is absent from the resolved set.

How to fix it

List services and use an exact name

  1. Run docker compose config --services to see resolved service names.
  2. Use the exact name (it is case-sensitive).
  3. Add the -f file that defines the service if it was missing.
Terminal
docker compose config --services
docker compose -f docker-compose.yml -f docker-compose.ci.yml up web

Enable the profile that contains the service

If the service is gated behind a profile, enable it so the service is part of the resolved set.

Terminal
docker compose --profile ci up tests

How to prevent it

  • Verify service names with docker compose config --services.
  • Pass every compose file the command needs with -f.
  • Enable required profiles before targeting their services.

Frequently asked questions

What causes ""no such service""?
The command argument does not match any key under services: in the merged compose configuration.
How do I fix "no such service"?
List services and use an exact name

Related guides

References

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