no such service: wbe from docker compose up, logs or a similar command means the name you typed is not a service key in the Compose file. Compose matches service names, not container names. List the real names with docker compose config --services and use one of those.

The usual mix-up is typing the container name, such as fix8-cli-v3-web-1, where Compose wants the service name, web. A typo, as here, gives the same message.

The error

PS> docker compose up wbe
no such service: wbe
PS> docker compose logs wbe
no such service: wbe

Why it happens

The Compose commands tested here, up and logs, look the name up among the keys under services: in the project's Compose file. The project in the test had one service, web, so wbe matched nothing and the command stopped without starting or showing anything.

The container name does not work either. With the project running, the container's own name was refused the same way, while the service name and plain docker logs both worked:

PS> docker compose logs fix8-cli-v3-web-1
no such service: fix8-cli-v3-web-1
PS> docker compose logs web
web-1  | greeting=from-dot-env
PS> docker logs fix8-cli-v3-web-1
greeting=from-dot-env

The fix

PS> docker compose config --services
web

config --services prints the service names Compose sees, one per line. Use one of them, as in docker compose logs web above. When you have a container name instead, docker logs <container> takes it directly, without Compose. If the list is not what you expect, make sure you are in the folder that holds the project's compose.yaml.

The naming rule behind the mix-up is visible in the output above: Compose names each container after the project, the service and a number, so the service web in the project fix8-cli-v3 became the container fix8-cli-v3-web-1, and its log lines are prefixed web-1. Compose commands take the middle part, the service.

How it was reproduced

Docker Desktop on Windows 11, engine 29.9.2, Docker Compose v5.6.1, Windows PowerShell 5.1, the cached alpine:latest image. A one-service project with the service web; up wbe and logs wbe both printed the message above and exited with 1, and config --services listed web. The project name fix8-cli-v3 is the test's own.

Frequently asked

How do I list the services in a docker compose file?
Run docker compose config --services in the project folder. It prints each service name on its own line.
Does docker compose logs take a container name?
No, it takes a service name from the Compose file. For a container name, use docker logs <container> instead.
Why does docker compose say no such service when the container is running?
The name you typed is probably the container name, such as fix8-cli-v3-web-1 in this test, which Compose refused. Compose wants the service key, such as web.

More decoded errors in the Fixes category. A service name that is wrong inside the file rather than on the command line is covered in depends on undefined service.