{"record":{"id":"1bf2639d3b597fed","repo":"hasura/graphql-engine","slug":"generating-docs-failed-w","errorCode":null,"errorMessage":"generating docs failed: %w","messagePattern":"generating docs failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/commands/docs.go","lineNumber":80,"sourceCode":"\t\t\t\t)\n\t\t\tcase \"md\":\n\t\t\t\terr = doc.GenMarkdownTree(rootCmd, docDirectory)\n\t\t\tcase \"rest\":\n\t\t\t\terr = genReSTTreeCustom(\n\t\t\t\t\trootCmd,\n\t\t\t\t\tdocDirectory,\n\t\t\t\t\t\"Hasura CLI: \",\n\t\t\t\t\tfunc(s string) string { return \"\" },\n\t\t\t\t\tsphinxLinkHandler,\n\t\t\t\t)\n\t\t\tcase \"yaml\":\n\t\t\t\terr = doc.GenYamlTree(rootCmd, docDirectory)\n\t\t\tdefault:\n\t\t\t\treturn errors.E(op, \"unknown type\")\n\t\t\t}\n\n\t\t\tif err != nil {\n\t\t\t\treturn errors.E(op, fmt.Errorf(\"generating docs failed: %w\", err))\n\t\t\t}\n\n\t\t\tec.Logger.Infof(\"[%s] docs generated in [%s]\", docType, docDirectory)\n\n\t\t\treturn nil\n\t\t},\n\t}\n\n\tf := docsCmd.Flags()\n\tf.StringVar(\n\t\t&docType,\n\t\t\"type\",\n\t\t\"md\",\n\t\t\"type of documentation to generate (man, md, mdx, rest, yaml)\",\n\t)\n\tf.StringVar(&docDirectory, \"directory\", \"docs\", \"directory where docs should be generated\")\n\n\treturn docsCmd","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/commands/docs.go#L62-L98","documentation":"Wrapped error from the docs command when cobra's doc generator (GenManTree/GenMarkdownTree/GenYamlTree) fails while producing documentation files. The command supports man/markdown/yaml types; a failure after generation starts surfaces here.","triggerScenarios":"Running docs generation where writing individual doc files fails: disk full, files become read-only mid-run, invalid output directory state, or an unrecognized doc type was supplied (default branch returns 'unknown type' separately).","commonSituations":"Disk quota exhausted during generation; output dir on a failing mount; passing an unsupported --type flag value leading to inconsistent state.","solutions":["Verify the --type flag is one of man|markdown|yaml and re-run","Check disk space and write permissions in the output directory","Re-create the output directory and retry generation"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"switch docType {\ncase \"man\", \"markdown\", \"yaml\":\ndefault:\n    log.Fatalf(\"unsupported doc type: %s\", docType)\n}","typeGuard":null,"tryCatchPattern":"if err := docsRun(); err != nil {\n    if strings.Contains(err.Error(), \"generating docs failed\") { /* disk/permission issue */ }\n}","preventionTips":["Check disk space before generation","Use supported --type values only"],"tags":["hasura","cli","docs","generation","filesystem"],"backgroundTag":"file-write-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}