{"record":{"id":"77d6bb107b1f966f","repo":"apache/superset","slug":"no-dashboard-found-for-uuid-sourceuuid","errorCode":null,"errorMessage":"No dashboard found for uuid ${sourceUuid}","messagePattern":"No dashboard found for uuid (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"superset-frontend/src/features/versionHistory/api.ts","lineNumber":285,"sourceCode":"\n/**\n * Forks a dashboard version into a new dashboard via the copy endpoint;\n * returns the new dashboard id. The copy endpoint derives the new\n * dashboard's chart associations from the `positions` key of\n * `json_metadata`, so the fork references (shares, not duplicates)\n * exactly the charts present in the snapshot's layout. Slots whose chart\n * no longer resolves are swapped for the same markdown placeholder the\n * preview renders — the copy endpoint would silently skip their chart\n * associations, leaving dead slots in the forked layout.\n */\nexport async function createDashboardFromSnapshot(\n  sourceUuid: string,\n  snapshot: DashboardVersionSnapshot,\n  name: string,\n): Promise<number> {\n  const sourceId = await resolveEntityId('dashboard', sourceUuid);\n  if (sourceId === null) {\n    throw new Error(`No dashboard found for uuid ${sourceUuid}`);\n  }\n  const metadata: JsonObject = snapshot.json_metadata\n    ? JSON.parse(snapshot.json_metadata)\n    : {};\n  // Always send `positions`, even empty. The copy endpoint rebuilds the new\n  // dashboard's layout and chart associations from this key; omitting it\n  // leaves the copy with the *source's current* charts, so forking a version\n  // that had no layout would produce today's dashboard under a historical\n  // name.\n  metadata.positions = {};\n  if (snapshot.position_json) {\n    let positions: JsonObject = JSON.parse(snapshot.position_json);\n    const chartIds = new Set<number>();\n    Object.values(positions).forEach(item => {\n      const chartId = layoutChartId(item as JsonObject);\n      if (chartId !== null) {\n        chartIds.add(chartId);\n      }","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset-frontend/src/features/versionHistory/api.ts#L267-L303","documentation":"Thrown by createDashboardFromSnapshot when resolveEntityId('dashboard', sourceUuid) returns null, i.e. the backend could not resolve the given dashboard UUID to an existing dashboard row. Forking a dashboard version requires the source dashboard to still exist because the copy endpoint works off its id. The UUID usually comes from the version-history entry of the dashboard being viewed.","triggerScenarios":"Calling createDashboardFromSnapshot (version history 'restore/fork to new dashboard') with a sourceUuid that is deleted, truncated, or belongs to another deployment; importing version-history data without the backing dashboard; typos in the uuid parameter.","commonSituations":"Dashboard was deleted after versions were recorded; database restored/migrated losing the row; user lacks read access so the lookup endpoint returns not-found; stale URL or bookmark pointing at an old dashboard id.","solutions":["Verify the source dashboard exists: GET /api/v1/dashboard/{sourceUuid} returns 200 before attempting the fork.","Re-create or restore the deleted source dashboard, then retry the fork.","Check the logged-in user has can_read access to the dashboard (the resolve call is permission-scoped).","In the UI, surface a friendly toast ('Source dashboard no longer exists') instead of the raw thrown error."],"exampleFix":"// before\nconst id = await createDashboardFromSnapshot(sourceUuid, snapshot, name);\n\n// after\nconst exists = await SupersetClient.get({ endpoint: `/api/v1/dashboard/${sourceUuid}` }).then(r => r.status === 200).catch(() => false);\nif (!exists) {\n  addDangerToast(t('The source dashboard for this version no longer exists'));\n  return;\n}\nconst id = await createDashboardFromSnapshot(sourceUuid, snapshot, name);","handlingStrategy":"validation","validationCode":"import SupersetClient from '@superset-ui/core';\n\nasync function dashboardUuidExists(uuid: string): Promise<boolean> {\n  try {\n    const r = await SupersetClient.get({ endpoint: `/api/v1/dashboard/${uuid}` });\n    return r.status === 200;\n  } catch {\n    return false;\n  }\n}\n\nif (!(await dashboardUuidExists(sourceUuid))) {\n  // show friendly message instead of forking\n}","typeGuard":"function isDashboardRef(uuid: unknown): uuid is string {\n  return typeof uuid === 'string' && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(uuid);\n}","tryCatchPattern":"try {\n  const newId = await createDashboardFromSnapshot(sourceUuid, snapshot, name);\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('No dashboard found')) {\n    addDangerToast(t('Source dashboard no longer exists; cannot fork this version'));\n    return;\n  }\n  throw e;\n}","preventionTips":["Before offering 'fork to new dashboard' in the UI, verify the source dashboard is still readable.","Never reuse version-history payloads across environments without the backing dashboard rows.","Log the sourceUuid when the fork fails to correlate with deletion/permission events."],"tags":["dashboard","version-history","uuid","api"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}