flxzt/rnote · error

failed to load rnote file from bytes, unsupported version

Error message

failed to load rnote file from bytes, unsupported version: {}.

What it means

Rnote failed to load an .rnote file because the file's version field is not one of the supported major-0 versions (0.5 patch 8 through 0.15). load_from_bytes only supports versions for which conversion chains (RnoteFileMaj0Min5Patch8 -> ... -> newest) exist; anything else is rejected.

Solutions

  1. Update the rnote app/engine to the version matching (or newer than) the file's version
  2. Check the file's version attribute in the zip's document metadata and confirm it matches a supported release (0.5.x - 0.15.x)
  3. Re-save the file with a compatible version of the app
  4. Verify the file is a genuine .rnote archive and not truncated/corrupted

Example fix

// before (unsupported newer file)
let file = RnoteFile::load_from_bytes(&bytes)?;
// after: check version support first and inform user to upgrade
if !rnoteversion_is_supported(&file_version) {
    anyhow::bail!("Please update the app to open this file (version {})", file_version);
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Before loading, inspect the zip's version attr if possible
fn is_supported_version(v: &str) -> bool {
    matches!(v, "0.5.8" | "0.6" | "0.9" | "0.13" | "0.15") // supported majors
}

Try / catch

match RnoteFile::load_from_bytes(&bytes) {
    Err(e) if e.to_string().contains("unsupported version") => {
        eprintln!("File was saved by a newer Rnote version; please update the app.");
    }
    Err(e) => return Err(e),
    Ok(f) => Ok(f),
}

Prevention

When it happens

Trigger: Calling RnoteFile::load_from_bytes (via RnoteFileMaj0Min5Patch8::load_from_bytes and_then chain) with bytes whose wrapper.version is a version string outside the supported set, e.g. a file saved by a newer Rnote release.

Common situations: Opening an .rnote file written by a newer app version with an older binary; a corrupted or hand-edited file whose 'version' attribute was changed; importing a file from a fork with its own versioning.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at crates/rnote-engine/src/fileformats/rnoteformat/mod.rs:153

                .and_then(RnoteFileMaj0Min6::try_from)
                .and_then(RnoteFileMaj0Min9::try_from)
                .and_then(RnoteFileMaj0Min13::try_from)
                .and_then(RnoteFileMaj0Min15::try_from)
                .context("converting RnoteFileMaj0Min5Patch9 to newest file version failed.")
        } else if semver::VersionReq::parse(">=0.5.0")
            .unwrap()
            .matches(&wrapper.version)
        {
            ijson::from_value::<RnoteFileMaj0Min5Patch8>(&wrapper.data)
                .context("deserializing RnoteFileMaj0Min5Patch8 failed")
                .and_then(RnoteFileMaj0Min5Patch9::try_from)
                .and_then(RnoteFileMaj0Min6::try_from)
                .and_then(RnoteFileMaj0Min9::try_from)
                .and_then(RnoteFileMaj0Min13::try_from)
                .and_then(RnoteFileMaj0Min15::try_from)
                .context("converting RnoteFileMaj0Min5Patch8 to newest file version failed.")
        } else {
            Err(anyhow::anyhow!(
                "failed to load rnote file from bytes, unsupported version: {}.",
                wrapper.version
            ))
        }
    }
}

impl FileFormatSaver for RnoteFile {
    fn save_as_bytes(&self, _file_name: &str) -> anyhow::Result<Vec<u8>> {
        let wrapper = RnotefileWrapper {
            version: semver::Version::parse(Self::SEMVER).unwrap(),
            data: ijson::to_value(self).context("converting RnoteFile to JSON value failed.")?,
        };
        let compressed = compress_to_gzip(
            &serde_json::to_vec(&wrapper).context("Serializing RnoteFileWrapper failed.")?,
        )
        .context("compressing bytes failed.")?;

View on GitHub (pinned to bbc5354502)