flxzt/rnote · error · anyhow::Error
document has no value `format`.
Error message
document has no value `format`.
What it means
Migration guard in the RnoteFileMaj0Min9 -> RnoteFileMaj0Min13 conversion: the `document` object has no `format` key to migrate, so the expected format metadata entry is absent. Raised on truncated or non-standard .rnote files during the version upgrade step.
Solutions
- Restore the file from backup; document.format is missing.
- Repair the `format` entry only if you know the correct rnote format structure.
- Open and re-save the file in an older app version that still accepts it.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/rnote-engine/src/fileformats/rnoteformat/maj0min13.rs:29 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of flxzt/rnote@bbc5354502 (2026-09-08).
Data as JSON: /api/errors/7dc160cb08267a24.
Report an issue: GitHub.
Appendix: source
Thrown at crates/rnote-engine/src/fileformats/rnoteformat/maj0min13.rs:29
}
impl TryFrom<RnoteFileMaj0Min9> for RnoteFileMaj0Min13 {
type Error = anyhow::Error;
fn try_from(mut value: RnoteFileMaj0Min9) -> Result<Self, Self::Error> {
let engine_snapshot = value
.engine_snapshot
.as_object_mut()
.ok_or_else(|| anyhow::anyhow!("engine snapshot is not a JSON object."))?;
let document = engine_snapshot
.get_mut("document")
.ok_or_else(|| anyhow!("`engine_snapshot` has no value `document`."))?
.as_object_mut()
.ok_or_else(|| anyhow!("`document` is not a JSON object."))?;
let format = document
.remove("format")
.ok_or_else(|| anyhow!("document has no value `format`."))?;
let background = document
.remove("background")
.ok_or_else(|| anyhow!("document has no value `background`."))?;
let layout = document
.remove("layout")
.ok_or_else(|| anyhow!("document has no value `layout`."))?;
// discard `snap_positions`, this config is now global.
document.remove("snap_positions");
let mut document_config = ijson::IObject::new();
document_config.insert("format", format);
document_config.insert("background", background);
document_config.insert("layout", layout);
document.insert("config", document_config);
Ok(Self {
engine_snapshot: value.engine_snapshot,
})View on GitHub (pinned to bbc5354502)