EPUBCheck PKG-020: package document not found
Updated:
EPUBCheck PKG-020 is an error message: “OPF file "…" could not be found.” The package document (OPF) named in META-INF/container.xml does not exist at that path. Without the package document, neither reading apps nor EPUBCheck know which files make up the book.
The official message
OPF file "%1$s" could not be found.
- 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
%1$s, %2$s… are filled in with the file, value or element EPUBCheck found.
Typical causes
- The full-path attribute of the rootfile element has a typo or the wrong case: paths are case-sensitive.
- The package document was renamed or moved (for example from OEBPS/ to EPUB/) without updating container.xml.
- The package document was left out when the archive was built.
How to fix it
- Open META-INF/container.xml and read the full-path value of the rootfile element.
- Make it match the real path of the .opf file, relative to the root of the archive, for example
full-path="OEBPS/content.opf". - Rebuild the archive and validate again.
When it's not this
If container.xml itself is missing, that is RSC-002; if no rootfile has the right media type, RSC-003.
Terms used here
Other PKG messages
PKG-021Corrupted image file encountered.PKG-018The EPUB file could not be found.PKG-022Wrong file extension for image. The image is a "…" file but has the file extension "…".PKG-017Uncommon EPUB file extension.PKG-023Validating the EPUB against version 2.0, default validation profile will be used.PKG-016Use only lowercase characters for the EPUB file extension for maximum compatibility.
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.