LykosAI/StabilityMatrix · warning · OperationCanceledException

Git installation canceled

Error message

Git installation canceled

What it means

InstallGitIfNecessary loops while git is not installed: it shows a dialog asking to install git. If the user closes/dismisses the dialog (result None) the method throws OperationCanceledException('Git installation canceled') to abort the surrounding package install, since git is required to clone/update packages.

Solutions

  1. Install git system-wide (e.g. sudo apt install git / dnf install git) and re-run the package install.
  2. If the dialog appears again, choose to install git rather than canceling.
  3. Dismissal is intentional cancellation — retry the operation and accept the prompt to proceed.
Defensive patterns

Strategy: try-catch

Validate before calling

if (!await helper.CheckIsGitInstalled())
    return; // skip git-dependent install or pre-install git

Try / catch

try { await helper.InstallGitIfNecessary(); }
catch (OperationCanceledException ex) when (ex.Message == "Git installation canceled")
{ logger.Info("User declined git install; aborting package install gracefully."); }

Prevention

When it happens

Trigger: Installing/updating a package on Linux when git is not on PATH, and the user clicks 'Cancel'/closes the ContentDialog instead of installing git.

Common situations: Fresh Linux install without git present; user declines the prompted installation and the package install aborts; first-run package setup on minimal distros.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of LykosAI/StabilityMatrix@af93d6ef57 (2026-09-12). Data as JSON: /api/errors/59ecfcb4028f8bc1. Report an issue: GitHub.

Appendix: source

Thrown at StabilityMatrix.Avalonia/Helpers/UnixPrerequisiteHelper.cs:262

                        Text = "The current operation requires Git. Please install it to continue.",
                    },
                    new SelectableTextBlock { Text = "$ sudo apt install git" },
                },
            },
            PrimaryButtonText = Resources.Action_Retry,
            CloseButtonText = Resources.Action_Close,
            DefaultButton = ContentDialogButton.Primary,
        };

        while (true)
        {
            // Return if installed
            if (await CheckIsGitInstalled())
                return;
            if (await dialog.ShowAsync() == ContentDialogResult.None)
            {
                // Cancel
                throw new OperationCanceledException("Git installation canceled");
            }
            // Otherwise continue to retry indefinitely
        }
    }

    /// <inheritdoc />
    public Task RunGit(
        ProcessArgs args,
        Action<ProcessOutput>? onProcessOutput = null,
        string? workingDirectory = null
    )
    {
        // Async progress not supported on Unix
        return RunGit(args, workingDirectory);
    }

    private async Task RunGit(ProcessArgs args, string? workingDirectory = null)
    {

View on GitHub (pinned to af93d6ef57)