docker/cli ยท error

no such service: %s

Error message

no such service: %s

What it means

Emitted by `docker service ps` when at least one of the requested service names/IDs could not be matched, but other requested services were found. In createFilter (cli/command/service/ps.go) each requested service is matched by full ID, full name, then ID prefix; unmatched ones are collected into a `notfound` list and, after task printing succeeds for the matched services, the joined 'no such service: <name>' messages are returned as a final error (ps.go:80, built at ps.go:134).

Source

Thrown at cli/command/service/ps.go:80

	}

	tasks, err := apiClient.TaskList(ctx, client.TaskListOptions{Filters: filter})
	if err != nil {
		return err
	}

	format := options.format
	if len(format) == 0 {
		format = task.DefaultFormat(dockerCli.ConfigFile(), options.quiet)
	}
	if options.quiet {
		options.noTrunc = true
	}
	if err := task.Print(ctx, dockerCli, tasks, idresolver.New(apiClient, options.noResolve), !options.noTrunc, options.quiet, format); err != nil {
		return err
	}
	if len(notfound) != 0 {
		return errors.New(strings.Join(notfound, "\n"))
	}
	return nil
}

func createFilter(ctx context.Context, apiClient client.APIClient, options psOptions) (client.Filters, []string, error) {
	filter := options.filter.Value()

	serviceIDFilter := make(client.Filters)
	serviceNameFilter := make(client.Filters)
	for _, service := range options.services {
		serviceIDFilter.Add("id", service)
		serviceNameFilter.Add("name", service)
	}
	serviceByID, err := apiClient.ServiceList(ctx, client.ServiceListOptions{Filters: serviceIDFilter})
	if err != nil {
		return filter, nil, err
	}
	serviceByName, err := apiClient.ServiceList(ctx, client.ServiceListOptions{Filters: serviceNameFilter})

View on GitHub (pinned to e9452d6e78)

Solutions

  1. List actual service names with `docker service ls` and re-run with the exact NAME or ID shown
  2. For stack services, use the namespaced name `<stack>_<service>` or `docker stack ps <stack>`
  3. Verify you are on the right host/context with `docker context show` and `docker context ls`
  4. Confirm the service still exists; redeploy it if it was removed

Example fix

# before
docker service ps web
# no such service: web

# after
docker service ls   # shows mystack_web
docker service ps mystack_web

When it happens

Trigger: Running `docker service ps svcA svcB` where svcB does not resolve against ServiceList by id filter, name filter, or ID prefix while svcA does; the tasks for svcA are printed and the command still exits non-zero with 'no such service: svcB'.

Common situations: Typos in service names; using the container name or stack name instead of the fully qualified stack service name (e.g. `web` instead of `mystack_web`); the service was already removed (`docker service rm` or `docker stack rm`); pointing the CLI at a different Docker context/host than the one running the service.

Related errors


AI-assisted analysis of docker/cli@e9452d6e78 (2026-08-01). Data as JSON: /data/errors/e7e68ab7cfbebc76.json. Report an issue: GitHub.