EPUBCheck PKG-008: file inside EPUB unreadable
Updated:
EPUBCheck PKG-008 is a fatal error message: “Unable to read file "…".” EPUBCheck could not read one of the files inside the EPUB, so it stops checking that file. It is a fatal error: the message names the file, and the rest of what depends on that file cannot be validated.
The official message
Unable to read file "%1$s".
- Default severity
- Fatal error. EPUBCheck could not continue checking this part of the EPUB. The file is invalid.
- EPUBCheck version
- 5.4.0
%1$s, %2$s… are filled in with the file, value or element EPUBCheck found.
Typical causes
- The entry is damaged inside the ZIP, often after a truncated download or an interrupted save.
- The entry uses a compression method or encryption that the ZIP reader cannot handle.
- The file was locked or removed while EPUBCheck was reading an unpacked folder.
How to fix it
- Note the file named in the message and check that it opens on its own after unzipping a copy.
- Replace the damaged file from the book's source.
- Rebuild the archive with a standard ZIP tool (stored or deflate compression only): Rebuild the archive with the mimetype file first and stored uncompressed, for example from the folder that contains the book:
zip -X0 book.epub mimetypeand thenzip -rX9 book.epub META-INF OEBPS(use your own folder names). - 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 whole archive cannot be opened, that is PKG-003 or PKG-004, not one unreadable file.
Terms used here
Other PKG messages
PKG-007The content of the mimetype file must be the string "application/epub+zip"…PKG-009The file name "…" contains characters that are not allowed in OCF file names: ….PKG-006Mimetype file entry is missing or is not the first file in the archive.PKG-010The file name "…" contains spaces, which may create interoperability issues with older reading systems.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-011The file name "…" is not allowed to end with ".".
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.