{"record":{"id":"9344fc9eeac18e27","repo":"Billionmail/BillionMail","slug":"disk-quota-exceeded-9344fc","errorCode":null,"errorMessage":"disk quota exceeded","messagePattern":"disk quota exceeded","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/internal/service/compress/rar.go","lineNumber":56,"sourceCode":"\tdefer r.mutex.Unlock()\n\tr.quota = quota\n}\n\n// incWritten increases the size of already decompressed file\nfunc (r *RarUnpacker) incWritten(n int64) (err error) {\n\t// if no limit is set, do nothing\n\tif r.quota < 0 {\n\t\treturn nil\n\t}\n\n\tr.mutex.Lock()\n\tdefer r.mutex.Unlock()\n\n\tr.written += n\n\n\t// check if exceeds the limit\n\tif r.quota > -1 && r.written > r.quota {\n\t\terr = errors.New(\"disk quota exceeded\")\n\t\treturn\n\t}\n\n\treturn nil\n}\n\n// Decompress decompresses a rar file\nfunc (r *RarUnpacker) Decompress(src, dst string) error {\n\t// get absolute path of decompression target\n\tdstAbs, err := filepath.Abs(dst)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// open the rar file\n\tfile, err := os.Open(src)\n\tif err != nil {\n\t\treturn err","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/Billionmail/BillionMail/blob/fc36c76c050c3775c5e899faf7403cf0262d2744/core/internal/service/compress/rar.go#L38-L74","documentation":"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.","triggerScenarios":"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.","commonSituations":"Quota configured for smaller datasets; compressing videos/large databases; shared servers where quota is used to cap per-job disk usage.","solutions":["Raise the quota with SetQuota to accommodate expected archive size","Set quota to -1 to disable the limit","Split the source into multiple archives or exclude huge files","Verify actual free space/quota on the output volume"],"exampleFix":"// before\nr.SetQuota(10 * 1024 * 1024) // 10MB, too small\n// after\nr.SetQuota(10 * 1024 * 1024 * 1024) // 10GB, sized to workload","handlingStrategy":"validation","validationCode":"var total int64\nfor _, src := range srcList {\n\tfilepath.WalkDir(src, func(_ string, d fs.DirEntry, err error) error {\n\t\tif err == nil && !d.IsDir() { if i, _ := d.Info(); i != nil { total += i.Size() } }\n\t\treturn nil\n\t})\n}\nif r.quota > -1 && total > r.quota { /* increase quota first */ }","typeGuard":null,"tryCatchPattern":"if err := r.Compress(dst, srcList...); err != nil && strings.Contains(err.Error(), \"disk quota exceeded\") {\n\t// raise quota, free space, or split the job\n}","preventionTips":["Set the quota relative to measured source size, not a hardcoded value","Disable quota (-1) where external disk limits already apply","Split very large sources into several archives","Track quota headroom in job metrics"],"tags":["go","compression","rar","disk-quota"],"backgroundTag":"disk-quota-exceeded","analyzedSha":"fc36c76c050c3775c5e899faf7403cf0262d2744","analyzedAt":"2026-09-05T21:28:54.019Z","contentChangedAt":"2026-09-05T21:28:54.019Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}