microsoft/aspire · error

Dashboard run ' ' is no longer available.

Error message

Dashboard run '{storedRun.RunId}' is no longer available.

What it means

Inside SetRunPinned, after resolving the stored run, the store tries to take a temporary file lock on the run's directory (needed only for unselected, non-current historical runs). If TryOpenRunLock returns null — the lock file cannot be opened because the run is being deleted or its directory is inaccessible — the null-coalescing throw raises InvalidOperationException.

Solutions

  1. Retry the pin operation after re-checking the run still exists in the store
  2. Check that no concurrent deletion/pruning is running when pinning historical runs
  3. Verify file-system permissions on the runs directory allow creating/opening lock files

Example fix

// before: pin without checking availability again
store.SetRunPinned(run, isPinned: true);

// after: catch the race and refresh
try
{
    store.SetRunPinned(run, isPinned: true);
}
catch (InvalidOperationException)
{
    runs = store.ListRuns(); // run vanished; refresh UI state
}
Defensive patterns

Strategy: retry

Try / catch

for (var attempt = 0; attempt < 3; attempt++)
{
    try
    {
        store.SetRunPinned(run, isPinned: true);
        break;
    }
    catch (InvalidOperationException ex) when (ex.Message.Contains("no longer available"))
    {
        await Task.Delay(200); // run may be mid-deletion; recheck then give up
    }
}

Prevention

When it happens

Trigger: Pinning a historical run while it is concurrently being deleted or its run lock file cannot be acquired/opened (TryOpenRunLock returned null).

Common situations: Race between retention cleanup deleting an old run and a user pinning it in the dashboard; run directory removed externally while metadata update is in flight; file-system permission problems on the run directory.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of microsoft/aspire@25830f84bd (2026-09-16). Data as JSON: /api/errors/77c6f03c9bfb2659. Report an issue: GitHub.

Appendix: source

Thrown at src/Aspire.Dashboard/ServiceClient/DashboardRunStore.cs:295

            string.Equals(run.RunId, runId, StringComparison.Ordinal));

    public void SetRunPinned(DashboardRunDescriptor run, bool isPinned)
    {
        var storedRun = GetRunById(run.RunId, onlyCompatible: false);
        if (storedRun is null)
        {
            throw new InvalidOperationException($"Dashboard run '{run.RunId}' is no longer available.");
        }

        var runDirectory = Path.GetDirectoryName(storedRun.DatabasePath)!;
        lock (_runStateLock)
        {
            // The current run has the store's lifetime lock, and a selected historical run has a lease.
            // Only an unselected historical run needs a temporary lock while its metadata is updated.
            using var runLock = storedRun.IsCurrent || storedRun.IsLeased
                ? null
                : TryOpenRunLock(runDirectory)
                    ?? throw new InvalidOperationException($"Dashboard run '{storedRun.RunId}' is no longer available.");
            UpdatePinnedState(storedRun, runDirectory, isPinned);
        }
    }

    private void UpdatePinnedState(DashboardRunDescriptor run, string runDirectory, bool isPinned)
    {
        var metadataPath = Path.Combine(runDirectory, "run.json");
        var metadata = JsonSerializer.Deserialize<DashboardRunMetadata>(File.ReadAllText(metadataPath));
        if (metadata?.SchemaVersion != run.SchemaVersion ||
            !string.Equals(metadata.RunId, run.RunId, StringComparison.Ordinal))
        {
            throw new InvalidDataException($"Dashboard run metadata for '{run.RunId}' is invalid.");
        }

        var updatedMetadata = metadata with { IsPinned = isPinned };
        WriteMetadata(updatedMetadata, metadataPath);
        if (string.Equals(run.RunId, RunId, StringComparison.Ordinal))
        {

View on GitHub (pinned to 25830f84bd)