Hmbown/CodeWhale · error

The system/package executable was not changed.

Error message

The system/package executable was not changed.

What it means

run_update detects the current executable lives in a protected system/package directory (e.g. /usr/bin, /usr/local/bin) where in-place self-update is disabled because it would require root and would fight the system layout. Unless running in --check mode, it bails so the binary is left untouched, printing GITHUB_MIGRATION_HELP on how to move to the GitHub-managed install path.

Solutions

  1. Run `codewhale update --check` to view the available release without modifying anything.
  2. Install the binary in a user-owned location (e.g. ~/.local/bin or ~/.cargo/bin) and update from there.
  3. Follow the printed GITHUB_MIGRATION_HELP to migrate to the GitHub release install method.
  4. Update via the system package manager if the binary was installed by one.

Example fix

// before
sudo /usr/local/bin/codewhale update   # bail
// after
mv /usr/local/bin/codewhale ~/.local/bin/ && export PATH="$HOME/.local/bin:$PATH" && codewhale update
Defensive patterns

Strategy: fallback

Validate before calling

# before updating, check where the binary lives
command -v codewhale   # if under /usr, /usr/local, or a package dir, self-update is disabled

Try / catch

// shell
if ! codewhale update; then
  codewhale update --check   # show what's available, update via package manager instead
fi

Prevention

When it happens

Trigger: Running the self-update command when the current exe resolves to a system or package directory (protected_location true) and --check was not passed.

Common situations: Binary installed to /usr/local/bin by hand or via a distro package and the user runs `codewhale update`; system-wide installs in containers; running the updater under sudo expecting an in-place upgrade.

Understand the failure class

Background: Permission denied / not authorized / 403 Forbidden: access-control rejections when the caller lacks the required role, grant, or ownership — this error's family across 18 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/f7e8531409d46810. Report an issue: GitHub.

Appendix: source

Thrown at crates/cli/src/update.rs:83

    println!("Current binary: {}", current_exe.display());
    println!("Current version: v{current_version}");
    if legacy_binary {
        println!();
        println!("{}", legacy_binary_message(&current_exe));
    }
    if let Some(warning) = managed_install_warning(install_method) {
        println!();
        println!("{warning}");
        if !check_only {
            bail!("The package-managed executable was not changed.");
        }
    }
    if protected_location {
        println!(
            "System/package directory: in-place self-update is disabled.\n\n{GITHUB_MIGRATION_HELP}"
        );
        if !check_only {
            bail!("The system/package executable was not changed.");
        }
    }

    if check_only {
        let fetched = fetch_latest_release(channel, proxy.as_ref())
            .with_context(update_network_fallback_hint)?;
        let latest_tag = &fetched.release.tag_name;
        println!("Latest {} release: {latest_tag}", channel.label());
        if update_is_needed(channel, current_version, latest_tag)? {
            if install_method.supports_self_update() && !protected_location {
                println!(
                    "Update available. Run `{} update` to install {latest_tag}.",
                    current_exe.display()
                );
            } else if !install_method.supports_self_update() {
                println!(
                    "Update available. Use the GitHub installation instructions above, or `{}` for this package-managed copy.",
                    install_method.update_command()

View on GitHub (pinned to 73e0f67d83)