# EPUBCheck OPF-065: refines metadata loop, how to fix it

Source: https://epubcc.com/epubcheck/opf-065/ (updated 2026-11-04)

EPUBCheck OPF-065 is an error message: “Invalid metadata declaration, probably due to a cycle in "refines" metadata.” Metadata refines chains loop back on themselves, so EPUBCheck cannot resolve what refines what. Each meta element with refines describes another element, and following those links must end somewhere.

- Official message (EPUBCheck 5.4.0): Invalid metadata declaration, probably due to a cycle in "refines" metadata.
- Default severity: Error

## Typical causes

- A meta element whose refines attribute points, directly or through others, back to itself.
- ids reused or swapped while editing metadata by hand.
- Metadata merged from two sources that used the same ids.

## How to fix it

1. Find the meta elements with refines attributes in the metadata section.
2. For each one, check that refines points (with #id) to the element it describes, such as a dc:creator.
3. Break the loop by correcting the refines value or the id it points to.

## When it's not this

If refines points to an id that does not exist, EPUBCheck reports a reference error instead.

## Sources

- EPUB 3.3, §5.3.6 The refines attribute: https://www.w3.org/TR/epub-33/#attrdef-refines (read 2026-11-04)

Message text and severity: EPUBCheck (W3C, BSD-3-Clause). Explanation: EpubCC.
