EPUB FixerKDP upload error scanner

EPUB error guide

EPUB mimetype file missing or not first (PKG-006)

If EPUBCheck reports that the mimetype file entry is missing or is not the first file in the archive, scan that EPUB before zipping it again. The report checks the root entry order and separates PKG-006 from PKG-007 content or compression errors.

Your error

Mimetype is missing or not the first file.

Upload the same EPUB that produced ERROR(PKG-006), PKG_006, or the equivalent KDP or Kindle Previewer message.

What the scan checks

Whether mimetype exists at the root and comes first.

The report shows the current first ZIP entry and separates this error from invalid or compressed mimetype content, which is usually PKG-007.

Stop if

Core EPUB files are also missing.

Rebuilding the ZIP order cannot restore a missing OPF file, container.xml, or book content that was never packaged.

Scan when the message does not name the affected path. The report shows affected paths and repair decisions, not manuscript text.

No signup before the scan report.Checks EPUB package paths, not manuscript text.Repair download only after EPUBCheck passes again.

Need fixed-layout, DRM, or source-file help? Check unsupported or review-first EPUB cases.

Match these report titles

  • mimetype file is missing
  • mimetype file is not the first ZIP entry
  • ERROR(PKG-006): Mimetype file entry is missing or is not the first file in the archive
  • PKG-006 EPUB error
  • PKG_006 mimetype file entry is missing or not first
  • EPUB mimetype file missing or not first

Use this guide when

Your message matches "mimetype file is missing" or one of the report titles above.

Upload if

You have the exported reflowable .epub and need the affected path, file, field, or repair decision before editing.

Handle outside this tool

Use the source tool or publishing workflow for DOCX, PDF, KPF, KCB, fixed-layout, comics, image-first books, DRM, visual design, or KDP listing and approval problems.

Read the scan report

Decide if this report item matches.

Use the report label, affected file, and repair decision together. A matching title alone is not enough if the file path or EPUB structure points to a different problem.

Error textAffected pathDecisionRepair, review, or stop

A useful report does not stop at the error name. It connects the message to an internal file and a next action.

Match the report title.

Look for "mimetype file is missing" or the closest title above. Keep the original EPUBCheck, KDP, or Kindle Previewer wording if it differs.

Check the affected file first.

Use the Affected area, Source file, Target file, or Problem type rows before editing OPF, nav, XHTML, CSS, or image paths.

Follow the repair decision.

Repairable means one clear structural change. Needs review or Not supported means use the named file, source project, or platform step.

Keep with your repair note.

Copy these fields from the report instead of rebuilding the fix from memory.

Source file
Target path or field
Original error
Repair decision
Next step

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.

Plain explanation

The EPUB ZIP does not meet the mimetype file rules.

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, not first, or hidden under an extra parent folder, and whether a different mimetype rule is failing too.

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.

Repair summary

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 why mimetype is missing or not first.

PKG-006 usually means the EPUB was zipped in the wrong order or the whole book folder was nested inside the archive. The chapters may still be intact, but the root-level mimetype entry has to come first.

Matched

What it means

An EPUB is a ZIP file with strict packaging rules. PKG-006 means the root mimetype entry is missing or is not first. Invalid contents or compression are normally reported separately as PKG-007.

Matched

Can it be fixed automatically?

A checked repair is possible by rebuilding the EPUB ZIP container with mimetype first and uncompressed, then adding the rest of the package files after it.

Matched

What to check next

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

Matched

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: the mimetype entry is missing or another ZIP entry comes first.

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.

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.

The entry is named MIMETYPE or placed in a subfolder.

EPUB packaging requires a root entry named mimetype exactly. A different case or path leaves the required entry missing.

Restore the exact root-level name during a clean ZIP rebuild, then validate the whole EPUB again.

The exact PKG-006 mimetype error text

PKG-006 / 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 appears when the EPUB starts with the wrong ZIP entry.

An EPUB is a ZIP file with strict packaging rules. PKG-006 means the root mimetype entry is missing or is not first. Invalid contents or compression are normally reported separately as PKG-007.

This can happen after manually zipping a folder, using a generic archive tool, dragging files into an existing archive, or exporting from a tool that changes the package order. The book files can all be present while the ZIP package still fails validation.

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

A checked repair is possible 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 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 mimetype is missing or not first, separate PKG-007 content and compression errors, and show 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 has no root-level mimetype entry or another ZIP entry appears before it. The repair must put a correct mimetype entry first and then validate the rebuilt EPUB again.

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, and offer the repaired EPUB only after EPUBCheck passes again.

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

Generic ZIP tools can place the parent folder or META-INF before mimetype. That causes PKG-006. If mimetype is first but compressed or contains the wrong text, EPUBCheck normally reports PKG-007 instead.

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