LykosAI/StabilityMatrix · error · ArgumentException
Package path is null
Error message
Package path is null
What it means
MigrateLinksIfNeeded throws ArgumentException("Package path is null", nameof(packagePair)) when the InstalledPackage.FullPath of the given PackagePair is null, so symlink migration for inference outputs cannot locate the package directory. It signals corrupt/incomplete package registration.
Solutions
- Reinstall or repair the package so InstalledPackage.FullPath is populated
- Remove and re-add the package entry in Stability Matrix if its record is corrupt
- Point the package at its actual install directory via package management UI
- Only run inference against fully installed packages with valid paths
Example fix
// before
await inferenceManager.RunAsync(brokenPackagePair, prompt);
// after
if (brokenPackagePair.InstalledPackage.FullPath is null)
{
throw new InvalidOperationException($"Package '{brokenPackagePair.InstalledPackage.DisplayName}' has no install path; reinstall it first");
}
await inferenceManager.RunAsync(brokenPackagePair, prompt); Defensive patterns
Strategy: validation
Validate before calling
if (packagePair.InstalledPackage.FullPath is null)
throw new InvalidOperationException("Package not fully installed; reinstall before inference"); Type guard
bool IsRunnable(PackagePair p) => p.InstalledPackage.FullPath is not null && Directory.Exists(p.InstalledPackage.FullPath);
Try / catch
try
{
await inference.RunAsync(packagePair, prompt);
}
catch (ArgumentException ex) when (ex.Message.Contains("Package path is null"))
{
// prompt user to reinstall/re-link the package
} Prevention
- Only run inference on fully installed packages
- Validate FullPath and directory existence before use
- Clean up corrupt package records promptly
When it happens
Trigger: Invoking inference (which triggers link migration) against a PackagePair whose InstalledPackage.FullPath was never set — e.g. a package record created before install completed or a partially imported package.
Common situations: Importing a package record from another machine/config without resolving its path; interrupted package installation leaving FullPath null; database record edited or migrated incorrectly; running inference on a package that was deleted but not unregistered.
Related errors
- Uri scheme is not supported
- Project was created in an earlier pre-release version of…
- Model file name must contain a valid file name.
- Archive must be a zipped tar.
- Invalid package specifier
AI-assisted analysis of LykosAI/StabilityMatrix@af93d6ef57 (2026-09-12).
Data as JSON: /api/errors/37b53e64dd2ea784.
Report an issue: GitHub.
Appendix: source
Thrown at StabilityMatrix.Avalonia/Services/InferenceClientManager.cs:891
await LoadSharedPropertiesAsync();
}
catch (Exception)
{
Client = null;
throw;
}
finally
{
IsConnecting = false;
}
}
private async Task MigrateLinksIfNeeded(PackagePair packagePair)
{
if (packagePair.InstalledPackage.FullPath is not { } packagePath)
{
throw new ArgumentException("Package path is null", nameof(packagePair));
}
var inferenceDir = settingsManager.ImagesInferenceDirectory;
inferenceDir.Create();
// For locally installed packages only
// Delete ./output/Inference
var legacyInferenceLinkDir = new DirectoryPath(packagePair.InstalledPackage.FullPath).JoinDir(
"output",
"Inference"
);
if (legacyInferenceLinkDir.Exists)
{
logger.LogInformation("Deleting legacy inference link at {LegacyDir}", legacyInferenceLinkDir);
if (legacyInferenceLinkDir.IsSymbolicLink)View on GitHub (pinned to af93d6ef57)