jdx/mise · error

agent '{agent_name}' `start_calendar_interval` must not be e

Error message

agent '{agent_name}' `start_calendar_interval` must not be empty

What it means

start_calendar_interval also accepts an array of interval tables (LaunchdCalendarIntervals::Multiple). An empty array — zero intervals — is rejected because an agent would be declared as calendar-scheduled with no schedule at all; the agent is skipped with a warning. This is the array-form counterpart of the 'must set at least one field' check.

Source

Thrown at src/system/launchd.rs:175

        {
            bail!("agent '{agent_name}' `start_calendar_interval` must set at least one field");
        }
        validate_range(agent_name, "minute", self.minute, 0, 59)?;
        validate_range(agent_name, "hour", self.hour, 0, 23)?;
        validate_range(agent_name, "day", self.day, 1, 31)?;
        validate_range(agent_name, "weekday", self.weekday, 0, 7)?;
        validate_range(agent_name, "month", self.month, 1, 12)?;
        Ok(())
    }
}

impl LaunchdCalendarIntervals {
    fn validate(&self, agent_name: &str) -> Result<()> {
        match self {
            Self::Single(interval) => interval.validate(agent_name),
            Self::Multiple(intervals) => {
                if intervals.is_empty() {
                    bail!("agent '{agent_name}' `start_calendar_interval` must not be empty");
                }
                for interval in intervals {
                    interval.validate(agent_name)?;
                }
                Ok(())
            }
        }
    }
}

fn validate_range(
    agent_name: &str,
    field: &str,
    value: Option<u8>,
    min: u8,
    max: u8,
) -> Result<()> {
    if let Some(value) = value

View on GitHub (pinned to 9dcfcaa0dc)

Solutions

  1. Remove the start_calendar_interval key entirely if the agent has no calendar schedule
  2. Or add at least one interval table to the array: start_calendar_interval = [{ hour = 3 }]
  3. Guard templating so an unset schedule omits the key instead of emitting an empty array

Example fix

# before
[bootstrap.macos.launchd.agents.backup]
program = "/usr/local/bin/backup"
start_calendar_interval = []

# after
[bootstrap.macos.launchd.agents.backup]
program = "/usr/local/bin/backup"
start_calendar_interval = [{ hour = 3, minute = 0 }]
Defensive patterns

Strategy: validation

Validate before calling

python3 - <<'EOF'
import tomllib,sys
c=tomllib.load(open('mise.toml','rb'))
for name,agent in (c.get('bootstrap',{}).get('macos',{}).get('launchd',{}).get('agents',{}) or {}).items():
    iv=agent.get('start_calendar_interval')
    if isinstance(iv,list) and not iv: sys.exit(f'agent {name}: empty start_calendar_interval array')
EOF

Prevention

When it happens

Trigger: Writing start_calendar_interval = [] in a [bootstrap.macos.launchd.agents.<name>] table, or a template loop that renders zero interval entries into the array.

Common situations: Templating that yields an empty list when a schedule variable is unset; scaffolding that pre-declares the key; merging configs where interval entries were removed but the key remained.

Understand the failure class

Background: Config validation failed: what "invalid value for {key}" and settings-rejection errors mean across 19 open-source libraries — this error's family across 19 libraries.

Related errors


AI-assisted analysis of jdx/mise@9dcfcaa0dc (2026-08-17). Data as JSON: /api/errors/194cf48fe9c3fc72. Report an issue: GitHub.