{"record":{"id":"896a51bebf9501e8","repo":"dgraph-io/dgraph","slug":"error-while-archiving-debuginfo-directory-s","errorCode":null,"errorMessage":"error while archiving debuginfo directory: %s","messagePattern":"error while archiving debuginfo directory: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"dgraph/cmd/debuginfo/run.go","lineNumber":136,"sourceCode":"\tif debugInfoCmd.alphaAddr != \"\" {\n\t\tfilePrefix := filepath.Join(debugInfoCmd.directory, \"alpha_\")\n\n\t\tsaveMetrics(debugInfoCmd.alphaAddr, filePrefix, debugInfoCmd.seconds, debugInfoCmd.metricTypes)\n\n\t}\n\n\tif debugInfoCmd.zeroAddr != \"\" {\n\t\tfilePrefix := filepath.Join(debugInfoCmd.directory, \"zero_\")\n\n\t\tsaveMetrics(debugInfoCmd.zeroAddr, filePrefix, debugInfoCmd.seconds, debugInfoCmd.metricTypes)\n\n\t}\n}\n\nfunc archiveDebugInfo() error {\n\tarchivePath, err := createGzipArchive(debugInfoCmd.directory)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error while archiving debuginfo directory: %s\", err)\n\t}\n\n\tglog.Infof(\"Debuginfo archive successful: %s\", archivePath)\n\n\tif err = os.RemoveAll(debugInfoCmd.directory); err != nil {\n\t\tglog.Warningf(\"error while removing debuginfo directory: %s\", err)\n\t}\n\treturn nil\n}\n","sourceCodeStart":118,"sourceCodeEnd":146,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/dgraph/cmd/debuginfo/run.go#L118-L146","documentation":"archiveDebugInfo could not gzip the collected debuginfo directory via createGzipArchive. The wrapped error names the actual cause — typically inability to create the archive file or read the collected files.","triggerScenarios":"createGzipArchive returns an error after collectDebug has run: no write permission next to the directory, disk full while writing the archive, or a file disappearing/being unreadable mid-archive.","commonSituations":"Disk-full nodes during incident investigation, output directory on a read-only or quota-limited volume, files removed by another process/cleanup job while collection runs.","solutions":["Read the wrapped error; 'no space left' → free space, 'permission denied' → fix directory permissions.","Free disk space on the volume holding the debug directory (archives can be large with multiple profiles).","Re-run with --directory pointing to a volume with ample free space and write access.","Ensure no cleanup jobs delete the directory concurrently; re-run collection."],"exampleFix":"// before\ndgraph debuginfo --directory /tmp/dbg   # /tmp nearly full, gzip fails\n// after\ndgraph debuginfo --directory /data/dbg  # larger volume\n// then: tar -xzf /data/dbg.tar.gz","handlingStrategy":"validation","validationCode":"fi, err := os.Stat(dir)\nif err != nil || !fi.IsDir() {\n    return fmt.Errorf(\"debug dir %s unusable: %v\", dir, err)\n}\nif err := unix.Access(filepath.Dir(dir), unix.W_OK); err != nil {\n    return fmt.Errorf(\"no write permission to archive next to %s: %v\", dir, err)\n}","typeGuard":null,"tryCatchPattern":"if err := runDebugInfo(); err != nil {\n    if strings.Contains(err.Error(), \"archiving debuginfo\") {\n        // check df -h on the target volume, then re-run or keep the raw directory\n        glog.Warningf(\"archive failed, raw dir retained at %s\", debugDir)\n    }\n    return err\n}","preventionTips":["Ensure the volume holding the debug directory has space for the gzipped archive (2x dir size is safe).","Run on writable, non-quota-limited volumes.","Don't schedule cleanup jobs that race with collection/archiving.","Verify archive creation with a small test directory before real incidents."],"tags":["filesystem","archive","gzip","disk-full"],"backgroundTag":"archive-creation-failed","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}