{"record":{"id":"e9c000fcb984ce0f","repo":"github/github-mcp-server","slug":"failed-to-read-docs-file-w-e9c000","errorCode":null,"errorMessage":"failed to read docs file: %w","messagePattern":"failed to read docs file: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/github-mcp-server/generate_docs.go","lineNumber":110,"sourceCode":"\t// Replace tools section\n\tupdatedContent, err = replaceSection(updatedContent, \"START AUTOMATED TOOLS\", \"END AUTOMATED TOOLS\", toolsDoc)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Write back to file\n\terr = os.WriteFile(readmePath, []byte(updatedContent), 0600)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to write README.md: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc generateRemoteServerDocs(docsPath string) error {\n\tcontent, err := os.ReadFile(docsPath) //#nosec G304\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to read docs file: %w\", err)\n\t}\n\n\ttoolsetsDoc := generateRemoteToolsetsDoc()\n\n\t// Replace content between markers\n\tupdatedContent, err := replaceSection(string(content), \"START AUTOMATED TOOLSETS\", \"END AUTOMATED TOOLSETS\", toolsetsDoc)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Also generate remote-only toolsets section\n\tremoteOnlyDoc := generateRemoteOnlyToolsetsDoc()\n\tupdatedContent, err = replaceSection(updatedContent, \"START AUTOMATED REMOTE TOOLSETS\", \"END AUTOMATED REMOTE TOOLSETS\", remoteOnlyDoc)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn os.WriteFile(docsPath, []byte(updatedContent), 0600) //#nosec G306","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/cmd/github-mcp-server/generate_docs.go#L92-L128","documentation":"Returned by generateRemoteServerDocs when os.ReadFile(docsPath) fails, where docsPath is docs/remote-server.md (or the configured path). The generator reads the file to splice generated toolset tables between AUTOMATED markers; a missing or unreadable file aborts with this wrapped error.","triggerScenarios":"Running generate-docs outside the repo root so docs/remote-server.md does not resolve; the file was deleted/renamed during docs restructure; permission denial; custom path flag pointing nowhere.","commonSituations":"Subdirectory invocations of the codegen command; forks predating the file's introduction; CI sparse checkouts lacking docs/.","solutions":["Run the command from the repository root","Confirm docs/remote-server.md exists (restore from git if deleted: git checkout -- docs/remote-server.md)","Fix read permissions if applicable"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if _, err := os.Stat(\"docs/remote-server.md\"); err != nil {\n    log.Fatalf(\"docs/remote-server.md missing — run generate-docs from the repo root\")\n}","typeGuard":null,"tryCatchPattern":"if err := generateRemoteServerDocs(docsPath); err != nil {\n    if os.IsNotExist(errors.Unwrap(err)) {\n        log.Fatalf(\"%s not found; restore it (git checkout -- docs/remote-server.md) or fix cwd\", docsPath)\n    }\n    return err\n}","preventionTips":["Run docs codegen from the repo root","Restore deleted docs files from git before regenerating","Keep docs/ intact in CI sparse checkouts"],"tags":["codegen","docs","file-io","remote-server"],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}