{"record":{"id":"43fd1ca32ac561ef","repo":"wasmerio/wasmer","slug":"journal-restore-error-failed-to-set-clock-time-c","errorCode":null,"errorMessage":"journal restore error: failed to set clock time (clock_id={clock_id:?}, time={time}) - {ret}","messagePattern":"journal restore error: failed to set clock time \\(clock_id=(.+?), time=(.+?)\\) - (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/wasix/src/journal/effector/syscalls/clock_time.rs","lineNumber":19,"sourceCode":"use super::*;\n\nimpl JournalEffector {\n    pub fn save_clock_time_set(\n        ctx: &mut FunctionEnvMut<'_, WasiEnv>,\n        clock_id: Snapshot0Clockid,\n        time: Timestamp,\n    ) -> anyhow::Result<()> {\n        Self::save_event(ctx, JournalEntry::SetClockTimeV1 { clock_id, time })\n    }\n\n    pub fn apply_clock_time_set(\n        ctx: &mut FunctionEnvMut<'_, WasiEnv>,\n        clock_id: Snapshot0Clockid,\n        time: Timestamp,\n    ) -> anyhow::Result<()> {\n        let ret = crate::syscalls::clock_time_set_internal(ctx, clock_id, time);\n        if ret != Errno::Success {\n            bail!(\n                \"journal restore error: failed to set clock time (clock_id={clock_id:?}, time={time}) - {ret}\"\n            );\n        }\n        Ok(())\n    }\n}\n","sourceCodeStart":1,"sourceCodeEnd":26,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/wasix/src/journal/effector/syscalls/clock_time.rs#L1-L26","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Re-run the workload and take a fresh snapshot; restore from the new journal.","Check the clock_id in the journal against clocks supported by the running wasix runtime.","Ensure snapshot and restore use the same wasmer/wasix version.","If the failure is benign for your use case, configure the journal effector to tolerate clock entries or filter them from the journal."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Before restoring, confirm clock support and version match\nlet supports = |id: Snapshot0Clockid| matches!(id, Snapshot0Clockid::Realtime | Snapshot0Clockid::Monotonic);\nassert!(journal.clock_entries().iter().all(|e| supports(e.clock_id)),\n        \"journal contains unsupported clock ids\");","typeGuard":null,"tryCatchPattern":"match restore_from_journal(&env, &journal) {\n    Err(e) if e.to_string().contains(\"failed to set clock time\") => {\n        // drop clock entries and retry without time restoration\n        let filtered = journal.without_clock_entries();\n        restore_from_journal(&env, &filtered)?;\n    }\n    other => other?,\n}","preventionTips":["Use the same wasmer/wasix version for snapshot capture and restore.","Filter unsupported clock entries from journals before cross-environment restore.","Retake snapshots after runtime upgrades."],"tags":["wasix","journal","snapshot-restore","clock"],"backgroundTag":"journal-restore-failed","analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}