EPUBCheck PKG-003: unreadable EPUB file header
Updated:
EPUBCheck PKG-003 is an error message: “Unable to read EPUB file header. This is likely a corrupted EPUB file.” EPUBCheck could not read the start of the file as a ZIP archive, so it is not a usable EPUB. Every EPUB is a ZIP container, and reading apps and stores reject a file whose header is not a valid ZIP header.
The official message
Unable to read EPUB file header. This is likely a corrupted EPUB file.
- Default severity
- Error. The EPUB breaks a rule of the specification and is invalid. Stores and Send to Kindle may reject it, and EPUBCheck exits with status 1.
- EPUBCheck version
- 5.4.0
Typical causes
- The file is not really an EPUB: a PDF, MOBI or other file renamed to .epub.
- The download or copy was cut short and the file is truncated.
- An HTML error page or a login page was saved with the .epub name instead of the book.
How to fix it
- Download or export the EPUB again and compare its size with the original.
- Rename a copy to .zip and try to open it: if no ZIP tool can, the file has to be rebuilt from its source.
- If the file is another format renamed to .epub, convert it properly instead of renaming it.
- Run EPUBCheck again on the rebuilt file and fix any message that appears next: a damaged archive can hide other problems until it can be read.
When it's not this
If the ZIP opens but its directory is damaged, EPUBCheck reports PKG-004; if the path itself is wrong, PKG-018.
Terms used here
Other PKG messages
PKG-004Corrupted EPUB ZIP header.PKG-001Validating the EPUB against version … but detected version ….PKG-005The 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-006Mimetype file entry is missing or is not the first file in the archive.PKG-007The content of the mimetype file must be the string "application/epub+zip"…PKG-008Unable to read file "…".
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.