wasmerio/wasmer · error

journal restore error: failed to set clock time (clock_id={c

Error message

journal restore error: failed to set clock time (clock_id={clock_id:?}, time={time}) - {ret}

What it means

Raised by apply_clock_time_set while replaying a journal snapshot: restoring the wall-clock/virtual time via clock_time_set_internal returned a non-Success Errno. The snapshot's recorded time could not be applied to the restored environment, so restore is aborted with this message.

Source

Thrown at lib/wasix/src/journal/effector/syscalls/clock_time.rs:19

use super::*;

impl JournalEffector {
    pub fn save_clock_time_set(
        ctx: &mut FunctionEnvMut<'_, WasiEnv>,
        clock_id: Snapshot0Clockid,
        time: Timestamp,
    ) -> anyhow::Result<()> {
        Self::save_event(ctx, JournalEntry::SetClockTimeV1 { clock_id, time })
    }

    pub fn apply_clock_time_set(
        ctx: &mut FunctionEnvMut<'_, WasiEnv>,
        clock_id: Snapshot0Clockid,
        time: Timestamp,
    ) -> anyhow::Result<()> {
        let ret = crate::syscalls::clock_time_set_internal(ctx, clock_id, time);
        if ret != Errno::Success {
            bail!(
                "journal restore error: failed to set clock time (clock_id={clock_id:?}, time={time}) - {ret}"
            );
        }
        Ok(())
    }
}

View on GitHub (pinned to 8c4b9ee9d3)

Solutions

  1. Re-run the workload and take a fresh snapshot; restore from the new journal.
  2. Check the clock_id in the journal against clocks supported by the running wasix runtime.
  3. Ensure snapshot and restore use the same wasmer/wasix version.
  4. If the failure is benign for your use case, configure the journal effector to tolerate clock entries or filter them from the journal.
Defensive patterns

Strategy: try-catch

Validate before calling

// Before restoring, confirm clock support and version match
let supports = |id: Snapshot0Clockid| matches!(id, Snapshot0Clockid::Realtime | Snapshot0Clockid::Monotonic);
assert!(journal.clock_entries().iter().all(|e| supports(e.clock_id)),
        "journal contains unsupported clock ids");

Try / catch

match restore_from_journal(&env, &journal) {
    Err(e) if e.to_string().contains("failed to set clock time") => {
        // drop clock entries and retry without time restoration
        let filtered = journal.without_clock_entries();
        restore_from_journal(&env, &filtered)?;
    }
    other => other?,
}

Prevention

When it happens

Trigger: Journal restore (resume-from-snapshot, threads migration) applying a ClockTimeSet log entry whose clock_id is unsupported or whose recorded time is rejected by the internal set-time call.

Common situations: Restoring a snapshot taken on a platform/kind of clock not available in the target environment; journal produced by a newer/older runtime version with differing clock support.

Related errors


AI-assisted analysis of wasmerio/wasmer@8c4b9ee9d3 (2026-09-01). Data as JSON: /api/errors/43fd1ca32ac561ef. Report an issue: GitHub.