flxzt/rnote · error

There must be at least one rnote file specified for…

Error message

There must be at least one rnote file specified for exporting.

What it means

Sentinel validation guard at the top of run_export: the CLI export command was invoked with an empty rnote_files list, so there is nothing to export. Fires when `rnote-cli export` is run without supplying any .rnote file path arguments.

Solutions

  1. Pass at least one .rnote file as a positional argument, e.g. `rnote export doc notes.rnote --output-format pdf`.
  2. Check that your glob/variable actually expands to files (run `ls *.rnote` first).
  3. In scripts, validate the file list is non-empty before invoking rnote export.

Example fix

// before
rnote export doc --output-format pdf
// after
rnote export doc notes.rnote --output-format pdf
Defensive patterns

Strategy: validation

Validate before calling

if [ -z "$FILES" ]; then echo "usage: rnote export <subcmd> <file.rnote>..."; exit 2; fi

Prevention

When it happens

Trigger: Invoking any `rnote export` subcommand (doc, docpages, selection) without supplying positional rnote file arguments.

Common situations: Running the export command with only option flags (e.g. only --output-format) and forgetting the input files; shell glob that matched nothing (e.g. `rnote export *.rnote` in a directory with no rnote files); a script variable holding the file list is empty.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at crates/rnote-cli/src/export.rs:28

    SelectionExportFormat, SelectionExportPrefs,
};
use rnote_engine::engine::{EngineConfigShared, EngineSnapshot};
use rnote_engine::{Engine, SelectionCollision};
use std::io::{self, IsTerminal};
use std::path::{Path, PathBuf};

#[allow(clippy::too_many_arguments)]
pub(crate) async fn run_export(
    rnote_files: Vec<PathBuf>,
    no_background: bool,
    no_pattern: bool,
    optimize_printing: bool,
    on_conflict: OnConflict,
    open: bool,
    export_command: cli::ExportCommand,
) -> anyhow::Result<()> {
    if rnote_files.is_empty() {
        return Err(anyhow::anyhow!(
            "There must be at least one rnote file specified for exporting."
        ));
    }

    let config = EngineConfigShared::default();
    let mut engine = Engine::default();
    let _ = engine.install_config(&config, None);
    let mut on_conflict_overwrite = None;
    let output_file = match &export_command {
        cli::ExportCommand::Doc { file_args, .. } => file_args.output_file.as_ref(),
        cli::ExportCommand::Selection { file_args, .. } => file_args.output_file.as_ref(),
        cli::ExportCommand::DocPages {
            output_file_stem, ..
        } => {
            if rnote_files.len() > 1 && output_file_stem.is_some() {
                return Err(anyhow::anyhow!(
                    "The option \"--file-stem\" cannot be used when exporting multiple rnote files."
                ));

View on GitHub (pinned to bbc5354502)