EPUB FixerKDP upload error scanner

EPUB error guide

PKG_006 mimetype file entry is missing or not first

How PKG_006 happens when the EPUB ZIP wrapper has a missing, compressed, or misplaced mimetype entry, and when rebuilding the archive is safe.

1. Example report output

What the PKG_006 report should show.

The report should focus on the ZIP wrapper first: whether mimetype exists, where it appears, and whether it was compressed.

EPUBCheck message

ERROR(PKG-006): Mimetype file entry is missing or is not the first file in the archive.

KDP / Previewer wording

The EPUB package or ZIP container is invalid.

EPUB Fixer report

First ZIP entry is META-INF/container.xml; expected root-level mimetype stored without compression.

Do this next

Rebuild the ZIP only if mimetype, META-INF/container.xml, OPF, and book files are otherwise intact.

Do not do this

Do not rename an arbitrary ZIP to .epub unless the root entries and mimetype storage are correct.

If container.xml, the OPF file, or core content files are missing too, fix the package layout before treating this as a simple ZIP rebuild.

2. Next step

Rebuild the archive only after checking the root layout.

PKG_006 is often safe, but only when the EPUB files are at the right level and the problem is the ZIP order or compression mode.

Upload scan

Use this after manual zipping or repackaging.

The report can tell whether mimetype is missing, compressed, not first, or hidden under an extra parent folder.

Manual check

Use this when the EPUB has a nested folder.

Open the ZIP layout and confirm mimetype, META-INF, and the OPF package are at the expected root-level paths.

Formatter handoff

Use this when the archive is damaged or incomplete.

A ZIP-order rebuild cannot restore missing OPF files, encrypted files, or book content that was never packaged.

3. Concrete path example

The first ZIP entries decide this error.

The EPUB can contain valid chapters and still fail if the ZIP starts with the wrong file.

Message: ERROR(PKG-006): mimetype file entry is missing or not first
Wrong order:
1. META-INF/container.xml
2. mimetype

Correct order:
1. mimetype  (stored, uncompressed)
2. META-INF/container.xml
3. OEBPS/content.opf

After rebuilding the wrapper, run validation again because deeper OPF or resource errors may appear next.

Quick decision

Treat PKG_006 as a ZIP packaging check first.

Do not rewrite chapters or metadata until you know whether the archive simply has the wrong first entry or a deeper package problem.

Scan first

You zipped the EPUB by hand or changed the archive.

Scan the file to confirm whether mimetype is missing, compressed, not first, or nested under an extra folder.

Safe fix

The book files are intact and only ZIP order is wrong.

Rebuild the archive with mimetype first, uncompressed, then add META-INF, OPF, XHTML, images, CSS, fonts, and other resources.

Stop

Core package files are missing or the archive is damaged.

A ZIP rebuild cannot fix a missing OPF, missing container.xml, encrypted content, or a nested package that needs repackaging.

Start here

Check the ZIP wrapper before editing the book content.

PKG_006 usually means the EPUB was repacked incorrectly. The chapters may be fine, but the archive has to start with a root-level, uncompressed mimetype file.

What it means

An EPUB is a ZIP file with strict packaging rules. The mimetype entry must be at the archive root, must be the first entry, and must be stored without compression.

Can it be fixed automatically?

This can usually be fixed by rebuilding the EPUB ZIP container with mimetype first and uncompressed, then adding the rest of the package files after it.

What to check next

Open the EPUB as a ZIP package and check whether a file named mimetype exists at the root level.

What not to assume

If the archive is corrupted, encrypted, nested under an extra parent folder, or missing core package files, rebuilding the ZIP order alone is not enough.

Common situations

Check the exact ZIP mistake behind PKG_006.

PKG_006 is narrow, but it can hide several different packaging mistakes.

The mimetype file is missing.

The EPUB has no root-level file named mimetype, even if the rest of the book files are present.

Add a root mimetype file with application/epub+zip only as part of a correct EPUB rebuild.

mimetype exists but is not the first ZIP entry.

Generic archive tools may place META-INF or OEBPS before mimetype.

Rebuild the ZIP so mimetype is written first.

mimetype is compressed.

The file can be first and still fail if it was deflated instead of stored.

Store mimetype without compression, then compress the rest of the EPUB normally.

The EPUB folder was zipped instead of its contents.

Everything may sit under one parent folder, so mimetype is not at the archive root.

Repackage from inside the book folder and recheck container.xml and the OPF path.

mimetype contains extra bytes or a newline.

The file can be first and uncompressed but still fail if its content is not exactly application/epub+zip.

Rewrite the mimetype file as plain text with no extra whitespace, then rebuild and validate again.

The PKG_006 mimetype error text

PKG_006: Mimetype file entry is missing or is not the first file in the archive.

Where PKG_006 appears in KDP and EPUBCheck

EPUBCheck, Kindle Previewer, or KDP can see that the upload is an EPUB-like archive, but the ZIP entries are not arranged the way EPUB requires.

What it means

PKG_006 is usually caused by a generic ZIP tool.

An EPUB is a ZIP file with strict packaging rules. The mimetype entry must be at the archive root, must be the first entry, and must be stored without compression.

This usually happens after manually zipping a folder, using a generic archive tool, dragging files into an existing archive, or re-exporting from a tool that changed package order. The book files can all be present while the ZIP wrapper is still invalid.

Before you edit

Inspect the first ZIP entry and the root-level mimetype file.

Do not start by rewriting OPF metadata or chapters. First verify whether the archive order and compression mode satisfy the EPUB container rule.

  1. 1Open the EPUB as a ZIP package and check whether a file named mimetype exists at the root level.
  2. 2Confirm the mimetype file contains exactly application/epub+zip.
  3. 3Check whether mimetype is the first ZIP entry and is stored without compression.
  4. 4If you rebuilt the EPUB manually, make sure you zipped the contents of the book folder, not the folder itself.
  5. 5After rebuilding the ZIP, confirm META-INF/container.xml and the OPF file are still at the paths expected by the EPUB.
  6. 6Run EPUBCheck again after repackaging because a fixed ZIP wrapper can reveal OPF, resource, or anchor errors that were hidden before.

Why KDP checks it

Why validators reject a misplaced mimetype entry.

EPUB ZIP container

The EPUB ZIP wrapper must point readers to the OPF file through META-INF/container.xml and keep packaged resources at the paths the book references.

EPUBCheck

EPUBCheck checks EPUB 2 and EPUB 3 files against the official rules and reports package, markup, link, and file-reference problems.

Can this be fixed safely?

When rebuilding the EPUB ZIP is safe.

When automatic repair is safe

This can usually be fixed by rebuilding the EPUB ZIP container with mimetype first and uncompressed, then adding the rest of the package files after it.

When you need manual review

If the archive is corrupted, encrypted, nested under an extra parent folder, or missing core package files, rebuilding the ZIP order alone is not enough.

Before / after example

Before: mimetype is missing, compressed, or appears after META-INF/container.xml. After: mimetype is the first root entry, stored without compression, and contains application/epub+zip exactly.

Ready to retry?

Scan the EPUB before repackaging it.

The scan can confirm whether this is only a container-order problem or whether the same file is also missing container.xml, the OPF package, or required resources.

Upload EPUB to scan

FAQ

Questions authors ask about PKG_006.

What does PKG_006 mimetype file entry is missing or not first mean?

It means the EPUB ZIP container was packaged in the wrong order or without the required root-level mimetype file. EPUB rules require the mimetype entry to be first and uncompressed.

Can rebuilding the EPUB ZIP fix PKG_006?

Yes, if the rest of the EPUB package is intact. The usual fix is to rebuild the archive with mimetype first, stored without compression, then run EPUBCheck again.

Why did my EPUB fail after I zipped the folder again?

Generic ZIP tools often put files in the wrong order or compress the mimetype entry. EPUB packaging rules require mimetype to be the first ZIP entry and stored uncompressed.

Does PKG_006 mean my chapters or images are broken?

Not necessarily. PKG_006 is usually about the ZIP wrapper around the EPUB. The content can be present while the mimetype entry is missing, compressed, or not first.

Can I fix PKG_006 by renaming a ZIP file to EPUB?

Only if the ZIP was built with the EPUB rules. Renaming a generic ZIP file does not make mimetype first or uncompressed.

What should I check after rebuilding the archive?

Check that META-INF/container.xml and the OPF file are still at the expected paths, then run EPUBCheck again. PKG_006 can hide deeper package errors until the ZIP wrapper is fixed.

Related EPUB error guides