{"record":{"id":"81aaba8575711123","repo":"docker/compose","slug":"unknown-filter-s","errorCode":null,"errorMessage":"unknown filter %s","messagePattern":"unknown filter (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/compose/ps.go","lineNumber":64,"sourceCode":"\tOrphans  bool\n}\n\nfunc (p *psOptions) parseFilter() error {\n\tif p.Filter == \"\" {\n\t\treturn nil\n\t}\n\tkey, val, ok := strings.Cut(p.Filter, \"=\")\n\tif !ok {\n\t\treturn errors.New(\"arguments to --filter should be in form KEY=VAL\")\n\t}\n\tswitch key {\n\tcase \"status\":\n\t\tp.Status = append(p.Status, val)\n\t\treturn nil\n\tcase \"source\":\n\t\treturn api.ErrNotImplemented\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown filter %s\", key)\n\t}\n}\n\nfunc psCommand(p *ProjectOptions, dockerCli command.Cli, backendOptions *BackendOptions) *cobra.Command {\n\topts := psOptions{\n\t\tProjectOptions: p,\n\t}\n\tpsCmd := &cobra.Command{\n\t\tUse:   \"ps [OPTIONS] [SERVICE...]\",\n\t\tShort: \"List containers\",\n\t\tPreRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn opts.parseFilter()\n\t\t},\n\t\tRunE: Adapt(func(ctx context.Context, args []string) error {\n\t\t\treturn runPs(ctx, dockerCli, backendOptions, args, opts)\n\t\t}),\n\t\tValidArgsFunction: completeServiceNames(dockerCli, p),\n\t}","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/docker/compose/blob/ddc4b044b62e9f715212ea4143fa830fac76382f/cmd/compose/ps.go#L46-L82","documentation":"`docker compose ps --filter` currently supports only `status=<value>`; `source=` is explicitly not implemented (returns api.ErrNotImplemented) and every other key falls through to this 'unknown filter' error in parseFilter.","triggerScenarios":"Running `docker compose ps --filter name=web`, `--filter label=foo=bar`, or `--filter source=build` — anything whose KEY is not exactly `status`.","commonSituations":"Porting `docker ps --filter` invocations to compose; scripts assuming docker ps filter semantics (name, label, ancestor, etc.) carry over; hitting `source=` which exists in some docs but is not implemented yet in this version.","solutions":["Use `--filter status=<running|exited|...>` which is the only implemented filter key.","Filter by service instead: pass service names as positional args `docker compose ps web`.","For richer filtering, post-process `docker compose ps --format json` with jq."],"exampleFix":"# before\ndocker compose ps --filter name=web\n\n# after\ndocker compose ps --filter status=running web","handlingStrategy":"validation","validationCode":"# bash: only allow the implemented filter key\nFILTER_KEY=\"${FILTER%%=*}\"\n[ \"$FILTER_KEY\" = status ] || { echo \"only --filter status=... is supported\" >&2; exit 2; }\ndocker compose ps --filter \"$FILTER\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Don't port docker ps filters blindly; compose ps supports status only.","Use `--format json` + jq for name/label filtering."],"tags":["cli","ps","filter","not-implemented"],"backgroundTag":null,"analyzedSha":"ddc4b044b62e9f715212ea4143fa830fac76382f","analyzedAt":"2026-08-15T13:31:42.319Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}