{"record":{"id":"7dc160cb08267a24","repo":"flxzt/rnote","slug":"document-has-no-value-format","errorCode":null,"errorMessage":"document has no value `format`.","messagePattern":"document has no value `format`\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/rnote-engine/src/fileformats/rnoteformat/maj0min13.rs","lineNumber":29,"sourceCode":"}\n\nimpl TryFrom<RnoteFileMaj0Min9> for RnoteFileMaj0Min13 {\n    type Error = anyhow::Error;\n\n    fn try_from(mut value: RnoteFileMaj0Min9) -> Result<Self, Self::Error> {\n        let engine_snapshot = value\n            .engine_snapshot\n            .as_object_mut()\n            .ok_or_else(|| anyhow::anyhow!(\"engine snapshot is not a JSON object.\"))?;\n        let document = engine_snapshot\n            .get_mut(\"document\")\n            .ok_or_else(|| anyhow!(\"`engine_snapshot` has no value `document`.\"))?\n            .as_object_mut()\n            .ok_or_else(|| anyhow!(\"`document` is not a JSON object.\"))?;\n\n        let format = document\n            .remove(\"format\")\n            .ok_or_else(|| anyhow!(\"document has no value `format`.\"))?;\n        let background = document\n            .remove(\"background\")\n            .ok_or_else(|| anyhow!(\"document has no value `background`.\"))?;\n        let layout = document\n            .remove(\"layout\")\n            .ok_or_else(|| anyhow!(\"document has no value `layout`.\"))?;\n        // discard `snap_positions`, this config is now global.\n        document.remove(\"snap_positions\");\n\n        let mut document_config = ijson::IObject::new();\n        document_config.insert(\"format\", format);\n        document_config.insert(\"background\", background);\n        document_config.insert(\"layout\", layout);\n        document.insert(\"config\", document_config);\n\n        Ok(Self {\n            engine_snapshot: value.engine_snapshot,\n        })","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/flxzt/rnote/blob/bbc5354502ba2fc83eec2670b535348825e679a6/crates/rnote-engine/src/fileformats/rnoteformat/maj0min13.rs#L11-L47","documentation":"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.","triggerScenarios":"Thrown at crates/rnote-engine/src/fileformats/rnoteformat/maj0min13.rs:29 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bbc5354502ba2fc83eec2670b535348825e679a6","analyzedAt":"2026-09-08T13:20:33.747Z","contentChangedAt":"2026-09-08T13:20:33.747Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}