MuntashirAkon/AppManager · error · IllegalArgumentException
${field} '${value}' is too big ( > ${maxValue} ).${additiona
Error message
${field} '${value}' is too big ( > ${maxValue} ).${additionalMsg} What it means
failForBigNumber is the private helper guarding tar header numeric fields: tar's classic format stores sizes, timestamps, user/group ids, modes and device numbers in limited-width octal fields. If the value is negative or exceeds the field's maximum, an IllegalArgumentException is thrown because the value cannot be encoded in the chosen header format. The optional additionalMsg typically suggests using STAR or POSIX (PAX) extensions to overcome the limit.
Source
Thrown at app/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java:636
TarConstants.MAXID);
failForBigNumber("minor device number", entry.getDevMinor(),
TarConstants.MAXID);
}
private void failForBigNumber(final String field, final long value, final long maxValue) {
failForBigNumber(field, value, maxValue, "");
}
private void failForBigNumberWithPosixMessage(final String field, final long value,
final long maxValue) {
failForBigNumber(field, value, maxValue,
" Use STAR or POSIX extensions to overcome this limit");
}
private void failForBigNumber(final String field, final long value, final long maxValue,
final String additionalMsg) {
if (value < 0 || value > maxValue) {
throw new IllegalArgumentException(field + " '" + value //NOSONAR
+ "' is too big ( > "
+ maxValue + " )." + additionalMsg);
}
}
/**
* Handles long file or link names according to the longFileMode setting.
*
* <p>I.e. if the given name is too long to be written to a plain tar header then <ul> <li>it
* creates a pax header who's name is given by the paxHeaderName parameter if longFileMode is
* POSIX</li> <li>it creates a GNU longlink entry who's type is given by the linkType parameter
* if longFileMode is GNU</li> <li>it throws an exception if longFileMode is ERROR</li> <li>it
* truncates the name if longFileMode is TRUNCATE</li> </ul></p>
*
* @param entry entry the name belongs to
* @param name the name to write
* @param paxHeaders current map of pax headers
* @param paxHeaderName name of the pax header to writeView on GitHub (pinned to 0152f468fc)
Solutions
- Enable PAX format: tarOut.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_POSIX) so large values are stored in PAX extended headers.
- Alternatively use BIGNUMBER_STAR (tarOut.setBigNumberMode(BIGNUMBER_STAR)) for STAR extension support.
- If you must stay with the classic format, split or cap content below the field limit (e.g. < 8 GiB per entry) and use a valid non-negative timestamp.
- Check your entry construction: ensure getSize() is not accidentally set to a negative or stale value.
Example fix
// before TarArchiveOutputStream tar = new TarArchiveOutputStream(out); // BIGNUMBER_ERROR default TarArchiveEntry e = new TarArchiveEntry(hugeFile, "huge.bin"); // size > 8GB // after TarArchiveOutputStream tar = new TarArchiveOutputStream(out); tar.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_POSIX); // supports > 8GB TarArchiveEntry e = new TarArchiveEntry(hugeFile, "huge.bin");
Defensive patterns
Strategy: validation
Validate before calling
if (file.length() > 8L * 1024 * 1024 * 1024
&& tarOut.getBigNumberMode() == TarArchiveOutputStream.BIGNUMBER_ERROR) {
tarOut.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_POSIX);
}
if (entry.getSize() < 0) {
throw new IllegalArgumentException("entry size must be non-negative");
} Try / catch
try {
tarOut.putArchiveEntry(entry);
} catch (IllegalArgumentException e) {
if (e.getMessage() != null && e.getMessage().contains("is too big")) {
tarOut.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_POSIX);
// rebuild stream and retry, or skip the oversized entry
} else {
throw e;
}
} Prevention
- Always set setBigNumberMode(BIGNUMBER_POSIX) (or STAR) when archiving files that may exceed 8 GiB.
- Validate entry size and modification time are non-negative and within classic tar limits before putArchiveEntry.
- Prefer the POSIX encoding globally unless you need maximum reader compatibility.
When it happens
Trigger: putArchiveEntry with a TarArchiveEntry whose size exceeds 8 GB (classic format max), or setting modTime/mode/userId/groupId/devMajor/devMinor beyond the field limit while bigNumberMode is BIGNUMBER_ERROR (the default) — e.g. entry.setSize(largeValue) or a file >8 GiB archived without enabling POSIX/PAX big numbers.
Common situations: Archiving files larger than 8 GiB with default stream configuration; timestamps beyond the 8GB-octal range (e.g. dates past 2242 in seconds for some fields); negative values from miscalculated sizes; Android/older toolchains where the default mode was never changed to POSIX.
Understand the failure class
Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.
Related errors
- APK files backup is requested but no APK files have been bac
- APK files backup is requested but no APK files have been bac
- Size is out of range: + size
- Major device number is out of range: + devNo
- Request to write '${numToWrite}' bytes exceeds size in heade
AI-assisted analysis of MuntashirAkon/AppManager@0152f468fc (2026-09-12).
Data as JSON: /api/errors/4919147d7adab573.
Report an issue: GitHub.