{"record":{"id":"e75aa98195c708e8","repo":"jdx/mise","slug":"refusing-unsafe-change-to-bootstrap-compose-projec","errorCode":null,"errorMessage":"refusing unsafe change to bootstrap compose project '{}'; inspect `mise bootstrap plan`","messagePattern":"refusing unsafe change to bootstrap compose project '(.+?)'; inspect `mise bootstrap plan`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/compose.rs","lineNumber":242,"sourceCode":"        .map(|request| request.plan_with_dependency_change(dependency_changed))\n        .collect()\n}\n\npub(crate) fn apply(requests: &[ComposeRequest], dry_run: bool, yes: bool) -> Result<()> {\n    apply_with_dry_run_actions(requests, &HashMap::new(), dry_run, yes)\n}\n\npub(crate) fn apply_with_dry_run_actions(\n    requests: &[ComposeRequest],\n    dry_run_actions: &HashMap<String, ResourceAction>,\n    dry_run: bool,\n    yes: bool,\n) -> Result<()> {\n    let mut changes = vec![];\n    for request in requests {\n        let action = apply_action(request, dry_run_actions, dry_run);\n        match action {\n            ResourceAction::Unknown => bail!(\n                \"refusing unsafe change to bootstrap compose project '{}'; inspect `mise bootstrap plan`\",\n                request.name\n            ),\n            ResourceAction::Noop => {}\n            ResourceAction::Create | ResourceAction::Update | ResourceAction::Remove => {\n                changes.push(request)\n            }\n        }\n    }\n    if changes.is_empty() {\n        info!(\"compose projects: already converged\");\n        return Ok(());\n    }\n    if dry_run {\n        for request in changes {\n            for argv in request.dry_run_action_argvs()? {\n                miseprintln!(\"would run {}\", shell_words::join(argv));\n            }","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/compose.rs#L224-L260","documentation":"apply_action could not determine whether a bootstrap compose request is a Create, Update, Remove, or Noop (ResourceAction::Unknown), so apply aborts instead of performing an unsafe, ambiguous change to a live compose project. This is a safety gate directing the user to inspect the plan first.","triggerScenarios":"Running `mise bootstrap apply` when the current on-disk/live state of a compose project cannot be reconciled with the requested declaration — e.g. state changed between plan and apply, the project exists but its origin/ownership is unrecognized, or stale cached state makes the action indeterminate.","commonSituations":"A compose project was created outside mise (manually via docker compose) and mise cannot classify the change; config was edited between `plan` and `apply`; another process modified the project concurrently.","solutions":["Run `mise bootstrap plan` to see why the action is unknown","Align the declared state with the live project (e.g. adopt it via matching project_name/project_dir, or remove it manually)","Re-run apply after refreshing state (`docker compose ps` / re-plan)","If the project is orphaned, remove it manually or update the declaration so the action resolves"],"exampleFix":"# before\nmise bootstrap apply   # refuses: Unknown action\n# after\nmise bootstrap plan    # inspect why the change is unsafe\n# adopt/fix the project so the action is determinate, then\nmise bootstrap apply","handlingStrategy":"validation","validationCode":"# always dry-run first and confirm every action is determinate\nmise bootstrap plan || exit 1","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `mise bootstrap plan` before every apply","Avoid manually managing mise-declared projects with raw `docker compose`","Re-plan after any config or external state change before applying","Don't edit declarations between plan and apply"],"tags":["compose","safety","state-unknown"],"backgroundTag":"invalid-state-transition","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"}