Repository navigation
MaxRatio fails scene releases whose Subs archive contains a nested RAR (whole extraction fails, movie not imported) #796
Description
Summary
Since the zip-bomb limits (#655, xtractr #176/#182/#185), a common scene layout fails every time with
extracted size exceeds maximum compression ratio: a Subs/*.subs.rar that contains a VobSub .idx
plus a nested .rar with the .sub. The real ratio of every archive involved is below 5, but the
shared extras budget pushes it over. Because the error fails the whole item, the main feature (which
extracted fine) is not imported either.
Versions
- unpackerr 0.16.1 (
golift/unpackerr:latest, revision 1128), golift.io/xtractr v0.6.0 - Radarr item, torrent protocol, default settings (Starr
MaxRatio=defaultMaxRatio5.0)
Release layout
Autumn.Sonata.1978.REMASTERED.1080p.BluRay.x264-DEPTH (standard scene release):
Autumn...DEPTH/
autumn...-depth.rar + .r00 … .r92 (100 MB volumes) -> Autumn...DEPTH.mkv 9,384,500,973 B
Subs/autumn...-depth.subs.rar 1,891,221 B
├─ Autumn...DEPTH.idx 45,617 B
└─ Autumn...DEPTH.rar 1,845,399 B <- nested archive
└─ Autumn...DEPTH.sub 8,957,952 B
Log
Extraction Queued: /data/downloads/_torrent/Autumn...DEPTH, retries: 0, 2 archives in 2 folders, delete orig: false
Extraction Started: Autumn...DEPTH
Extraction Failed: Autumn...DEPTH: extraction failed: extracted size exceeds maximum compression ratio
(file: /data/downloads/_torrent/Autumn...DEPTH_unpackerred/Autumn...DEPTH.rar)
Status: Autumn...DEPTH (Extraction Failed, elapsed: 53m0s) on archive: 2/2 @ 0BB/8.5MB (0%)
The failing file is the nested …DEPTH.rar inside the _unpackerred output of subs.rar.
Why it trips
Per queue.go / progress.go, extras share the parent's tracker: Compressed stays the parent's size
("child sizes are not added") while Wrote keeps growing and includes the intermediate nested archive:
| bytes | |
|---|---|
parent subs.rar (denominator) |
1,891,221 |
written by parent: .idx + nested .rar |
1,891,016 |
written by nested extra: .sub |
8,957,952 |
| Wrote / Compressed | 5.74 > 5.0 |
Actual ratios: subs.rar → 1.0×, nested .rar → .sub 4.85×, .idx+.sub vs subs.rar 4.76×.
The overshoot comes only from counting the nested archive's bytes as output while not counting them as
input.
Impact
- The whole item fails, so Radarr never imports the 9.4 GB
.mkvalthough its extraction is fine
(queue stays at "Found archive file, might need to be extracted"). Unpackerr retries and fails again. - VobSub
Subs/*.subs.rarwith a nested.raris the normal layout for many scene BluRay groups, so this
affects a lot of older x264 releases. - There is no knob for Starr items:
max_ratioexists only for[[folder]]; Starr uses the constant
defaultMaxRatio = 5.0.
Possible fixes (your call)
- When an extra (nested archive) starts, add its own compressed size to the shared
Compressed
(or subtract it fromWrote, since it is intermediate data, not final output). Either keeps the cap
meaningful for real bombs while a 1.9 MB → 9 MB subtitle pack passes. - Make the Starr
MaxRatioconfigurable (likemax_bytes/ foldermax_ratio), so users can raise it. - Optionally, a ratio failure in one archive of a multi-archive item could fail only that archive and
still let the item import (the feature and the subtitles are independent archives in different folders).
Happy to test a build or provide the archives' headers if useful.
Activity
davidnewhall commentedon Sep 30, 2026
Thanks for this. I'll see what we can come up with to solve it.
nelz0n commentedon Sep 30, 2026
Sure, thanks for the great work btw. I still remember when i was a young boy and i hated how i need to unpack everything by hand. No more :)
davidnewhall commentedon Oct 1, 2026
The two linked pull requests should fix this. A change to xtractr removes extracted archives from "wrote" so the budget is calculated more accurately. I also bumped the max ratio from 5:1 to 7.5:1. I never intended for it to be so close, 5:1 seemed sufficient, but clearly you have an archive close to that. I don't really want to make this tunable unless I absolutely have to. I like to keep things simple and just make them work correctly. There's enough protections in here that even a 10:1 ratio is probably fine. If I get more complaints I'll bump it again.
You can test it by installing the unstable build. Directions: https://unstable.golift.io/unpackerr
You're welcome to review the code, and/or provide more suggestions and feedback. Thanks again!
nelz0n commentedon Oct 1, 2026
Hi, thanks, fix looks good on my test cases.
One note on the integration test in Unpackerr/unpackerr-inttest#13. The fixture's inflated ratio is ~5.84, but the cap is now 7.5. So the test would pass with xtractr v0.7.0 too, because the bump alone is enough.
davidnewhall commentedon Oct 1, 2026
Thanks for having a look. As for your note, it's the reason I made this: