microsoft/aspire · error

Dashboard database for run

Error message

Dashboard database for run '{run.RunId}' does not match run metadata schema version '{run.SchemaVersion}'.

What it means

DashboardDataSourcePool validates, at acquisition time, that a pooled run's SQLite database matches the schema version recorded in the run metadata. TryAcquire throws InvalidOperationException when entry.Database.ValidateSchemaVersion(run.SchemaVersion) fails, then releases the entry — meaning the persisted database on disk was written by a different dashboard schema version than the metadata claims.

Solutions

  1. Delete or archive the incompatible historical run directory so the stale database is not reused
  2. Regenerate/re-initialize the run's database with the current schema version, or let the dashboard recreate it
  3. Ensure run.json metadata and the database come from the same dashboard version — never copy them across versions

Example fix

// before: resuming a run directory written by an older dashboard
// after: remove stale run data so a compatible database is recreated
Directory.Delete(Path.Combine(runsDirectory, runId), recursive: true);
Defensive patterns

Strategy: try-catch

Try / catch

try
{
    var source = pool.TryAcquire(run);
}
catch (InvalidOperationException ex) when (ex.Message.Contains("does not match run metadata schema version"))
{
    // discard/archive the stale run directory and refresh the run list
}

Prevention

When it happens

Trigger: Acquiring a data source for a historical run whose on-disk database schema version differs from the run.json SchemaVersion, e.g. after a dashboard upgrade opened an old run's database.

Common situations: Upgrading the Aspire dashboard and resuming/inspecting runs created by an older version; a run directory whose run.json was hand-edited or partially copied, leaving database and metadata out of sync.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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

Appendix: source

Thrown at src/Aspire.Dashboard/ServiceClient/DashboardDataSourcePool.cs:110

                    database = new DashboardSqliteDatabase(databasePath, readOnly: true);
                    entry = new Entry(database, runLease);
                    _entries.Add(databasePath, entry);
                }
                catch
                {
                    database?.ClearPool();
                    database?.Dispose();
                    runLease.Dispose();
                    throw;
                }
            }

            entry.ReferenceCount++;
            try
            {
                if (!entry.Database.ValidateSchemaVersion(run.SchemaVersion))
                {
                    throw new InvalidOperationException(
                        $"Dashboard database for run '{run.RunId}' does not match run metadata schema version '{run.SchemaVersion}'.");
                }
            }
            catch
            {
                Release(entry);
                throw;
            }

            var lease = new Lease(
                entry.Database,
                () => _repositoryFactory.CreateTelemetryRepository(entry.Database),
                () => _repositoryFactory.CreateResourceRepository(entry.Database),
                () => Release(entry));
            try
            {
                _ = lease.TelemetryRepository;
                _ = lease.ResourceRepository;

View on GitHub (pinned to 25830f84bd)