{"record":{"id":"8d35a751608e2878","repo":"LykosAI/StabilityMatrix","slug":"could-not-find-entry-point-for-invokeai-entrypoint-torepr","errorCode":null,"errorMessage":"Could not find entry point for InvokeAI: {entryPoint.ToRepr()}","messagePattern":"Could not find entry point for InvokeAI: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"StabilityMatrix.Core/Models/Packages/InvokeAI.cs","lineNumber":404,"sourceCode":"            Logger.Warn(\n                \"InvokeAI installation using legacy Python {PythonVersion} - updates disabled\",\n                installedPackage.PythonVersion\n            );\n            onConsoleOutput?.Invoke(ProcessOutput.FromStdErrLine(warningMessage));\n        }\n\n        // Launch command is for a console entry point, and not a direct script\n        var entryPoint = await VenvRunner.GetEntryPoint(command).ConfigureAwait(false);\n\n        // Split at ':' to get package and function\n        var split = entryPoint?.Split(':');\n\n        // Console message because Invoke takes forever to start sometimes with no output of what its doing\n        onConsoleOutput?.Invoke(new ProcessOutput { Text = \"Starting InvokeAI...\\n\" });\n\n        if (split is not { Length: > 1 })\n        {\n            throw new Exception($\"Could not find entry point for InvokeAI: {entryPoint.ToRepr()}\");\n        }\n\n        // Compile a startup command according to\n        // https://packaging.python.org/en/latest/specifications/entry-points/#use-for-scripts\n        // For invokeai, also patch the shutil.get_terminal_size function to return a fixed value\n        // above the minimum in invokeai.frontend.install.widgets\n\n        var code = $\"\"\"\n            import sys\n            from {split[0]} import {split[1]}\n            sys.exit({split[1]}())\n            \"\"\";\n\n        if (runDetached)\n        {\n            async void HandleConsoleOutput(ProcessOutput s)\n            {\n                if (s.Text.Contains(\"running on\", StringComparison.OrdinalIgnoreCase))","sourceCodeStart":386,"sourceCodeEnd":422,"githubUrl":"https://github.com/LykosAI/StabilityMatrix/blob/af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002/StabilityMatrix.Core/Models/Packages/InvokeAI.cs#L386-L422","documentation":"InvokeAI.RunInvokeCommand throws when splitting the entry point path yields fewer than two parts, meaning the entry point string (e.g. 'venv\\Scripts\\invokeai.exe') doesn't contain a separator so no interpreter/script pair can be derived for launching InvokeAI.","triggerScenarios":"RunPackage -> RunInvokeCommand receives an entryPoint whose string form lacks a path separator (empty, malformed, or bare executable name), so `split` has Length <= 1.","commonSituations":"Corrupt or missing entry point after an interrupted InvokeAI install; venv layout changed (different Python/venv location); package metadata pointing at a removed launcher script.","solutions":["Reinstall InvokeAI so the venv and its entry point scripts are regenerated correctly.","Inspect the stored entry point value; it must be a full venv-relative path containing a separator (e.g. venv/Scripts/invokeai.exe).","Repair the venv (delete and let SetupVenv recreate it) if the scripts folder is missing.","Update Stability Matrix if the InvokeAI package layout changed upstream."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (string.IsNullOrEmpty(entryPoint) || !entryPoint.Contains('/'))\n{\n    // entry point malformed; reinstall InvokeAI before launching\n}","typeGuard":"bool HasValidEntryPoint(string? ep) => !string.IsNullOrWhiteSpace(ep) && ep.Split('/', '\\\\').Length > 1;","tryCatchPattern":"try { await package.RunPackage(...); }\ncatch (Exception ex) when (ex.Message.StartsWith(\"Could not find entry point\"))\n{ OfferRepairReinstall(); }","preventionTips":["Let installs complete fully before launching InvokeAI","Reinstall if the venv Scripts/bin folder is missing launcher scripts","Keep package and app versions in sync when upstream layout changes"],"tags":["entry-point","launch","invokeai"],"backgroundTag":"invalid-argument-format","analyzedSha":"af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002","analyzedAt":"2026-09-12T19:02:43.389Z","contentChangedAt":"2026-09-12T19:02:43.389Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}