github/spec-kit · error · RuntimeError

Cannot safely reuse an existing update backup directory '{ba

Error message

Cannot safely reuse an existing update backup directory '{backup_base}'

What it means

Error "Cannot safely reuse an existing update backup directory '{backup_base}'" thrown in github/spec-kit.

Source

Thrown at src/specify_cli/extensions/_commands.py:1755

                    original_key = str(skill_dir)
                    if original_key in backed_up_skill_dirs:
                        continue
                    backup_created_by_attempt = True
                    backup_skills_dir.mkdir(parents=True, exist_ok=True)
                    backup_skill_dir = backup_skills_dir / str(
                        len(backed_up_skill_dirs)
                    )
                    shutil.copytree(skill_dir, backup_skill_dir, symlinks=True)
                    backed_up_skill_dirs[original_key] = str(backup_skill_dir)

            try:
                if backup_root.is_symlink():
                    raise RuntimeError(
                        "Cannot safely create update backup under symlinked "
                        f"directory '{backup_root}'"
                    )
                if backup_base.exists() or backup_base.is_symlink():
                    raise RuntimeError(
                        "Cannot safely reuse an existing update backup "
                        f"directory '{backup_base}'"
                    )

                # 1. Backup registry entry (always, even if extension dir doesn't exist)
                backup_registry_entry = manager.registry.get(extension_id)

                # 2. Backup extension directory
                extension_dir = manager.extensions_dir / extension_id
                if extension_dir.exists():
                    backup_created_by_attempt = True
                    backup_base.mkdir(parents=True, exist_ok=True)
                    if backup_ext_dir.exists():
                        shutil.rmtree(backup_ext_dir)
                    shutil.copytree(extension_dir, backup_ext_dir)

                    # Backup config files separately so they can be restored
                    # after a successful install (install_from_directory clears dest dir).

View on GitHub (pinned to bf88c9f9a8)

Solutions

  1. Remove the existing update backup directory and retry the update.

When it happens

Trigger: Thrown at src/specify_cli/extensions/_commands.py:1755 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of github/spec-kit@bf88c9f9a8 (2026-08-14). Data as JSON: /api/errors/826d8308a166ced4. Report an issue: GitHub.