{"record":{"id":"341c919b8c26b2eb","repo":"jdx/mise","slug":"configured-notifications-prepared-services","errorCode":null,"errorMessage":"configured notifications prepared services","messagePattern":"configured notifications prepared services","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/bootstrap.rs","lineNumber":1398,"sourceCode":"                .as_ref()\n                .is_some_and(|(files, directories)| {\n                    files.iter().any(|file| !file.notify.is_empty())\n                        || directories\n                            .iter()\n                            .any(|directory| !directory.notify.is_empty())\n                });\n        let configured_services = if services_enabled || notifications_configured {\n            Some(system::services::prepare_requests_from_config(&config)?)\n        } else {\n            None\n        };\n        if notifications_configured {\n            let (files, directories) = managed_system_files\n                .as_ref()\n                .expect(\"configured notifications came from managed files\");\n            let services = configured_services\n                .as_ref()\n                .expect(\"configured notifications prepared services\");\n            let user_services = system::services_common::user_service_names(&config)?;\n            system::services::validate_notifications(files, directories, services, &user_services)?;\n        }\n        let mut managed_services =\n            services_enabled.then_some(configured_services.unwrap_or_default());\n        let user_services = if services_enabled {\n            system::user_services::requests_from_config(&config)?\n        } else {\n            vec![]\n        };\n        let mut managed_firewall = if skip.contains(&BootstrapPart::Firewall) {\n            None\n        } else {\n            system::firewall::prepare_request_from_config(&config)?\n        };\n        let mut managed_compose = if skip.contains(&BootstrapPart::Compose) {\n            None\n        } else {","sourceCodeStart":1380,"sourceCodeEnd":1416,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/bootstrap.rs#L1380-L1416","documentation":"A `.expect()` panic in mise's bootstrap command (src/cli/bootstrap.rs:1398). It asserts that when notifications were configured, the services preflight populated `configured_services`. The panic fires when validation proceeds with notifications enabled but no services were prepared, indicating an out-of-order or skipped services preflight phase.","triggerScenarios":"`notifications_configured` is true but `configured_services` is None because the services preflight step was skipped (e.g. BootstrapPart::Services in the skip list) or was never invoked before `validate_notifications`.","commonSituations":"Running a partial bootstrap (skip lists used by tests or `mise bootstrap --only`) that includes notifications but excludes the services preflight; refactors that reorder bootstrap phases.","solutions":["Include the Services part in the bootstrap run when notifications are configured","Run the services preflight before the notifications validation block","Guard the notifications block on `configured_services.is_some()` as well"],"exampleFix":"// before\nlet services = configured_services.as_ref().expect(\"configured notifications prepared services\");\n// after\nlet Some(services) = configured_services.as_ref() else { debug!(\"bootstrap: no services prepared for notifications\"); return Ok(()); };","handlingStrategy":"validation","validationCode":"if notifications_configured && configured_services.is_none() { return Err(anyhow!(\"notifications configured but services preflight did not run\")); }","typeGuard":"let services_ready = configured_services.as_ref().is_some_and(|s| !s.is_empty());","tryCatchPattern":"match configured_services.as_ref() { Some(s) => validate_notifications(files, directories, s, &user_services)?, None => bail!(\"services not prepared for notifications\"), }","preventionTips":["Validate the skip list against inter-part dependencies before dispatching","Keep notifications and services phases coupled in one bootstrap part or explicit dependency","Add unit tests for partial bootstrap runs"],"tags":["rust","panic","bootstrap","invariant"],"backgroundTag":"internal-invariant-violation","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}