jdx/mise · error

refusing unsafe change to bootstrap compose project

Error message

refusing unsafe change to bootstrap compose project '{}'; inspect `mise bootstrap plan`

What it means

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.

Solutions

  1. Run `mise bootstrap plan` to see why the action is unknown
  2. Align the declared state with the live project (e.g. adopt it via matching project_name/project_dir, or remove it manually)
  3. Re-run apply after refreshing state (`docker compose ps` / re-plan)
  4. If the project is orphaned, remove it manually or update the declaration so the action resolves

Example fix

# before
mise bootstrap apply   # refuses: Unknown action
# after
mise bootstrap plan    # inspect why the change is unsafe
# adopt/fix the project so the action is determinate, then
mise bootstrap apply
Defensive patterns

Strategy: validation

Validate before calling

# always dry-run first and confirm every action is determinate
mise bootstrap plan || exit 1

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/e75aa98195c708e8. Report an issue: GitHub.

Appendix: source

Thrown at src/system/compose.rs:242

        .map(|request| request.plan_with_dependency_change(dependency_changed))
        .collect()
}

pub(crate) fn apply(requests: &[ComposeRequest], dry_run: bool, yes: bool) -> Result<()> {
    apply_with_dry_run_actions(requests, &HashMap::new(), dry_run, yes)
}

pub(crate) fn apply_with_dry_run_actions(
    requests: &[ComposeRequest],
    dry_run_actions: &HashMap<String, ResourceAction>,
    dry_run: bool,
    yes: bool,
) -> Result<()> {
    let mut changes = vec![];
    for request in requests {
        let action = apply_action(request, dry_run_actions, dry_run);
        match action {
            ResourceAction::Unknown => bail!(
                "refusing unsafe change to bootstrap compose project '{}'; inspect `mise bootstrap plan`",
                request.name
            ),
            ResourceAction::Noop => {}
            ResourceAction::Create | ResourceAction::Update | ResourceAction::Remove => {
                changes.push(request)
            }
        }
    }
    if changes.is_empty() {
        info!("compose projects: already converged");
        return Ok(());
    }
    if dry_run {
        for request in changes {
            for argv in request.dry_run_action_argvs()? {
                miseprintln!("would run {}", shell_words::join(argv));
            }

View on GitHub (pinned to 533346cc37)