jdx/mise · error

[history.encryption].recipients must not be empty; configure

Error message

[history.encryption].recipients must not be empty; configure recipients before capturing encrypted files

What it means

`file_recipients()` validates that any config layer declaring `[history.encryption]` actually lists at least one recipient. An empty `recipients` array is rejected because encrypted files captured without recipients could never be decrypted by anyone.

Source

Thrown at src/system/history/config.rs:51

#[serde(deny_unknown_fields)]
pub(crate) struct FileEncryptionConfig {
    #[serde(default)]
    pub recipients: Vec<String>,
}

pub(crate) fn file_recipients() -> Result<Vec<String>> {
    let mut recipients = Vec::new();
    for (path, layer) in layers()? {
        if let Some(encryption) = layer.encryption {
            if !crate::config::config_file::is_trusted(&path) {
                eyre::bail!(
                    "trust the configuration before using its encryption recipients: {}",
                    display_path(&path)
                );
            }
            recipients = encryption.recipients;
            if recipients.is_empty() {
                eyre::bail!(
                    "[history.encryption].recipients must not be empty; configure recipients before capturing encrypted files"
                );
            }
        }
    }
    Ok(recipients)
}

/// `[history.origin]`.
#[derive(Debug, Clone, Deserialize, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub(crate) struct OriginTomlConfig {
    pub url: String,
    #[serde(default = "default_branch")]
    pub branch: String,
}

impl OriginTomlConfig {

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Add at least one recipient under `[history.encryption].recipients` in your config.
  2. Remove the `[history.encryption]` section entirely if encryption isn't intended.
  3. Generate a key first (e.g. `age-keygen`) so you have a recipient string to add.

Example fix

# before
[history.encryption]
recipients = []
# after
[history.encryption]
recipients = ["age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p"]
Defensive patterns

Strategy: validation

Validate before calling

[ -n "$recipients" ] || { echo '[history.encryption].recipients must not be empty'; exit 1; }

Prevention

When it happens

Trigger: A config file contains `[history.encryption]` with `recipients = []` (or the key present but empty), and any history operation that captures encrypted files calls `file_recipients()`.

Common situations: User added the `[history.encryption]` table as a placeholder but hadn't pasted their age/GPG recipient yet; a template scaffolded the section with an empty list.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/a73290abfac6b65a. Report an issue: GitHub.