Billionmail/BillionMail · error

disk quota exceeded

Error message

disk quota exceeded

What it means

RarUnpacker.incWritten mirrors the gzip quota guard: every byte written while building the archive is accumulated, and once r.written exceeds r.quota (when quota > -1) the compression is aborted with this error. It protects against writing more data than the configured allowance.

Source

Thrown at core/internal/service/compress/rar.go:56

	defer r.mutex.Unlock()
	r.quota = quota
}

// incWritten increases the size of already decompressed file
func (r *RarUnpacker) incWritten(n int64) (err error) {
	// if no limit is set, do nothing
	if r.quota < 0 {
		return nil
	}

	r.mutex.Lock()
	defer r.mutex.Unlock()

	r.written += n

	// check if exceeds the limit
	if r.quota > -1 && r.written > r.quota {
		err = errors.New("disk quota exceeded")
		return
	}

	return nil
}

// Decompress decompresses a rar file
func (r *RarUnpacker) Decompress(src, dst string) error {
	// get absolute path of decompression target
	dstAbs, err := filepath.Abs(dst)
	if err != nil {
		return err
	}

	// open the rar file
	file, err := os.Open(src)
	if err != nil {
		return err

View on GitHub (pinned to fc36c76c05)

Solutions

  1. Raise the quota with SetQuota to accommodate expected archive size
  2. Set quota to -1 to disable the limit
  3. Split the source into multiple archives or exclude huge files
  4. Verify actual free space/quota on the output volume

Example fix

// before
r.SetQuota(10 * 1024 * 1024) // 10MB, too small
// after
r.SetQuota(10 * 1024 * 1024 * 1024) // 10GB, sized to workload
Defensive patterns

Strategy: validation

Validate before calling

var total int64
for _, src := range srcList {
	filepath.WalkDir(src, func(_ string, d fs.DirEntry, err error) error {
		if err == nil && !d.IsDir() { if i, _ := d.Info(); i != nil { total += i.Size() } }
		return nil
	})
}
if r.quota > -1 && total > r.quota { /* increase quota first */ }

Try / catch

if err := r.Compress(dst, srcList...); err != nil && strings.Contains(err.Error(), "disk quota exceeded") {
	// raise quota, free space, or split the job
}

Prevention

When it happens

Trigger: Calling RarUnpacker.Compress where the produced .rar output grows beyond the configured quota; quota was set explicitly to a value smaller than the archive size.

Common situations: Quota configured for smaller datasets; compressing videos/large databases; shared servers where quota is used to cap per-job disk usage.

Related errors


AI-assisted analysis of Billionmail/BillionMail@fc36c76c05 (2026-09-05). Data as JSON: /api/errors/9344fc9eeac18e27. Report an issue: GitHub.