{"record":{"id":"59f768c7d48a8fe3","repo":"github/github-mcp-server","slug":"markers-not-found-s-s","errorCode":null,"errorMessage":"markers not found: %s / %s","messagePattern":"markers not found: (.+?) / (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/github-mcp-server/generate_docs.go","lineNumber":371,"sourceCode":"\tvar buf strings.Builder\n\tlines := strings.Split(description, \"\\n\")\n\tbuf.WriteString(lines[0])\n\tfor i := 1; i < len(lines); i++ {\n\t\tbuf.WriteString(\"\\n\")\n\t\tbuf.WriteString(indent)\n\t\tbuf.WriteString(lines[i])\n\t}\n\treturn buf.String()\n}\n\nfunc replaceSection(content, startMarker, endMarker, newContent string) (string, error) {\n\tstart := fmt.Sprintf(\"<!-- %s -->\", startMarker)\n\tend := fmt.Sprintf(\"<!-- %s -->\", endMarker)\n\n\tbefore, _, ok := strings.Cut(content, start)\n\tendIdx := strings.Index(content, end)\n\tif !ok || endIdx == -1 {\n\t\treturn \"\", fmt.Errorf(\"markers not found: %s / %s\", start, end)\n\t}\n\n\tvar buf strings.Builder\n\tbuf.WriteString(before)\n\tbuf.WriteString(start)\n\tbuf.WriteString(\"\\n\")\n\tbuf.WriteString(newContent)\n\tbuf.WriteString(\"\\n\")\n\tbuf.WriteString(content[endIdx:])\n\treturn buf.String(), nil\n}\n\nfunc generateRemoteToolsetsDoc() string {\n\tvar buf strings.Builder\n\n\t// Create translation helper\n\tt, _ := translations.TranslationHelper()\n","sourceCodeStart":353,"sourceCodeEnd":389,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/cmd/github-mcp-server/generate_docs.go#L353-L389","documentation":"Returned by replaceSection when the markdown file being rewritten does not contain the expected HTML marker comments (<!-- START … --> / <!-- END … -->) for the section to automate. The generator refuses to guess insertion points: if strings.Cut cannot find the start marker or strings.Index cannot find the end marker, it errors naming both markers. This protects hand-written docs from silent mangling.","triggerScenarios":"A human editor deleted, renamed, or retyped the marker comments (e.g. dropped the '!-- … -->' HTML comment syntax or changed capitalization); docs were rewritten by a tool that strips comments; running the generator against a custom doc file that never had the markers; marker text altered by markdown formatters.","commonSituations":"Docs regenerated in CI after a manual PR restructured the markdown; prettier/markdownlint passes that remove or normalize HTML comments; forks with divergent docs.","solutions":["Open the named file and restore both marker comments exactly as reported in the error (HTML comments, exact casing)","Recover the markers from git history: git log -p -- <file> or git show <rev>:<file>","Add the markers to new/custom doc files before running the generator","Exclude marker comments from markdown formatter/linter rules that strip HTML comments"],"exampleFix":"<!-- before: section header edited away -->\n## Toolsets\n(list manually maintained)\n\n<!-- after: markers restored verbatim -->\n<!-- START AUTOMATED TOOLSETS -->\n(generated content)\n<!-- END AUTOMATED TOOLSETS -->","handlingStrategy":"validation","validationCode":"// Verify both marker comments exist before running the generator\nfunc hasMarkers(content, startMarker, endMarker string) bool {\n    return strings.Contains(content, fmt.Sprintf(\"<!-- %s -->\", startMarker)) &&\n        strings.Contains(content, fmt.Sprintf(\"<!-- %s -->\", endMarker))\n}\ncontent, _ := os.ReadFile(path)\nif !hasMarkers(string(content), \"START AUTOMATED TOOLSETS\", \"END AUTOMATED TOOLSETS\") {\n    log.Fatalf(\"%s is missing AUTOMATED markers; restore them from git history\", path)\n}","typeGuard":null,"tryCatchPattern":"updated, err := replaceSection(content, start, end, body)\nif err != nil {\n    if strings.Contains(err.Error(), \"markers not found\") {\n        // docs drifted: restore the exact marker comments, then re-run\n        log.Fatalf(\"%v — restore the <!-- %s --> / <!-- %s --> comments in the file\", err, start, end)\n    }\n    return err\n}","preventionTips":["Never edit or delete <!-- START/END AUTOMATED … --> comments when touching docs","Configure markdown formatters/linters to preserve HTML comments","CI: assert markers exist in docs before running codegen (grep check)"],"tags":["codegen","docs","markers","markdown","ci"],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}