{"record":{"id":"a9e78f35f3da90e4","repo":"thanos-io/thanos","slug":"getting-request-logging-config-failed-v","errorCode":null,"errorMessage":"getting request logging config failed. %v","messagePattern":"getting request logging config failed\\. (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/logging/options.go","lineNumber":206,"sourceCode":"\n\t// Insert into context (Note: This updated context isn't being used later, so this might be redundant)\n\t_ = middleware.NewContextWithRequestID(ctx, newReqID)\n\n\treturn logFields\n\n}\n\n// TODO: @yashrsharma44 - To be deprecated in the next release.\nfunc ParseHTTPOptions(reqLogConfig *extflag.PathOrContent) ([]Option, error) {\n\t// Default Option: No Logging.\n\tlogOpts := []Option{WithDecider(func(_ string, _ error) Decision {\n\t\treturn NoLogCall\n\t})}\n\n\t// If flag is incorrectly parsed.\n\tconfigYAML, err := reqLogConfig.Content()\n\tif err != nil {\n\t\treturn logOpts, fmt.Errorf(\"getting request logging config failed. %v\", err)\n\t}\n\n\treturn NewHTTPOption(configYAML)\n}\n\n// TODO: @yashrsharma44 - To be deprecated in the next release.\nfunc ParsegRPCOptions(reqLogConfig *extflag.PathOrContent) ([]grpc_logging.Option, []string, error) {\n\tvar logOpts []grpc_logging.Option\n\tconfigYAML, err := reqLogConfig.Content()\n\tif err != nil {\n\t\treturn logOpts, nil, fmt.Errorf(\"getting request logging config failed. %v\", err)\n\t}\n\n\tlogOpts, logFilterMethods, err := NewGRPCOption(configYAML)\n\tif err != nil {\n\t\treturn logOpts, logFilterMethods, err\n\t}\n","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/logging/options.go#L188-L224","documentation":"ParseHTTPOptions reads the request-logging YAML config from an extflag.PathOrContent and wraps any failure to obtain that content with this message. It indicates the file/flag pointing at the HTTP logging config could not be read or resolved.","triggerScenarios":"Calling ParseHTTPOptions with a PathOrContent whose path does not exist, is unreadable, or whose --http-req-log-config style flag was passed incorrectly.","commonSituations":"Typo in the config file path passed on the CLI; file mounted but missing in a container; insufficient read permissions on the YAML file.","solutions":["Check the path/flag value passed to the request logging config extflag and correct it","Verify the file exists and is readable (ls -l / cat the file)","If inline config is intended, pass the content via the flag's inline syntax instead of a file path","Inspect the wrapped %v cause printed with the message for the underlying OS error"],"exampleFix":"// before\nlogOpts, err := ParseHTTPOptions(extflag.NewPathOrContentOrEmpty(\"bad/path.yaml\"))\n// after\nif _, err := os.Stat(\"config.yaml\"); err == nil {\n    logOpts, err := ParseHTTPOptions(extflag.NewPathOrContent(\"config.yaml\"))\n}","handlingStrategy":"validation","validationCode":"if p := flagValue; p != \"\" {\n    if _, err := os.Stat(p); err != nil {\n        return fmt.Errorf(\"request logging config not readable: %w\", err)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always stat/read the config path before passing it to ParseHTTPOptions","Use extflag inline content when the config is static","Add a startup check that validates all extflag paths"],"tags":["config","file-read","logging"],"backgroundTag":"file-read-failed","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"}