{"record":{"id":"f7e8531409d46810","repo":"Hmbown/CodeWhale","slug":"the-system-package-executable-was-not-changed","errorCode":null,"errorMessage":"The system/package executable was not changed.","messagePattern":"The system/package executable was not changed\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/update.rs","lineNumber":83,"sourceCode":"    println!(\"Current binary: {}\", current_exe.display());\n    println!(\"Current version: v{current_version}\");\n    if legacy_binary {\n        println!();\n        println!(\"{}\", legacy_binary_message(&current_exe));\n    }\n    if let Some(warning) = managed_install_warning(install_method) {\n        println!();\n        println!(\"{warning}\");\n        if !check_only {\n            bail!(\"The package-managed executable was not changed.\");\n        }\n    }\n    if protected_location {\n        println!(\n            \"System/package directory: in-place self-update is disabled.\\n\\n{GITHUB_MIGRATION_HELP}\"\n        );\n        if !check_only {\n            bail!(\"The system/package executable was not changed.\");\n        }\n    }\n\n    if check_only {\n        let fetched = fetch_latest_release(channel, proxy.as_ref())\n            .with_context(update_network_fallback_hint)?;\n        let latest_tag = &fetched.release.tag_name;\n        println!(\"Latest {} release: {latest_tag}\", channel.label());\n        if update_is_needed(channel, current_version, latest_tag)? {\n            if install_method.supports_self_update() && !protected_location {\n                println!(\n                    \"Update available. Run `{} update` to install {latest_tag}.\",\n                    current_exe.display()\n                );\n            } else if !install_method.supports_self_update() {\n                println!(\n                    \"Update available. Use the GitHub installation instructions above, or `{}` for this package-managed copy.\",\n                    install_method.update_command()","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/cli/src/update.rs#L65-L101","documentation":"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.","triggerScenarios":"Running the self-update command when the current exe resolves to a system or package directory (protected_location true) and --check was not passed.","commonSituations":"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.","solutions":["Run `codewhale update --check` to view the available release without modifying anything.","Install the binary in a user-owned location (e.g. ~/.local/bin or ~/.cargo/bin) and update from there.","Follow the printed GITHUB_MIGRATION_HELP to migrate to the GitHub release install method.","Update via the system package manager if the binary was installed by one."],"exampleFix":"// before\nsudo /usr/local/bin/codewhale update   # bail\n// after\nmv /usr/local/bin/codewhale ~/.local/bin/ && export PATH=\"$HOME/.local/bin:$PATH\" && codewhale update","handlingStrategy":"fallback","validationCode":"# before updating, check where the binary lives\ncommand -v codewhale   # if under /usr, /usr/local, or a package dir, self-update is disabled","typeGuard":null,"tryCatchPattern":"// shell\nif ! codewhale update; then\n  codewhale update --check   # show what's available, update via package manager instead\nfi","preventionTips":["Install the binary into a user-writable path (~/.local/bin) if you want self-update.","Never rely on sudo + self-update for system-directory installs.","Follow the printed GITHUB_MIGRATION_HELP once, then self-update works thereafter."],"tags":["cli","self-update","filesystem","permissions"],"backgroundTag":"permission-denied","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}