{"record":{"id":"33f4117c687f45a1","repo":"amir20/dozzle","slug":"invalid-filter-s","errorCode":null,"errorMessage":"invalid filter: %s","messagePattern":"invalid filter: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/container/types.go","lineNumber":238,"sourceCode":"\tHost            string            `json:\"host\"`\n\tActorID         string            `json:\"actorId\"`\n\tActorAttributes map[string]string `json:\"actorAttributes,omitempty\"`\n\tTime            time.Time         `json:\"time\"`\n\tContainer       *Container        `json:\"-\"`\n}\n\ntype ContainerLabels map[string][]string\n\nfunc ParseContainerFilter(commaValues string) (ContainerLabels, error) {\n\tfilter := make(ContainerLabels)\n\tif commaValues == \"\" {\n\t\treturn filter, nil\n\t}\n\n\tfor val := range strings.SplitSeq(commaValues, \",\") {\n\t\tbefore, after, ok := strings.Cut(val, \"=\")\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"invalid filter: %s\", filter)\n\t\t}\n\t\tkey := before\n\t\tval := after\n\t\tfilter[key] = append(filter[key], val)\n\t}\n\n\treturn filter, nil\n}\n\nfunc (f ContainerLabels) Exists() bool {\n\treturn len(f) > 0\n}\n\ntype LogPosition string\n\nconst (\n\tBeginning LogPosition = \"start\"\n\tMiddle    LogPosition = \"middle\"","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/amir20/dozzle/blob/d9463cbe21874e44ab79db6fa63e746ca7d22928/internal/container/types.go#L220-L256","documentation":"ParseContainerFilter converts a comma-separated 'key=value' filter string into a map. If any comma-separated token lacks an '=' separator the whole parse fails with 'invalid filter'. Used to translate user-supplied label filters into Docker API filters.","triggerScenarios":"ParseContainerFilter receives a filter string where a token between commas has no '=' (e.g. 'label=env,prod' where 'prod' has no key). Raised in the strings.SplitSeq loop when strings.Cut returns ok=false. Also hit via decodeUsersFromFile paths.","commonSituations":"Typo omitting '=' between key and value; label name-only filtering without 'label=' prefix; spaces or trailing commas creating bare tokens; copied filter strings losing characters.","solutions":["Write each token as key=value, comma-separated with no bare values","For label filtering use the form 'label=key' or 'label=key=value' as the Docker API expects","Remove empty segments caused by trailing/double commas"],"exampleFix":"// before\nParseContainerFilter(\"label=env,prod\")\n// after\nParseContainerFilter(\"label=env,label=prod\")","handlingStrategy":"validation","validationCode":"func validFilter(f string) bool {\n  for _, tok := range strings.Split(f, \",\") {\n    if !strings.Contains(tok, \"=\") { return false }\n  }\n  return true\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always write filter tokens as key=value","Avoid bare label names; prefix with 'label='","Strip trailing commas and spaces from user-supplied filter strings"],"tags":["docker","filter","validation"],"backgroundTag":"invalid-argument-format","analyzedSha":"d9463cbe21874e44ab79db6fa63e746ca7d22928","analyzedAt":"2026-09-07T10:08:55.855Z","contentChangedAt":"2026-09-07T10:08:55.855Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}