EPUBCheck RSC-003: no OPF rootfile in container
Updated:
EPUBCheck RSC-003 is an error message: “No rootfile tag with media type "application/oebps-package+xml" was found in the container.” META-INF/container.xml exists but none of its rootfile elements has the media type application/oebps-package+xml, so the package document cannot be found. Reading apps rely on that exact value to pick the package document.
The official message
No rootfile tag with media type "application/oebps-package+xml" was found in the container.
- 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
- A misspelled or missing media-type attribute on the rootfile element.
- A container.xml written by hand or copied from a template with another media type, such as application/xml or text/xml.
How to fix it
- Open META-INF/container.xml.
- Set media-type="application/oebps-package+xml" on the rootfile element that points to the package document.
- Check that its full-path is correct too, rebuild and validate again.
When it's not this
If the rootfile is right but the file it names does not exist, the error is PKG-020.
Terms used here
Other RSC messages
RSC-002Required META-INF/container.xml resource could not be found.RSC-004File "…" is encrypted, its content will not be checked.RSC-001File "…" could not be found.RSC-005Error while parsing file: …RSC-006Remote resource reference is not allowed in this context; resource "…" must be located in the EPUB container.RSC-006bResource "…" is located outside the EPUB Container; please check the resource is retrieved in scripted content.
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.