EPUBCheck OPF-048: missing unique-identifier
Updated:
EPUBCheck OPF-048 is an error message: “Package tag is missing its required unique-identifier attribute and value.” The package element has no unique-identifier attribute, which is required. It points to the dc:identifier that identifies the book, and reading apps use it to tell books and editions apart.
The official message
Package tag is missing its required unique-identifier attribute and value.
- 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 package document written by hand or by a tool that omitted it.
- The attribute misspelled, such as uniqueidentifier or unique-id.
- A package element replaced when merging books.
How to fix it
- Make sure the metadata has a dc:identifier with an id, for example
<dc:identifier id="uid">urn:uuid:…</dc:identifier>. - Add unique-identifier with that id to the package element, for example
<package version="3.0" unique-identifier="uid">. - Run EPUBCheck again to confirm the two match.
When it's not this
If the attribute exists but points to an id no dc:identifier has, that is OPF-030.
Terms used here
Other OPF messages
OPF-049Item id "…" was not found in the manifest.OPF-050TOC attribute references resource with non-NCX mime type; "application/x-dtbncx+xml" is expected.OPF-045Encountered circular reference in fallback chain.OPF-044Spine item with non-standard media-type "…" has no EPUB content document fallback.OPF-043Spine item with non-standard media-type "…" has no fallback.OPF-053Date value "…" does not follow recommended syntax as per http://www.w3.org/TR/NOTE-datetime:….
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.