{"record":{"id":"3255564ecc34ac0a","repo":"jaegertracing/jaeger","slug":"unrecognized-poison-pill-handling-q-valid-values","errorCode":null,"errorMessage":"unrecognized poison_pill_handling %q: valid values are %q and %q","messagePattern":"unrecognized poison_pill_handling %q: valid values are %q and %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/elasticsearch/config/config.go","lineNumber":549,"sourceCode":"}\n\n// EffectivePoisonHandling resolves the poison-pill policy Jaeger should use: the\n// explicit PoisonPillHandling from config, or PoisonFail when it is unset.\nfunc (c *Configuration) EffectivePoisonHandling() PoisonHandling {\n\tif c.PoisonPillHandling != \"\" {\n\t\treturn c.PoisonPillHandling\n\t}\n\treturn PoisonFail\n}\n\n// validatePoisonHandling rejects an unrecognized poison_pill_handling. An empty\n// value is allowed and resolves to the default (PoisonFail).\nfunc validatePoisonHandling(mode PoisonHandling) error {\n\tswitch mode {\n\tcase \"\", PoisonFail, PoisonDrop:\n\t\treturn nil\n\tdefault:\n\t\treturn fmt.Errorf(\"unrecognized poison_pill_handling %q: valid values are %q and %q\", mode, PoisonFail, PoisonDrop)\n\t}\n}\n\n// validateWriteMode rejects an unrecognized write_mode. An empty value is allowed\n// and resolves to the default (WriteModeAsync). It mirrors validateLogLevel:\n// write_mode carries no govalidator struct tag, so the whole-config Validate must\n// check it explicitly.\nfunc validateWriteMode(mode WriteMode) error {\n\tswitch mode {\n\tcase \"\", WriteModeAsync, WriteModeSync:\n\t\treturn nil\n\tdefault:\n\t\treturn fmt.Errorf(\"unrecognized write_mode %q: valid values are %q and %q\", mode, WriteModeAsync, WriteModeSync)\n\t}\n}\n\n// validateLogLevel rejects an unrecognized log_level. An empty value is allowed\n// and means no client logging is attached.","sourceCodeStart":531,"sourceCodeEnd":567,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/internal/storage/elasticsearch/config/config.go#L531-L567","documentation":"validatePoisonHandling rejects an unrecognized value for the poison_pill_handling option. Only empty (default), 'fail' (PoisonFail), and 'drop' (PoisonDrop) are accepted; anything else would otherwise be silently treated as the default, so the whole-config Validate fails fast instead.","triggerScenarios":"Configuring es_index_cleaner / rollover poison pill handling with a misspelled or unsupported value (e.g. 'retry', 'ignore', 'FAIL' if matching is case-sensitive, 'delete') via config file or env var.","commonSituations":"Typo in YAML ('poision_pill_handling: drop' won't even bind; 'drop ' with trailing space, or 'Drop' wrong case); copying a value from an old document; using a plausible value that was never implemented.","solutions":["Set poison_pill_handling to exactly 'fail' or 'drop' (or remove the key to get the default 'fail').","Check for typos, casing, and whitespace in the config value; quote the string in YAML to avoid parser mangling.","Check the govalidator/enum documentation for the option to see the accepted literals.","If you intended a behavior that isn't fail/drop, implement it upstream or handle it outside the config instead of inventing a keyword."],"exampleFix":"# before\npoison_pill_handling: Drop\n# after\npoison_pill_handling: drop","handlingStrategy":"validation","validationCode":"func validPoisonHandling(s string) bool {\n    switch s {\n    case \"\", \"fail\", \"drop\":\n        return true\n    }\n    return false\n}\n// call before assigning the config field","typeGuard":null,"tryCatchPattern":"if err := cfg.Validate(); err != nil {\n    if strings.Contains(err.Error(), \"unrecognized poison_pill_handling\") {\n        log.Printf(\"poison_pill_handling must be exactly 'fail' or 'drop'; got %q\", cfg.PoisonHandling)\n    }\n    return err\n}","preventionTips":["Only use the documented literals: 'fail' or 'drop'.","Quote enum strings in YAML and strip surrounding whitespace.","Lowercase-check values if sourcing from case-insensitive env vars.","Validate the whole config in CI before rollout."],"tags":["elasticsearch","configuration","enum-validation","poison-pill"],"backgroundTag":"invalid-enum-config-value","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}