{"record":{"id":"c5beb93657a4b34a","repo":"thanos-io/thanos","slug":"unable-to-unmarshal-config-content-s","errorCode":null,"errorMessage":"unable to unmarshal config content: %s","messagePattern":"unable to unmarshal config content: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/endpointset.go","lineNumber":179,"sourceCode":"}\n\nfunc (er *endpointConfigProvider) config() EndpointConfig {\n\ter.mu.Lock()\n\tdefer er.mu.Unlock()\n\n\tres := EndpointConfig{Endpoints: make([]endpointSettings, len(er.cfg.Endpoints)), DefaultClientConfig: er.cfg.DefaultClientConfig}\n\tcopy(res.Endpoints, er.cfg.Endpoints)\n\treturn res\n}\n\nfunc (er *endpointConfigProvider) parse(configFile fileContent) (EndpointConfig, error) {\n\tcontent, err := configFile.Content()\n\tif err != nil {\n\t\treturn EndpointConfig{}, errors.Wrapf(err, \"unable to load config content: %s\", configFile.Path())\n\t}\n\tvar cfg EndpointConfig\n\tif err := yaml.Unmarshal(content, &cfg); err != nil {\n\t\treturn EndpointConfig{}, errors.Wrapf(err, \"unable to unmarshal config content: %s\", configFile.Path())\n\t}\n\treturn cfg, nil\n}\n\nfunc (er *endpointConfigProvider) addStaticEndpoints(cfg *EndpointConfig) {\n\tfor _, e := range er.endpoints {\n\t\tcfg.Endpoints = append(cfg.Endpoints, endpointSettings{\n\t\t\tAddress: e,\n\t\t})\n\t}\n\tfor _, e := range er.endpointGroups {\n\t\tcfg.Endpoints = append(cfg.Endpoints, endpointSettings{\n\t\t\tAddress: e,\n\t\t\tGroup:   true,\n\t\t})\n\t}\n\tfor _, e := range er.strictEndpoints {\n\t\tcfg.Endpoints = append(cfg.Endpoints, endpointSettings{","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/endpointset.go#L161-L197","documentation":"Raised when the endpoint config file's YAML (or NDJSON) content was read successfully but yaml.Unmarshal into EndpointConfig fails. Thanos reports the file path alongside the YAML error so the offending field/type can be identified. Parsing is aborted and the endpoint provider is not created.","triggerScenarios":"configFile.Content() succeeds but the content is not valid YAML, has wrong types for EndpointConfig fields (e.g., string where bool expected), or duplicates keys that the strict unmarshal rejects.","commonSituations":"Hand-edited endpoint config with a typo or wrong indentation; passing NDJSON where YAML is expected (or vice versa) to the wrong flag; schema drift after Thanos version change adds/renames EndpointConfig fields.","solutions":["Validate the YAML syntax with `yamllint` or a quick `yaml.Unmarshal` script; fix indentation/tabs.","Compare fields against the EndpointConfig schema for your Thanos version (endpoints, endpoint_groups, service_config, etc.); remove unknown or mistyped fields.","If the file is NDJSON, pass it via the NDJSON flag instead of the YAML flag (they use different parsers).","Pin/upgrade Thanos so config schema matches your file; check release notes for endpoint config changes."],"exampleFix":"// bad config: unquoted value typed wrong\n// endpoints:\n//   - address: 127.0.0.1:10901\n//     static: \"yes\"\n// after: correct types\n// endpoints:\n//   - address: 127.0.0.1:10901\n//     static: true","handlingStrategy":"validation","validationCode":"var probe EndpointConfig\nif err := yaml.UnmarshalStrict([]byte(raw), &probe); err != nil { return fmt.Errorf(\"endpoint config invalid YAML/schema: %w\", err) }","typeGuard":null,"tryCatchPattern":"cfg, err := provider.parse(configFile)\nif err != nil {\n    var yerr *yaml.TypeError\n    if errors.As(err, &yerr) { log.Fatalf(\"endpoint config schema error in %s: %v\", configFile.Path(), yerr) }\n    return err\n}","preventionTips":["Lint the YAML with yamllint and validate against the EndpointConfig schema in CI.","Use yaml.UnmarshalStrict locally to catch unknown/misspelled fields.","Don't mix NDJSON and YAML formats — use the matching flag for each.","Re-validate endpoint config after Thanos version upgrades (schema drift)."],"tags":["config","yaml","validation","thanos"],"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"}