{"record":{"id":"17fe54615ee8cf4e","repo":"jdx/mise","slug":"timer-unit-name-must-set-at-least-one-of-on-b","errorCode":null,"errorMessage":"timer unit '{name}' must set at least one of `on_boot_sec`, `on_unit_active_sec`, `on_unit_inactive_sec`, or `on_calendar`","messagePattern":"timer unit '(.+?)' must set at least one of `on_boot_sec`, `on_unit_active_sec`, `on_unit_inactive_sec`, or `on_calendar`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/systemd.rs","lineNumber":212,"sourceCode":"                (config.restart_sec.is_some(), \"restart_sec\"),\n                (config.standard_output.is_some(), \"standard_output\"),\n                (config.standard_error.is_some(), \"standard_error\"),\n            ]\n            .into_iter()\n            .filter_map(|(is_set, field)| is_set.then_some(field))\n            .collect::<Vec<_>>();\n            if !service_only_fields.is_empty() {\n                bail!(\n                    \"timer unit '{name}' cannot set service-only directive(s): {}\",\n                    service_only_fields.join(\", \")\n                );\n            }\n            if config.on_boot_sec.is_none()\n                && config.on_unit_active_sec.is_none()\n                && config.on_unit_inactive_sec.is_none()\n                && config.on_calendar.is_none()\n            {\n                bail!(\n                    \"timer unit '{name}' must set at least one of `on_boot_sec`, \\\n                     `on_unit_active_sec`, `on_unit_inactive_sec`, or `on_calendar`\"\n                );\n            }\n        }\n        if let Some(nice) = config.nice\n            && !(-20..=19).contains(&nice)\n        {\n            bail!(\"service unit '{name}' has invalid `nice` value {nice}; expected -20 through 19\");\n        }\n        if let Some(umask) = &config.umask\n            && !valid_umask(umask)\n        {\n            bail!(\n                \"service unit '{name}' has invalid `umask` value '{umask}'; expected an octal access mask from 0000 through 0777\"\n            );\n        }\n        let wanted_by = config.wanted_by.unwrap_or_else(|| match kind {","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/systemd.rs#L194-L230","documentation":"A unit classified as a Timer must carry at least one scheduling directive: on_boot_sec, on_unit_active_sec, on_unit_inactive_sec, or on_calendar. from_toml rejects timer entries with none of these because systemd would create a timer that never elapses.","triggerScenarios":"Defining a unit in mise.toml whose name/config ends up as a Timer (e.g. randomized_delay_sec present, or intended as a timer) without setting any of the four scheduling keys, then loading it via from_toml.","commonSituations":"Scaffolding a timer entry and planning to fill in the schedule later; accidentally deleting the on_calendar line; setting only randomized_delay_sec believing it schedules the unit (it only jitters an existing schedule).","solutions":["Add a schedule key, e.g. on_calendar = \"daily\" or on_boot_sec = 30","If no schedule is wanted, convert the entry to a service by removing timer-ish keys and providing exec_start","Remove the placeholder entry until the schedule is decided"],"exampleFix":"# before (mise.toml)\n[systemd.\"cleanup.timer\"]\nrandomized_delay_sec = 60\n# after\n[systemd.\"cleanup.timer\"]\non_calendar = \"daily\"\nrandomized_delay_sec = 60","handlingStrategy":"validation","validationCode":"let has_schedule = on_boot_sec.is_some() || on_unit_active_sec.is_some()\n    || on_unit_inactive_sec.is_some() || on_calendar.is_some();\nif !has_schedule { bail!(\"timer entry needs on_boot_sec / on_unit_active_sec / on_unit_inactive_sec / on_calendar\"); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add a schedule key whenever you create a timer entry — fill the placeholder immediately","randomized_delay_sec alone does not schedule anything","Review mise.toml diffs to ensure schedule lines aren't accidentally deleted"],"tags":["systemd","validation","timer","missing-field","config"],"backgroundTag":"missing-required-config-field","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}