firecracker-microvm/firecracker · error

Invalid instance ID

Error message

Invalid instance ID

What it means

Error "Invalid instance ID" thrown in firecracker-microvm/firecracker.

Source

Thrown at src/firecracker/src/main.rs:309

    if arguments.flag_present("version") {
        println!("Firecracker v{}\n", FIRECRACKER_VERSION);
        return Ok(());
    }

    if arguments.flag_present("snapshot-version") {
        println!("v{SNAPSHOT_VERSION}");
        return Ok(());
    }

    if let Some(snapshot_path) = arguments.single_value("describe-snapshot") {
        print_snapshot_data_format(snapshot_path)?;
        return Ok(());
    }

    // It's safe to unwrap here because the field's been provided with a default value.
    let instance_id = arguments.single_value("id").unwrap();
    validate_instance_id(instance_id.as_str()).expect("Invalid instance ID");

    // Apply the logger configuration.
    vmm::logger::INSTANCE_ID
        .set(String::from(instance_id))
        .unwrap();
    let log_path = arguments.single_value("log-path").map(PathBuf::from);
    let level = arguments
        .single_value("level")
        .map(|s| vmm::logger::LevelFilter::from_str(s))
        .transpose()
        .map_err(MainError::InvalidLogLevel)?;
    let show_level = arguments.flag_present("show-level").then_some(true);
    let show_log_origin = arguments.flag_present("show-log-origin").then_some(true);
    let module = arguments.single_value("module").cloned();
    LOGGER
        .update(LoggerConfig {
            log_path,
            level,

View on GitHub (pinned to 0a745def42)

Solutions

  1. Provide an instance ID containing only the allowed characters (alphanumeric and hyphen) within the length limit.
  2. Set the instance ID explicitly via the --id command-line argument or config file.

When it happens

Trigger: Thrown at src/firecracker/src/main.rs:309 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of firecracker-microvm/firecracker@0a745def42 (2026-08-19). Data as JSON: /api/errors/7d4f4c6ee011b56f. Report an issue: GitHub.