Skip to content
EPUBCheck · Package and ZIP container

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

  1. Note the file named in the message and check that it opens on its own after unzipping a copy.
  2. Replace the damaged file from the book's source.
  3. 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 mimetype and then zip -rX9 book.epub META-INF OEBPS (use your own folder names).
  4. 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-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: ….
  • PKG-006 Mimetype file entry is missing or is not the first file in the archive.
  • PKG-010 The file name "…" contains spaces, which may create interoperability issues with older reading systems.
  • 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-011 The 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.

FAQ

What does EPUBCheck PKG-008 mean?

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.

Is PKG-008 an error?

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

PDF to EPUB tools

Every tool uses the same engine and starts with a free 5-page sample.