{"id":"e7e68ab7cfbebc76","repo":"docker/cli","slug":"no-such-service-s","errorCode":null,"errorMessage":"no such service: %s","messagePattern":"no such service: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/service/ps.go","lineNumber":80,"sourceCode":"\t}\n\n\ttasks, err := apiClient.TaskList(ctx, client.TaskListOptions{Filters: filter})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tformat := options.format\n\tif len(format) == 0 {\n\t\tformat = task.DefaultFormat(dockerCli.ConfigFile(), options.quiet)\n\t}\n\tif options.quiet {\n\t\toptions.noTrunc = true\n\t}\n\tif err := task.Print(ctx, dockerCli, tasks, idresolver.New(apiClient, options.noResolve), !options.noTrunc, options.quiet, format); err != nil {\n\t\treturn err\n\t}\n\tif len(notfound) != 0 {\n\t\treturn errors.New(strings.Join(notfound, \"\\n\"))\n\t}\n\treturn nil\n}\n\nfunc createFilter(ctx context.Context, apiClient client.APIClient, options psOptions) (client.Filters, []string, error) {\n\tfilter := options.filter.Value()\n\n\tserviceIDFilter := make(client.Filters)\n\tserviceNameFilter := make(client.Filters)\n\tfor _, service := range options.services {\n\t\tserviceIDFilter.Add(\"id\", service)\n\t\tserviceNameFilter.Add(\"name\", service)\n\t}\n\tserviceByID, err := apiClient.ServiceList(ctx, client.ServiceListOptions{Filters: serviceIDFilter})\n\tif err != nil {\n\t\treturn filter, nil, err\n\t}\n\tserviceByName, err := apiClient.ServiceList(ctx, client.ServiceListOptions{Filters: serviceNameFilter})","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/service/ps.go#L62-L98","documentation":"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).","triggerScenarios":"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'.","commonSituations":"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.","solutions":["List actual service names with `docker service ls` and re-run with the exact NAME or ID shown","For stack services, use the namespaced name `<stack>_<service>` or `docker stack ps <stack>`","Verify you are on the right host/context with `docker context show` and `docker context ls`","Confirm the service still exists; redeploy it if it was removed"],"exampleFix":"# before\ndocker service ps web\n# no such service: web\n\n# after\ndocker service ls   # shows mystack_web\ndocker service ps mystack_web","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":["swarm","service","cli","name-resolution"],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}