{"record":{"id":"0307a19d63471817","repo":"thanos-io/thanos","slug":"error-while-parsing-config-for-request-logging","errorCode":null,"errorMessage":"error while parsing config for request logging","messagePattern":"error while parsing config for request logging","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/query.go","lineNumber":243,"sourceCode":"\t\tfor _, feature := range *featureList {\n\t\t\tif feature == promqlExperimentalFunctions {\n\t\t\t\tparser.EnableExperimentalFunctions = true\n\t\t\t\tlevel.Info(logger).Log(\"msg\", \"Experimental PromQL functions enabled.\", \"option\", promqlExperimentalFunctions)\n\t\t\t}\n\t\t\tif feature == promqlAtModifier {\n\t\t\t\tlevel.Warn(logger).Log(\"msg\", \"This option for --enable-feature is now permanently enabled and therefore a no-op.\", \"option\", promqlAtModifier)\n\t\t\t}\n\t\t\tif feature == promqlNegativeOffset {\n\t\t\t\tlevel.Warn(logger).Log(\"msg\", \"This option for --enable-feature is now permanently enabled and therefore a no-op.\", \"option\", promqlNegativeOffset)\n\t\t\t}\n\t\t\tif feature == queryPushdown {\n\t\t\t\tlevel.Warn(logger).Log(\"msg\", \"This option for --enable-feature is now permanently deprecated and therefore ignored.\", \"option\", queryPushdown)\n\t\t\t}\n\t\t}\n\n\t\thttpLogOpts, err := logging.ParseHTTPOptions(reqLogConfig)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"error while parsing config for request logging\")\n\t\t}\n\n\t\tgrpcLogOpts, logFilterMethods, err := logging.ParsegRPCOptions(reqLogConfig)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"error while parsing config for request logging\")\n\t\t}\n\n\t\tif *webRoutePrefix == \"\" {\n\t\t\t*webRoutePrefix = *webExternalPrefix\n\t\t}\n\n\t\tif *webRoutePrefix != *webExternalPrefix {\n\t\t\tlevel.Warn(logger).Log(\"msg\", \"different values for --web.route-prefix and --web.external-prefix detected, web UI may not work without a reverse-proxy.\")\n\t\t}\n\n\t\ttsdbRelabelConfig, err := storeSelectorRelabelConf.Content()\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"error while parsing tsdb selector configuration\")","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/query.go#L225-L261","documentation":"The query command parses the request logging config file (--request-log-config) via logging.ParseHTTPOptions; a parse failure is wrapped as \"error while parsing config for request logging\". It means the YAML content does not match the expected HTTP logging options schema.","triggerScenarios":"Passing a --request-log-config file whose YAML has unknown fields, wrong types (e.g. a string where a list is expected), or invalid structure that ParseHTTPOptions cannot decode.","commonSituations":"Hand-edited logging config with indentation errors, copied config from a different component version with changed schema, or pointing the flag at a config written for gRPC options only.","solutions":["Validate the YAML against the documented HTTP request-log options schema (list of options with status codes/duration/time).","Check file path and content: ensure --request-log-config points to the intended file and it is non-empty.","Fix YAML indentation/types; remove unknown fields.","Use the schema-compatible example from the Thanos docs for your version."],"exampleFix":"// before (invalid)\nhttp:\n  - status_codes\n// after\noptions:\n  - duration\n  - status_codes\n  - time","handlingStrategy":"validation","validationCode":"// Validate request-log config before deploy\nvar opts logging.HTTPOptions\nif err := yaml.UnmarshalStrict(configBytes, &opts); err != nil {\n    return fmt.Errorf(\"invalid http request-log config: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"_, err := logging.ParseHTTPOptions(cfgPath)\nif err != nil {\n    return fmt.Errorf(\"request log config rejected: %w\", err)\n}","preventionTips":["Keep request-log configs in version control with a schema test in CI","Copy examples only from the Thanos version you deploy","Use strict YAML unmarshalling locally to catch unknown fields early"],"tags":["yaml","logging","configuration"],"backgroundTag":"yaml-parse-error","analyzedSha":"35b8b991177def87ed52dcf10f9b6d87f07282c8","analyzedAt":"2026-09-07T01:49:59.689Z","contentChangedAt":"2026-09-07T01:49:59.689Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}