can1357/oh-my-pi · error · Error
Unsupported embedded addon archive entry type ${typeflag}: $
Error message
Unsupported embedded addon archive entry type ${typeflag}: ${filename} What it means
The embedded addon archive may only contain regular files. Any tar entry whose typeflag (header byte 156) is not '0' — e.g. '5' (directory), 'L' (GNU long name), 'x'/'g' (PAX extended headers), symlinks — is rejected with this error naming the typeflag and entry name.
Source
Thrown at packages/natives/native/loader-state.js:530
let offset = 0;
while (offset + 512 <= archive.length) {
if (isZeroTarBlock(archive, offset)) break;
const header = archive.subarray(offset, offset + 512);
const filename = getTarEntryName(header);
const size = readTarOctal(header, 124, 12);
const typeflag = header[156] === 0 ? "0" : String.fromCharCode(header[156]);
offset += 512;
if (offset + size > archive.length) {
throw new Error(`Truncated embedded addon archive entry: ${filename}`);
}
if (!isSafeEmbeddedAddonFilename(filename)) {
throw new Error(`Unsafe embedded addon archive entry: ${filename}`);
}
if (typeflag !== "0") {
throw new Error(`Unsupported embedded addon archive entry type ${typeflag}: ${filename}`);
}
const file = pending.get(filename);
if (file) {
if (typeof file.size === "number" && file.size !== size) {
throw new Error(`Embedded addon size mismatch for ${filename}: expected ${file.size}, got ${size}`);
}
const targetPath = path.join(targetDir, filename);
writeEmbeddedAddonFile(targetPath, archive.subarray(offset, offset + size));
pending.delete(filename);
writtenPaths.push(targetPath);
}
offset += Math.ceil(size / 512) * 512;
}
if (pending.size > 0) {
throw new Error(`Embedded addon archive missing: ${[...pending.keys()].join(", ")}`);View on GitHub (pinned to 9690622007)
Solutions
- Repack with plain regular files only: tar --format=ustar -czf addon.tar.gz pi_natives.node (ustar avoids PAX/GNU extra entries).
- Ensure the staging directory contains only the .node files, no subdirectories or symlinks.
- Reinstall omp to restore the official archive.
Example fix
// before $ tar -czf addon.tar.gz pi_natives.node # GNU tar may emit PAX headers // after $ tar --format=ustar -czf addon.tar.gz pi_natives.node
Defensive patterns
Strategy: validation
Validate before calling
import { execFileSync } from "node:child_process";
function assertRegularFileEntriesOnly(archivePath) {
const listing = execFileSync("tar", ["-tvzf", archivePath], { encoding: "utf8" });
for (const line of listing.split("\n")) {
if (line && !line.startsWith("-")) {
throw new Error(`Non-regular tar entry: ${line}`);
}
}
} Try / catch
try {
extractEmbeddedAddonArchive({ archivePath, files, targetDir });
} catch (err) {
const m = err.message.match(/Unsupported embedded addon archive entry type (\S+):/);
if (m) {
// repack with --format=ustar and regular files only, then retry once
} else throw err;
} Prevention
- Create embedded archives with --format=ustar to suppress PAX/GNU metadata entries.
- Only pack regular files — exclude directories, symlinks, and dotfiles from staging.
- Run tar -tvzf in CI and assert every entry type is a regular file.
When it happens
Trigger: extractEmbeddedAddonArchive reads a tar entry whose typeflag is anything other than '0': directories inside the archive, GNU longname ('L') or PAX ('x') metadata entries produced by tar variants, symlinks ('2'), etc.
Common situations: An addon .tar.gz created with a different tar implementation that emits PAX/GNU metadata headers; packaging script archived a directory tree instead of flat files; a symlinked .node file was packed.
Related errors
- Unsupported archive format: ${assetName}
- Invalid tar octal value: ${value}
- Truncated embedded addon archive entry: ${filename}
- Unsafe embedded addon archive entry: ${filename}
- Archive member '${formatArchivePathForError(memberPath)}' is
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/fa1aacbb4505e80d.
Report an issue: GitHub.