Skip to content

mw app uninstall reports success despite failing with HTTP 412 (linked primary DB) #1970

Description

@Hermsi1337

Summary

mw app uninstall <app> --force prints both an error and "Process completed successfully" when the app has a linked primary database, and the app is not uninstalled. An automated / agent-driven run can't tell that it failed.

Verified against mw 1.19.0.

Repro

  1. An app installation with a linked primary database (PATCH /v2/app-installations/{id}/database, purpose: primary).
  2. mw app uninstall <shortId> --force

Output:

  Error: AxiosError: Request failed with status code 412
Completed: Process completed successfully

Summary: [Complex content]

Afterwards the app is still present (mw app list) — the uninstall actually failed (HTTP 412), yet the CLI reports success (and appears to exit 0).

Two problems

  1. False success / wrong exit semantics. On a 412 the CLI should surface the failure, not print "Process completed successfully", and exit non-zero. Today a script cannot detect the failure.
  2. The 412 reason isn't surfaced. The cause is a linked primary database. A primary DB also can't be unlinked directly — DELETE /v2/app-installations/{id}/databases/{databaseId} returns 412 "primary database of app installation cannot be unlinked"; you must first repurpose it to custom/cache, then unlink. A clear message like "cannot uninstall: app has a linked primary database — unlink or repurpose it first" would save a lot of guessing.

Note — why the guard matters

The raw API DELETE /v2/app-installations/{id} does cascade-delete the linked primary database. The CLI's 412 guard is a good safety net against silent data loss — it just needs to report the refusal correctly instead of claiming success.

Context

Surfaced while validating the mittwald-migrate skill.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions