EPUBCheck OPF-001: unreadable EPUB version
Updated:
EPUBCheck OPF-001 is an error message: “There was an error when parsing the EPUB version: ….” EPUBCheck could not read the EPUB version from the package document. The version attribute on the package element tells validators and reading apps which set of rules the book follows, so without a readable value the rest of the check is unreliable.
The official message
There was an error when parsing the EPUB version: %1$s.
- 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
- A missing or empty version attribute on the package element.
- A malformed value, such as version="3" or version="EPUB 3", instead of a number like 3.0.
- A package element written by hand or by a script that left the attribute out.
How to fix it
- Open the package document (the .opf file) and find the package element at the top.
- Set version="3.0" for EPUB 3 (EPUB 3.3 books still declare 3.0) or version="2.0" for EPUB 2.
- Run EPUBCheck again: errors that depended on the version should now be reported correctly.
When it's not this
If EPUBCheck reads the version but you asked for a different one with -v, that is PKG-001, not OPF-001.
Terms used here
Other OPF messages
OPF-002The OPF file "…" was not found in the EPUB.OPF-003Item "…" exists in the EPUB, but is not declared in the OPF manifest.OPF-004Invalid prefix declaration: leading or trailing whitespace is not allowed.OPF-005Invalid prefix declaration: URI for prefix "…" doesn’t exist.OPF-006Invalid prefix declaration: URI "…" is not a valid URI.OPF-007Re-declaration of reserved prefix "…".
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.