{"record":{"id":"0a22d136ef57b4cf","repo":"github/spec-kit","slug":"bundle-bundle-id-is-not-installed","errorCode":null,"errorMessage":"Bundle '{bundle_id}' is not installed.","messagePattern":"Bundle '(.+?)' is not installed\\.","errorType":"exception","errorClass":"BundlerError","httpStatus":null,"severity":"error","filePath":"src/specify_cli/bundler/services/installer.py","lineNumber":189,"sourceCode":"        components=contributed,\n        # Preserve the original install time across refresh/update so\n        # ``bundle list`` keeps reporting when the bundle was first installed.\n        installed_at=existing.installed_at if existing is not None else None,\n    )\n    save_records(project_root, upsert_record(records, record))\n    return result\n\n\ndef remove_bundle(\n    project_root: Path,\n    bundle_id: str,\n    installer: PrimitiveInstaller,\n) -> InstallResult:\n    \"\"\"Remove a bundle, uninstalling only components no other bundle still needs.\"\"\"\n    records = load_records(project_root)\n    target = next((r for r in records if r.bundle_id == bundle_id), None)\n    if target is None:\n        raise BundlerError(f\"Bundle '{bundle_id}' is not installed.\")\n\n    still_needed = components_still_needed(records, exclude_bundle_id=bundle_id)\n    result = InstallResult(bundle_id=bundle_id)\n    remove_attempted = False\n\n    try:\n        for component in target.contributed_components:\n            key = (component.kind, component.id)\n            if key in still_needed:\n                result.skipped.append(component)\n                continue\n            if installer.is_installed(project_root, component):\n                remove_attempted = True\n                installer.remove(project_root, component)\n                result.uninstalled.append(component)\n        save_records(project_root, remove_record(records, bundle_id))\n    except Exception as exc:  # noqa: BLE001\n        if result.uninstalled:","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/github/spec-kit/blob/bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c/src/specify_cli/bundler/services/installer.py#L171-L207","documentation":"remove_bundle() was asked to uninstall a bundle whose bundle_id does not appear in the installed-bundle records under .specify. The lookup `next((r for r in records if r.bundle_id == bundle_id), None)` returned None, so there is nothing to remove and the operation aborts before touching any component.","triggerScenarios":"Calling remove_bundle(project_root, bundle_id) or `specify bundle remove <id>` with an id that was never installed, was already removed, was installed under a different id spelling, or whose records file was deleted/reset.","commonSituations":"Typos in the bundle id on the command line; running remove twice; the project's .specify bundle records were wiped (fresh init over an existing tree); the bundle was installed in a different project root / working directory than the one remove runs in.","solutions":["List installed bundles first (`specify bundle list`) and copy the exact bundle_id from the output.","Confirm you are running the command from the correct project root — records are per-project under .specify.","If the record is genuinely gone but components remain, uninstall the leftover components directly (e.g. `specify preset remove <id>`) instead of via the bundle.","If you expected the record to exist, check whether .specify/ was reset by a re-init and reinstall the bundle."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from specify_cli.bundler.services.installer import load_records\nfrom pathlib import Path\n\ninstalled = {r.bundle_id for r in load_records(project_root)}\nif bundle_id not in installed:\n    print(f\"available bundles: {sorted(installed) or '(none)'}\")\n    return","typeGuard":null,"tryCatchPattern":"from specify_cli.bundler.core import BundlerError\n\ntry:\n    remove_bundle(project_root, bundle_id, installer)\nexcept BundlerError as exc:\n    if \"is not installed\" in str(exc):\n        pass  # already gone — treat as success (idempotent remove)","preventionTips":["Always derive bundle ids from `specify bundle list` output rather than typing them.","Make removal scripts idempotent by treating 'is not installed' as a no-op.","Run bundler commands from the project root so the per-project records resolve."],"tags":["bundler","remove","not-found","state"],"backgroundTag":null,"analyzedSha":"bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c","analyzedAt":"2026-08-14T19:43:37.150Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}