linera-io/linera-protocol · error

Unable to open committee configuration

Error message

Unable to open committee configuration

What it means

Panic when `persistent::File::new(&committee, CommitteeConfig{...})` fails for the `--committee <path>` argument of `server generate`. `File::new` opens/creates the committee file (0600 on Unix), takes a non-blocking exclusive flock, and performs an initial atomic save of the JSON committee description. The 'open' message therefore also covers lock contention and initial-save I/O errors.

Source

Thrown at linera-service/src/server.rs:919

                    .expect("Unable to open server config file");
                Persist::persist(&mut server)
                    .await
                    .expect("Unable to write server config file");
                info!("Wrote server config {}", path.to_str().unwrap());
                println!(
                    "{},{}",
                    server.validator.public_key, server.validator.account_key
                );
                config_validators.push(Persist::into_value(server).validator);
            }
            if let Some(committee) = committee {
                let mut config = persistent::File::new(
                    &committee,
                    CommitteeConfig {
                        validators: config_validators,
                    },
                )
                .expect("Unable to open committee configuration");
                Persist::persist(&mut config)
                    .await
                    .expect("Unable to write committee description");
                info!("Wrote committee config {}", committee.to_str().unwrap());
            }
        }

        ServerCommand::EditShards {
            server_config_path,
            num_shards,
            host,
            port,
            metrics_port,
        } => {
            let mut server_config =
                persistent::File::<ValidatorServerConfig>::read(&server_config_path)
                    .expect("Failed to read server config");
            let shards = generate_shard_configs(&num_shards, &host, &port, &metrics_port)

View on GitHub (pinned to 6c226ddcb3)

Solutions

  1. `mkdir -p` the committee file's directory and make it writable by the current user.
  2. Ensure no other linera process holds the committee file; stop it or rerun later.
  3. Remove stale `committee.json.new` staging leftovers.
  4. Check disk space (`df -h`) and that the mount is read-write.
  5. Handle the Result with context instead of expect in custom code.

Example fix

// before
let mut config = persistent::File::new(
    &committee,
    CommitteeConfig { validators: config_validators },
)
.expect("Unable to open committee configuration");
// after
if let Some(parent) = committee.parent().filter(|p| !p.as_os_str().is_empty()) {
    std::fs::create_dir_all(parent)?;
}
let mut config = persistent::File::new(
    &committee,
    CommitteeConfig { validators: config_validators },
)
.with_context(|| format!("unable to create committee file {}", committee.display()))?;
Defensive patterns

Strategy: validation

Validate before calling

if let Some(parent) = committee.parent().filter(|p| !p.as_os_str().is_empty()) {
    std::fs::create_dir_all(parent)
        .with_context(|| format!("committee dir missing: {}", parent.display()))?;
}
let probe = committee.with_extension("probe");
std::fs::write(&probe, b"")?;
std::fs::remove_file(&probe)?;

Try / catch

let mut config = match persistent::File::new(&committee, CommitteeConfig { validators: config_validators }) {
    Ok(config) => config,
    Err(err) => {
        eprintln!("error: unable to open committee configuration {}: {err}", committee.display());
        std::process::exit(1);
    }
};

Prevention

When it happens

Trigger: `--committee committee.json` where the parent directory does not exist or is unwritable; another linera process holds the committee file locked; the initial save fails on a read-only filesystem or ENOSPC; a stale `committee.json.new` blocks creation of the staging file.

Common situations: Committee path given as a bare filename while the cwd is not writable; /etc/linera not created in a fresh install; running generate with --committee while other linera tooling reads the same file; config volumes mounted read-only under orchestration.

Related errors


AI-assisted analysis of linera-io/linera-protocol@6c226ddcb3 (2026-08-22). Data as JSON: /api/errors/f1e1334fff9a5892. Report an issue: GitHub.