LykosAI/StabilityMatrix · error · ApplicationException

Not enough space to download

Error message

Not enough space to download {Name} to {installLocation}, need at least 5GB

What it means

BaseGitPackage.DownloadPackage checks free disk space at the install location before cloning, requiring at least 5 GiB (5 * SystemInfo.Gibibyte). If SystemInfo.GetDiskFreeSpaceBytes(installLocation) returns less than that (or null, via the `is <` pattern), it throws ApplicationException naming the package and target path. The library throws it up front because a git clone of these multi-GB model packages would otherwise fail partway, leaving a broken partial install.

Solutions

  1. Free at least 5 GiB on the target drive (delete temp files, old packages, models) and retry the install.
  2. Choose a different install location on a drive with more than 5 GiB free.
  3. Verify actual free space with `Get-PSDrive` (PowerShell) or `df -h` (Linux); note GetDiskFreeSpaceBytes may return null on unusual paths — install to a plain local path.
  4. Clean up previous failed install folders at the same location, which can consume significant space.

Example fix

// before
drive C: has 3.2 GiB free
await package.InstallPackage(options with installLocation C:\StabilityMatrix, progress);
// ApplicationException: Not enough space...

// after: pick a volume with >5 GiB free (e.g. D:)
options.InstallLocation = "D:\\StabilityMatrix\\Packages\\ComfyUI";
await package.InstallPackage(options, progress); // proceeds to git clone
Defensive patterns

Strategy: validation

Validate before calling

const long RequiredBytes = 5L * 1024 * 1024 * 1024;
var free = SystemInfo.GetDiskFreeSpaceBytes(installLocation);
if (free is < RequiredBytes)
    throw new InvalidOperationException(
        $"Install location {installLocation} needs at least 5GB free (found {free ?? 0} bytes).");

Try / catch

try
{
    await package.InstallPackage(options, progress, ct);
}
catch (ApplicationException ex) when (ex.Message.Contains("Not enough space"))
{
    logger.LogError(ex, "Insufficient disk space at {Location}", options.InstallLocation);
    // prompt user to free space or choose another drive, then retry
}

Prevention

When it happens

Trigger: Calling DownloadPackage (InstallPackage flow) with an installLocation on a drive/volume with under 5 GiB free — e.g. installing a large ComfyUI/A1111 package onto a nearly full C: drive or a small secondary SSD — triggers the check before `git clone` runs.

Common situations: System drive filled up over time; user points the install location at a small portable drive; free space shrank below 5GB between selecting the folder and starting the install; a network share or Docker volume reports less free space than expected.

Related errors


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

Appendix: source

Thrown at StabilityMatrix.Core/Models/Packages/BaseGitPackage.cs:309

            .GetAllReleases(RepositoryAuthor, RepositoryName)
            .ConfigureAwait(false);
        return allReleases;
    }

    public override async Task DownloadPackage(
        string installLocation,
        DownloadPackageOptions options,
        IProgress<ProgressReport>? progress = null,
        CancellationToken cancellationToken = default
    )
    {
        var versionOptions = options.VersionOptions;

        const long fiveGigs = 5 * SystemInfo.Gibibyte;

        if (SystemInfo.GetDiskFreeSpaceBytes(installLocation) is < fiveGigs)
        {
            throw new ApplicationException(
                $"Not enough space to download {Name} to {installLocation}, need at least 5GB"
            );
        }

        var gitArgs = new List<string> { "clone" };

        var branchArg = !string.IsNullOrWhiteSpace(versionOptions.VersionTag)
            ? versionOptions.VersionTag
            : versionOptions.BranchName;

        if (!string.IsNullOrWhiteSpace(branchArg))
        {
            gitArgs.Add("--branch");
            gitArgs.Add(branchArg);
        }

        gitArgs.Add(GithubUrl);
        gitArgs.Add(installLocation);

View on GitHub (pinned to af93d6ef57)