{"record":{"id":"72ae5c8e31d86177","repo":"LykosAI/StabilityMatrix","slug":"package-not-found-or-not-installed-correctly","errorCode":null,"errorMessage":"Package not found or not installed correctly","messagePattern":"Package not found or not installed correctly","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"StabilityMatrix.Core/Models/Packages/FramePack.cs","lineNumber":208,"sourceCode":"            var match = regex.Match(s.Text);\n            if (match.Success)\n                WebUrl = match.Value;\n            OnStartupComplete(WebUrl);\n        }\n    }\n\n    public override List<ExtraPackageCommand> GetExtraCommands()\n    {\n        return Compat.IsWindows && SettingsManager.Settings.PreferredGpu?.IsAmpereOrNewerGpu() is true\n            ?\n            [\n                new ExtraPackageCommand\n                {\n                    CommandName = \"Install Triton and SageAttention\",\n                    Command = async installedPackage =>\n                    {\n                        if (installedPackage == null || string.IsNullOrEmpty(installedPackage.FullPath))\n                            throw new InvalidOperationException(\n                                \"Package not found or not installed correctly\"\n                            );\n\n                        await InstallTritonAndSageAttention(installedPackage).ConfigureAwait(false);\n                    },\n                },\n            ]\n            : [];\n    }\n\n    private static string AddGradioAllowedPathsSupport(string originalContent)\n    {\n        // Add the --gradio-allowed-paths argument to the argument parser\n        var parserPattern =\n            @\"(parser\\.add_argument\\(\"\"--inbrowser\"\", action='store_true'\\)\\s*\\n)(args = parser\\.parse_args\\(\\))\";\n        var parserReplacement =\n            \"$1parser.add_argument('--gradio-allowed-paths', nargs='*', default=[], help='Allowed paths for Gradio file access')\\n$2\";\n","sourceCodeStart":190,"sourceCodeEnd":226,"githubUrl":"https://github.com/LykosAI/StabilityMatrix/blob/af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002/StabilityMatrix.Core/Models/Packages/FramePack.cs#L190-L226","documentation":"FramePack's 'Install Triton and SageAttention' extra command throws InvalidOperationException when the installedPackage argument is null or its FullPath is empty. It's a guard ensuring the command only runs against an actually installed package with a valid install directory.","triggerScenarios":"Invoking the extra command with a null package reference or a package record whose FullPath was never set (package registered but files missing/not installed).","commonSituations":"Package entry left over from a failed or deleted install; invoking the command from a stale UI state; database record missing FullPath after moving the library folder.","solutions":["Reinstall or re-add the FramePack package so FullPath is populated, then rerun the command.","Verify the package directory exists on disk; if moved, relocate it back or delete and reinstall.","Remove the stale package entry from Stability Matrix and reinstall fresh.","Run the Triton/SageAttention install only from the package card UI, not via stale references."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"if (installedPackage is not { FullPath: { Length: > 0 } })\n{\n    // skip or prompt reinstall before invoking the extra command\n}","typeGuard":"bool IsUsablePackage(InstalledPackage? p) => p is { FullPath: { Length: > 0 } };","tryCatchPattern":"try { await command(installedPackage); }\ncatch (InvalidOperationException ex) when (ex.Message == \"Package not found or not installed correctly\")\n{ PromptReinstall(); }","preventionTips":["Only run extra commands from the package card of an installed package","Re-check package integrity after moving the library folder","Clean up stale package records after failed installs"],"tags":["package-validation","null-check","extra-command"],"backgroundTag":"entity-not-found","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"}