Skip to content
EPUBCheck · Package and ZIP container

PKG-004

Updated:

EPUBCheck PKG-004 is a fatal error message: “Corrupted EPUB ZIP header.” The ZIP structure of the EPUB is damaged, so EPUBCheck cannot list or read its files.

The official message

Corrupted EPUB ZIP header.

Default severity
Fatal error. EPUBCheck could not continue checking this part of the EPUB. The file is invalid.
EPUBCheck version
5.4.0

Typical causes

  • A truncated download or transfer.
  • A tool that wrote the ZIP incorrectly or was interrupted while writing it.

How to fix it

  • Get a fresh copy of the EPUB or export it again from its source.
  • Rebuild the archive with the mimetype file first and stored uncompressed, for example from the folder that contains the book: zip -X0 book.epub mimetype and then zip -rX9 book.epub META-INF OEBPS (use your own folder names).

Terms used here

Other PKG messages

  • PKG-003 Unable to read EPUB file header. This is likely a corrupted EPUB file.
  • PKG-005 The mimetype file has an extra field of length …. The use of the extra field feature of the ZIP format is not permitted for the mimetype file.
  • PKG-006 Mimetype file entry is missing or is not the first file in the archive.
  • PKG-001 Validating the EPUB against version … but detected version ….
  • PKG-007 The content of the mimetype file must be the string "application/epub+zip"…
  • PKG-009 The file name "…" contains characters that are not allowed in OCF file names: ….

Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EPUBLab.

FAQ

What does EPUBCheck PKG-004 mean?

EPUBCheck PKG-004 is a fatal error message: “Corrupted EPUB ZIP header.” The ZIP structure of the EPUB is damaged, so EPUBCheck cannot list or read its files.

Is PKG-004 an error?

PKG-004 is reported as fatal error by default. EPUBCheck could not continue checking this part of the EPUB. The file is invalid.