{"record":{"id":"46adaaeadf2706d0","repo":"LykosAI/StabilityMatrix","slug":"not-enough-space-to-download-name-to-installlocation-need-at","errorCode":null,"errorMessage":"Not enough space to download {Name} to {installLocation}, need at least 5GB","messagePattern":"Not enough space to download (.+?) to (.+?), need at least 5GB","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"StabilityMatrix.Core/Models/Packages/BaseGitPackage.cs","lineNumber":309,"sourceCode":"            .GetAllReleases(RepositoryAuthor, RepositoryName)\n            .ConfigureAwait(false);\n        return allReleases;\n    }\n\n    public override async Task DownloadPackage(\n        string installLocation,\n        DownloadPackageOptions options,\n        IProgress<ProgressReport>? progress = null,\n        CancellationToken cancellationToken = default\n    )\n    {\n        var versionOptions = options.VersionOptions;\n\n        const long fiveGigs = 5 * SystemInfo.Gibibyte;\n\n        if (SystemInfo.GetDiskFreeSpaceBytes(installLocation) is < fiveGigs)\n        {\n            throw new ApplicationException(\n                $\"Not enough space to download {Name} to {installLocation}, need at least 5GB\"\n            );\n        }\n\n        var gitArgs = new List<string> { \"clone\" };\n\n        var branchArg = !string.IsNullOrWhiteSpace(versionOptions.VersionTag)\n            ? versionOptions.VersionTag\n            : versionOptions.BranchName;\n\n        if (!string.IsNullOrWhiteSpace(branchArg))\n        {\n            gitArgs.Add(\"--branch\");\n            gitArgs.Add(branchArg);\n        }\n\n        gitArgs.Add(GithubUrl);\n        gitArgs.Add(installLocation);","sourceCodeStart":291,"sourceCodeEnd":327,"githubUrl":"https://github.com/LykosAI/StabilityMatrix/blob/af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002/StabilityMatrix.Core/Models/Packages/BaseGitPackage.cs#L291-L327","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Free at least 5 GiB on the target drive (delete temp files, old packages, models) and retry the install.","Choose a different install location on a drive with more than 5 GiB free.","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.","Clean up previous failed install folders at the same location, which can consume significant space."],"exampleFix":"// before\ndrive C: has 3.2 GiB free\nawait package.InstallPackage(options with installLocation C:\\StabilityMatrix, progress);\n// ApplicationException: Not enough space...\n\n// after: pick a volume with >5 GiB free (e.g. D:)\noptions.InstallLocation = \"D:\\\\StabilityMatrix\\\\Packages\\\\ComfyUI\";\nawait package.InstallPackage(options, progress); // proceeds to git clone","handlingStrategy":"validation","validationCode":"const long RequiredBytes = 5L * 1024 * 1024 * 1024;\nvar free = SystemInfo.GetDiskFreeSpaceBytes(installLocation);\nif (free is < RequiredBytes)\n    throw new InvalidOperationException(\n        $\"Install location {installLocation} needs at least 5GB free (found {free ?? 0} bytes).\");","typeGuard":null,"tryCatchPattern":"try\n{\n    await package.InstallPackage(options, progress, ct);\n}\ncatch (ApplicationException ex) when (ex.Message.Contains(\"Not enough space\"))\n{\n    logger.LogError(ex, \"Insufficient disk space at {Location}\", options.InstallLocation);\n    // prompt user to free space or choose another drive, then retry\n}","preventionTips":["Check free space on the target drive before starting any large package install.","Prefer install locations on drives with >10 GiB free to leave headroom beyond the 5GB minimum.","Clean up failed/partial install directories, which can quietly consume disk space.","Be cautious with network shares or volumes that may report inaccurate free-space figures."],"tags":["disk-space","install","git-clone","storage"],"backgroundTag":"insufficient-disk-space","analyzedSha":"af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002","analyzedAt":"2026-09-12T19:02:43.389Z","contentChangedAt":"2026-09-12T19:02:43.389Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}