{"record":{"id":"b56ec37d2e65a01a","repo":"amir20/dozzle","slug":"user-s-has-an-invalid-filter-q-w","errorCode":null,"errorMessage":"user %s has an invalid filter %q: %w","messagePattern":"user (.+?) has an invalid filter %q: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/auth/users.go","lineNumber":122,"sourceCode":"\t\t}\n\n\t\tif !(len(user.Password) == 64 || len(user.Password) == 60) {\n\t\t\tlog.Fatal().Str(\"password\", user.Password).Str(\"user\", username).Msg(\"Invalid password for user\")\n\t\t}\n\n\t\tif user.Name == \"\" {\n\t\t\tuser.Name = username\n\t\t}\n\n\t\tif strings.TrimSpace(user.RolesConfigured) == \"\" {\n\t\t\tuser.RolesConfigured = \"all\"\n\t\t}\n\n\t\tuser.Roles = ParseRole(user.RolesConfigured)\n\n\t\tlabels, err := container.ParseContainerFilter(user.Filter)\n\t\tif err != nil {\n\t\t\treturn users, fmt.Errorf(\"user %s has an invalid filter %q: %w\", username, user.Filter, err)\n\t\t}\n\t\tuser.ContainerLabels = labels\n\t}\n\n\treturn users, nil\n}\n\nfunc (u *UserDatabase) readFileIfChanged() error {\n\tif u.Path == \"\" {\n\t\treturn nil\n\t}\n\tinfo, err := os.Stat(u.Path)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif info.ModTime().After(u.LastRead) {\n\t\tlog.Info().Msg(\"Reloading user database\")","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/amir20/dozzle/blob/d9463cbe21874e44ab79db6fa63e746ca7d22928/internal/auth/users.go#L104-L140","documentation":"While decoding users.yml, each user's container filter string is validated via container.ParseContainerFilter. If the filter cannot be parsed into container label filters, decodeUsersFromFile aborts loading the users file with this wrapped error naming the user and the offending filter string. Authentication setup fails until the config is fixed.","triggerScenarios":"A user entry in users.yml has a 'filter' value that ParseContainerFilter rejects, e.g. a filter not in key=value form, unsupported keys, or malformed label expressions.","commonSituations":"Typo in a label key, using comma/space-separated syntax the parser does not accept, quoting mistakes in YAML leaving stray characters in the filter string, or copying Docker filter syntax incompatible with Dozzle's parser.","solutions":["Open users.yml and fix the 'filter' value for the named user to valid 'label=value' pairs","Check the wrapped ParseContainerFilter error for the exact parse problem","Compare against documented filter syntax in Dozzle docs (dev.dozzle.* labels)","Validate the YAML so the filter is a clean string, not a list accidentally coerced into one"],"exampleFix":"// users.yml\n// before\nuser:\n  filter: \"env=prod, team\"\n// after\nuser:\n  filter: \"env=prod\"","handlingStrategy":"validation","validationCode":"// before reading users.yml, validate each filter string\nfor _, u := range rawUsers {\n    if _, err := container.ParseContainerFilter(u.Filter); err != nil {\n        return fmt.Errorf(\"user %q: bad filter %q: %w\", u.Name, u.Filter, err)\n    }\n}","typeGuard":null,"tryCatchPattern":"users, err := auth.ReadUsersFromFile(path)\nif err != nil {\n    log.Fatalf(\"invalid users config: %v\", err) // error names user and filter\n}","preventionTips":["Keep filters as simple label=value strings in users.yml","Lint users.yml in CI with the same ParseContainerFilter call","Quote filter values in YAML to avoid stray characters"],"tags":["auth","config","yaml","validation","filter"],"backgroundTag":"invalid-config-value","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"}