{"record":{"id":"f683158d6db34eb6","repo":"jaegertracing/jaeger","slug":"unrecognized-write-mode-q-valid-values-are-q-an","errorCode":null,"errorMessage":"unrecognized write_mode %q: valid values are %q and %q","messagePattern":"unrecognized write_mode %q: valid values are %q and %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/elasticsearch/config/config.go","lineNumber":562,"sourceCode":"func 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.\nfunc validateLogLevel(level string) error {\n\tswitch level {\n\tcase \"\", \"debug\", \"info\", \"error\":\n\t\treturn nil\n\tdefault:\n\t\treturn fmt.Errorf(\"unrecognized log_level %q: valid values are debug, info, error\", level)\n\t}\n}\n\n// rejectUnwiredKey builds the validation error for a config key that the current\n// Elasticsearch client no longer reads, pointing operators at the PR that explains\n// the change. The migration is always the same: remove the key.\nfunc rejectUnwiredKey(key, reason string) error {","sourceCodeStart":544,"sourceCodeEnd":580,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/internal/storage/elasticsearch/config/config.go#L544-L580","documentation":"Jaeger's Elasticsearch storage config validates the optional write_mode setting before creating a client. write_mode accepts only an empty value (default), 'async', or 'sync'; any other string is rejected at config-validation time with this error rather than silently falling back. This prevents typos like 'asynchronous' from producing unexpected indexing behavior.","triggerScenarios":"Setting es.write_mode (or the WriteMode field in config.Config) to any value other than '', 'async', or 'sync' and calling Validate on the config.","commonSituations":"Typo in YAML such as write_mode: Async or write_mode: bulk; copying config from old Jaeger docs that used different values; environment variable ES_WRITE_MODE set with an invalid value.","solutions":["Set write_mode to one of: (empty), 'async', or 'sync'","Remove the write_mode key entirely to use the default","Check for stray whitespace/case in the value (it is matched exactly against lowercase literals)"],"exampleFix":"// before\nwrite_mode: asynchronous\n// after\nwrite_mode: async","handlingStrategy":"validation","validationCode":"validWriteModes := map[string]bool{\"\": true, \"async\": true, \"sync\": true}\nif !validWriteModes[cfg.WriteMode] {\n    return fmt.Errorf(\"write_mode must be one of: (empty), async, sync; got %q\", cfg.WriteMode)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep write_mode values lowercase and unquoted-free in YAML","Validate config at startup before deploying","Copy values only from current Jaeger docs"],"tags":["elasticsearch","config-validation"],"backgroundTag":"invalid-config-value","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}