{"record":{"id":"5a107666373dbe49","repo":"thanos-io/thanos","slug":"invalid-template","errorCode":null,"errorMessage":"invalid template","messagePattern":"invalid template","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/tools_bucket.go","lineNumber":505,"sourceCode":"\n\t\t\t\tif _, err = fmt.Fprintf(os.Stdout, \"%s -- %s - %s Diff: %s, Compaction: %d, Downsample: %d, Source: %s\\n\",\n\t\t\t\t\tm.ULID, minTime.Format(time.RFC3339), maxTime.Format(time.RFC3339), maxTime.Sub(minTime),\n\t\t\t\t\tm.Compaction.Level, m.Thanos.Downsample.Resolution, m.Thanos.Source); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t}\n\t\tcase \"json\":\n\t\t\tenc := json.NewEncoder(os.Stdout)\n\t\t\tenc.SetIndent(\"\", \"\\t\")\n\n\t\t\tprintBlock = func(m *metadata.Meta) error {\n\t\t\t\treturn enc.Encode(&m)\n\t\t\t}\n\t\tdefault:\n\t\t\ttmpl, err := template.New(\"\").Parse(format)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, \"invalid template\")\n\t\t\t}\n\t\t\tprintBlock = func(m *metadata.Meta) error {\n\t\t\t\tif err := tmpl.Execute(os.Stdout, &m); err != nil {\n\t\t\t\t\treturn errors.Wrap(err, \"execute template\")\n\t\t\t\t}\n\t\t\t\tfmt.Fprintln(os.Stdout, \"\")\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\n\t\tmetas, _, err := fetcher.Fetch(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfor _, meta := range metas {\n\t\t\tobjects++\n\t\t\tif err := printBlock(meta); err != nil {","sourceCodeStart":487,"sourceCodeEnd":523,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/tools_bucket.go#L487-L523","documentation":"Wraps template.New(\"\").Parse(format) in the bucket inspect command: the Go text-template passed via --format is syntactically invalid (unbalanced actions, unknown functions, bad verbs), so per-block custom output cannot be rendered.","triggerScenarios":"Thrown at cmd/thanos/tools_bucket.go:505 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix Go template syntax in --format","Use the default format or a known-good template","Check for unbalanced {{ }} braces"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}