tinyhumansai/openhuman · error

No future occurrence for expression: {expr}

Error message

No future occurrence for expression: {expr}

What it means

A cron expression produced no upcoming occurrence in the job's timezone — the schedule iterator yielded None when advancing. Fires for expressions whose future matches are impossible in that timezone (e.g. a time that never occurs due to DST or an unsatisfiable field combination), not for parse errors.

Source

Thrown at src/openhuman/cron/schedule.rs:123

        match tz {
            Some(tz_name) => chrono_tz::Tz::from_str(tz_name)
                .map(Self::Named)
                .with_context(|| format!("Invalid IANA timezone: {tz_name}")),
            None => Ok(Self::Local),
        }
    }

    fn next_after(
        self,
        cron: &CronExprSchedule,
        from: DateTime<Utc>,
        expr: &str,
    ) -> Result<DateTime<Utc>> {
        match self {
            Self::Named(timezone) => {
                let localized_from = from.with_timezone(&timezone);
                let next_local = cron.after(&localized_from).next().ok_or_else(|| {
                    anyhow::anyhow!("No future occurrence for expression: {expr}")
                })?;
                Ok(next_local.with_timezone(&Utc))
            }
            Self::Local => {
                let localized_from = from.with_timezone(&chrono::Local);
                let next_local = cron.after(&localized_from).next().ok_or_else(|| {
                    anyhow::anyhow!("No future occurrence for expression: {expr}")
                })?;
                Ok(next_local.with_timezone(&Utc))
            }
        }
    }

    fn local_time_of_day(self, time: DateTime<Utc>) -> NaiveTime {
        match self {
            Self::Named(timezone) => {
                let localized = time.with_timezone(&timezone);
                NaiveTime::from_hms_opt(localized.hour(), localized.minute(), 0)

View on GitHub (pinned to 7491200858)

Solutions

  1. Correct the cron expression so it has future occurrences in the configured timezone
  2. Verify the IANA timezone name is the intended one
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/cron/schedule.rs:123 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/7b7a6074441d5ce3. Report an issue: GitHub.