flxzt/rnote · error

store snapshot has no value `chrono_components`.

Error message

store snapshot has no value `chrono_components`.

What it means

The maj0min5patch9 -> maj0min6 migration requires `store_snapshot.chrono_components` to exist, because it is moved into the new `engine_snapshot.chrono_components`. This error is thrown when that key is absent from the store snapshot object.

Solutions

  1. Inspect the extracted JSON and add a `chrono_components` array (possibly empty) to the store snapshot.
  2. Restore the file from a backup or autosave copy.
  3. Re-save the document with the rnote version matching the stored format.
  4. If editing manually, insert `"chrono_components": []` alongside `stroke_components` before migration.

Example fix

// before
"store_snapshot": { "stroke_components": [] }
// after
"store_snapshot": { "stroke_components": [], "chrono_components": [] }
Defensive patterns

Strategy: validation

Validate before calling

// validate before migration
fn has_chrono_components(doc: &serde_json::Value) -> bool {
    doc["store_snapshot"].get("chrono_components").map_or(false, |v| v.is_array())
}

Type guard

fn store_snapshot_has(doc: &serde_json::Value, key: &str) -> bool {
    doc["store_snapshot"].get(key).is_some()
}

Try / catch

match RnoteFileMaj0Min6::try_from(prev) {
    Ok(migrated) => /* use migrated */,
    Err(e) if e.to_string().contains("no value `chrono_components`") => {
        // insert an empty chrono_components array and retry
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Running `RnoteFileMaj0Min6::try_from` on a file whose store snapshot object has `stroke_components` but no `chrono_components` key.

Common situations: Hand-edited .rnote files with the key stripped, files from a tool that omitted chrono data, or truncated saves.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of flxzt/rnote@bbc5354502 (2026-09-08). Data as JSON: /api/errors/6ac62024e61ea5d7. Report an issue: GitHub.

Appendix: source

Thrown at crates/rnote-engine/src/fileformats/rnoteformat/maj0min6.rs:35

        let mut engine_snapshot = ijson::IObject::new();

        let store_snapshot = value
            .store_snapshot
            .as_object_mut()
            .ok_or_else(|| anyhow!("store snapshot is not a JSON object."))?;

        engine_snapshot.insert(String::from("document"), value.document);
        engine_snapshot.insert(
            String::from("stroke_components"),
            store_snapshot
                .remove("stroke_components")
                .ok_or_else(|| anyhow!("store snapshot has no value `stroke_components`."))?,
        );
        engine_snapshot.insert(
            String::from("chrono_components"),
            store_snapshot
                .remove("chrono_components")
                .ok_or_else(|| anyhow!("store snapshot has no value `chrono_components`."))?,
        );
        engine_snapshot.insert(
            String::from("chrono_counter"),
            store_snapshot
                .remove("chrono_counter")
                .ok_or_else(|| anyhow!("store snapshot has no value `chrono_counter`."))?,
        );

        Ok(Self {
            engine_snapshot: engine_snapshot.into(),
        })
    }
}

View on GitHub (pinned to bbc5354502)