gitbutlerapp/gitbutler · warning

{err}

Error message

{err}

What it means

configure_shell detects that the shell's config file is missing required entries and offers to add them automatically. If the user confirms and cfg.setup_config() fails, the underlying error is logged as a warning with format!("{err}"). This message is the propagated error text from setup_config, surfaced as a warning rather than aborting the installation.

Solutions

  1. Read the logged {err} message to see the underlying cause (permissions, parse failure, unsupported shell).
  2. Add the required completion/env lines to your shell config manually, as documented by the installer output.
  3. Fix file permissions (chown/chmod +w) on the rc file and re-run the installer, choosing 'yes' at the prompt.
  4. Check whether the rc file is a symlink into a managed dotfiles store and update the source file instead.
Defensive patterns

Strategy: try-catch

Validate before calling

# Check the shell rc file is writable before letting the installer modify it
import os
def rc_writable(rc_path):
    return os.path.exists(rc_path) and os.access(rc_path, os.W_OK) or os.access(os.path.dirname(rc_path), os.W_OK)

Try / catch

// Downgrade config write failure to a warning with manual instructions
if let Err(err) = cfg.setup_config() {
    warn(&format!("{err}"));
    warn("add the lines manually to your rc file, then re-source it");
}

Prevention

When it happens

Trigger: Raised in configure_shell (called from run_installation_impl) when setup_config cannot modify the shell config file — typically permission problems, an unreadable/unparsable rc file, or an unsupported shell.

Common situations: rc file owned by root or read-only; dotfiles managed by a dotfile manager (chezmoi, stow, GNU stow symlinks to a read-only store); non-standard SHELL env var pointing at an unsupported shell; disk full.

Understand the failure class

Background: "Permission denied" / "Failed to write" file errors: why a library can't write its files to disk (EACCES, EPERM, ENOSPC) and how to fix them — this error's family across 43 libraries.

Related errors


AI-assisted analysis of gitbutlerapp/gitbutler@58e5313667 (2026-09-18). Data as JSON: /api/errors/937e62747919119a. Report an issue: GitHub.

Appendix: source

Thrown at crates/but-installer/src/shell.rs:215

        ui::println_empty();
        info(&format!(
            "Detected {} config file: '{}'",
            cfg.shell.name(),
            cfg.config_path.display()
        ));

        let mut missing = Vec::new();
        if !cfg.has_path {
            missing.push("PATH setup");
        }
        if !cfg.has_completions {
            missing.push("shell completions");
        }
        info(&format!("Config file lacks: {}", missing.join(", ")));

        if ui::prompt_for_confirmation("Automatically add missing config?") {
            if let Err(err) = cfg.setup_config() {
                warn(&format!("{err}"));
                warn(&format!(
                    "Failed to add shell configuration for {}, skipping...",
                    cfg.shell.name()
                ));
            }
        } else {
            info(&format!(
                "Skipping auto-configuration for {}",
                cfg.shell.name()
            ));
            info(&format!(
                "For manual setup, add the following to '{}'",
                cfg.config_path.display(),
            ));
            ui::println_empty();
            for line in cfg.generate_missing_shell_config_lines() {
                ui::println(&format!("  {line}"));
            }

View on GitHub (pinned to 58e5313667)