PaddlePaddle/PaddleOCR · critical · Error
Entry "${targetName}" was not found in the tar archive.
Error message
Entry "${targetName}" was not found in the tar archive. What it means
Thrown by pickTarEntry() in tar.ts when the requested entry name cannot be found in the parsed tar archive - neither as an exact normalized match nor as a path suffix (name.endsWith("/" + target)). The loader picks MODEL_ENTRY_PATHS.model and .config out of the bundle, so this means the tar parsed fine but does not contain the expected file name, e.g. a differently-named or empty archive.
Source
Thrown at paddleocr-js/packages/core/src/resources/tar.ts:79
}
return entries;
}
export function pickTarEntry(entries: Map<string, Uint8Array>, targetName: string): Uint8Array {
const normalizedTarget = normalizeEntryName(targetName);
const entry = entries.get(normalizedTarget);
if (entry) {
return entry;
}
for (const [name, value] of entries) {
if (name.endsWith(`/${normalizedTarget}`) || name === normalizedTarget) {
return value;
}
}
throw new Error(`Entry "${targetName}" was not found in the tar archive.`);
}
View on GitHub (pinned to 2661c7c0ef)
Solutions
- List the archive (tar -tf bundle.tar) and compare entry names with the expected entry paths for your package version
- Repackage the tar so the model/config files sit at the expected names (top-level or as a suffix path)
- Use the official bundle URLs shipped as DEFAULT_MODEL_ASSETS presets
- Verify the downloaded byte size matches the published size to catch truncated files
Example fix
# before tar -tf custom.tar # weights.onnx (unexpected name -> pickTarEntry throws) # after tar -tf custom.tar # inference.pdmodel # inference.yml
Defensive patterns
Strategy: validation
Validate before calling
import { extractTarEntries } from "@paddleocr/core/resources/tar";
function bundleHasEntries(url: string): Promise<boolean> {
return fetch(url).then(r => r.arrayBuffer()).then(buf => {
const entries = extractTarEntries(buf);
return entries.has("inference.pdmodel") && entries.has("inference.yml");
});
} Try / catch
try {
const model = await loadModelAsset(asset);
} catch (e) {
if (e instanceof Error && e.message.includes("not found in the tar archive")) {
// re-download from official preset URL or repackage; do not retry same bundle
} else throw e;
} Prevention
- tar -tf every custom bundle and diff entry names against expected paths
- Keep entry filenames identical to official bundles when repackaging
- Verify artifact checksums/sizes when mirroring models
When it happens
Trigger: Downloading a tar whose internal layout differs (weights named inference.pdmodel vs model.onnx); a tar containing a single directory prefix mismatch; a 200-response that is actually a different artifact (docs tar, source tar); zero-entry tar from a truncated but status-ok response.
Common situations: Mixing Paddle2ONNX-converted bundles with native paddle bundles; self-packaging with renamed files; mirrors serving wrong artifacts; upstream changing entry filenames across versions while the client pins old expectations.
Related errors
- ${kind} model requires a non-empty ${MODEL_ENTRY_PATHS.model
- ${kind} model requires a non-empty ${MODEL_ENTRY_PATHS.confi
- Unsupported model resource slot "${slot}".
- Unsupported OCR model: {model}
- Unsupported document parsing model: {model}
AI-assisted analysis of PaddlePaddle/PaddleOCR@2661c7c0ef (2026-08-14).
Data as JSON: /api/errors/1a8866b7a9cbd702.
Report an issue: GitHub.