dgraph-io/dgraph · error

error while archiving debuginfo directory: %s

Error message

error while archiving debuginfo directory: %s

What it means

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.

Source

Thrown at dgraph/cmd/debuginfo/run.go:136

	if debugInfoCmd.alphaAddr != "" {
		filePrefix := filepath.Join(debugInfoCmd.directory, "alpha_")

		saveMetrics(debugInfoCmd.alphaAddr, filePrefix, debugInfoCmd.seconds, debugInfoCmd.metricTypes)

	}

	if debugInfoCmd.zeroAddr != "" {
		filePrefix := filepath.Join(debugInfoCmd.directory, "zero_")

		saveMetrics(debugInfoCmd.zeroAddr, filePrefix, debugInfoCmd.seconds, debugInfoCmd.metricTypes)

	}
}

func archiveDebugInfo() error {
	archivePath, err := createGzipArchive(debugInfoCmd.directory)
	if err != nil {
		return fmt.Errorf("error while archiving debuginfo directory: %s", err)
	}

	glog.Infof("Debuginfo archive successful: %s", archivePath)

	if err = os.RemoveAll(debugInfoCmd.directory); err != nil {
		glog.Warningf("error while removing debuginfo directory: %s", err)
	}
	return nil
}

View on GitHub (pinned to 759e242be6)

Solutions

  1. Read the wrapped error; 'no space left' → free space, 'permission denied' → fix directory permissions.
  2. Free disk space on the volume holding the debug directory (archives can be large with multiple profiles).
  3. Re-run with --directory pointing to a volume with ample free space and write access.
  4. Ensure no cleanup jobs delete the directory concurrently; re-run collection.

Example fix

// before
dgraph debuginfo --directory /tmp/dbg   # /tmp nearly full, gzip fails
// after
dgraph debuginfo --directory /data/dbg  # larger volume
// then: tar -xzf /data/dbg.tar.gz
Defensive patterns

Strategy: validation

Validate before calling

fi, err := os.Stat(dir)
if err != nil || !fi.IsDir() {
    return fmt.Errorf("debug dir %s unusable: %v", dir, err)
}
if err := unix.Access(filepath.Dir(dir), unix.W_OK); err != nil {
    return fmt.Errorf("no write permission to archive next to %s: %v", dir, err)
}

Try / catch

if err := runDebugInfo(); err != nil {
    if strings.Contains(err.Error(), "archiving debuginfo") {
        // check df -h on the target volume, then re-run or keep the raw directory
        glog.Warningf("archive failed, raw dir retained at %s", debugDir)
    }
    return err
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of dgraph-io/dgraph@759e242be6 (2026-09-01). Data as JSON: /api/errors/896a51bebf9501e8. Report an issue: GitHub.