{"record":{"id":"ace35dcca80f7922","repo":"docker/cli","slug":"error-the-until-filter-is-not-supported-with","errorCode":null,"errorMessage":"ERROR: The \"until\" filter is not supported with \"--volumes\"","messagePattern":"ERROR: The \"until\" filter is not supported with \"--volumes\"","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/volume/prune.go","lineNumber":127,"sourceCode":"\treturn spaceReclaimed, out.String(), nil\n}\n\ntype invalidParamErr struct{ error }\n\nfunc (invalidParamErr) InvalidParameter() {}\n\ntype cancelledErr struct{ error }\n\nfunc (cancelledErr) Cancelled() {}\n\n// pruneFn calls the Volume Prune API for use in \"docker system prune\",\n// and returns the amount of space reclaimed and a detailed output string.\nfunc pruneFn(ctx context.Context, dockerCli command.Cli, options pruner.PruneOptions) (uint64, string, error) {\n\t// TODO version this once \"until\" filter is supported for volumes\n\t// Ideally, this check wasn't done on the CLI because the list of\n\t// filters that is supported by the daemon may evolve over time.\n\tif _, ok := options.Filter.Value()[\"until\"]; ok {\n\t\treturn 0, \"\", errors.New(`ERROR: The \"until\" filter is not supported with \"--volumes\"`)\n\t}\n\tif !options.Confirmed {\n\t\t// Dry-run: perform validation and produce confirmation before pruning.\n\t\tconfirmMsg := \"all anonymous volumes not used by at least one container\"\n\t\treturn 0, confirmMsg, cancelledErr{errors.New(\"volume prune has been cancelled\")}\n\t}\n\treturn runPrune(ctx, dockerCli, pruneOptions{\n\t\tforce:  true,\n\t\tfilter: options.Filter,\n\t})\n}\n","sourceCodeStart":109,"sourceCodeEnd":139,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/cli/command/volume/prune.go#L109-L139","documentation":"Returned by pruneFn (volume/prune.go:126-128), the function registered for 'docker system prune --volumes'. The volume prune API does not support the 'until' time filter (unlike container/image prune), so the CLI pre-empts the daemon call and rejects it with this explicit message. The TODO at line 123 notes this check is client-side because daemon filter support may evolve.","triggerScenarios":"Running 'docker system prune --volumes --filter until=24h' (or any until= value). The check fires whenever the 'until' key is present in the resolved filter set passed to pruneFn.","commonSituations":"Reusing a prune filter recipe that works for 'docker container prune' or 'docker image prune' (which DO support until) against --volumes. Automation that applies a uniform 'until=' retention filter across all resource types.","solutions":["Remove the '--filter until=...' argument when pruning volumes.","For age-based volume cleanup, list volumes and delete selectively, or rely on --all/--filter label= instead.","Split the system prune so volumes are pruned separately without the until filter."],"exampleFix":"# before\ndocker system prune --volumes --filter until=24h -f\n\n# after\ndocker system prune --volumes -f","handlingStrategy":"validation","validationCode":"// Strip 'until' from filters when targeting volumes; the volume prune API does not support it.\nfunc sanitizeVolumeFilters(filters map[string]string) (map[string]string, error) {\n    if _, ok := filters[\"until\"]; ok {\n        return nil, errors.New(`the \"until\" filter is not supported when pruning volumes`)\n    }\n    return filters, nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not reuse container/image prune filter recipes verbatim for volume prune.","Document per-resource supported filters; 'until' is valid only for containers/images/networks, not volumes.","In shared cleanup scripts, branch on resource type and drop 'until' for volumes."],"tags":["docker-volume","prune","filter","until","validation"],"backgroundTag":null,"analyzedSha":"4f84911bfe8811e9b028e4b1fee8e7510be79387","analyzedAt":"2026-08-07T12:15:29.814Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}