Budibase/budibase · error · Error
Unable to retrieve view table.
Error message
Unable to retrieve view table.
What it means
fetchLegacyView reads rows from a legacy view, then needs the view's parent table to run outputProcessing. If getting that table throws for any reason, the original error is replaced with this generic message (the cause is swallowed).
Source
Thrown at packages/server/src/sdk/workspace/rows/search/internal/internal.ts:227
} else {
const tableId = viewInfo.meta!.tableId
const data = await fetchRaw(tableId!)
response = await inMemoryViews.runView(
viewInfo,
calculation as string,
!!group,
data
)
}
let rows: Row[] = []
if (!calculation) {
response.rows = response.rows.map(row => row.doc)
let table: Table
try {
table = await sdk.tables.getTable(viewInfo.meta!.tableId)
} catch (err) {
throw new Error("Unable to retrieve view table.")
}
rows = await outputProcessing(table, response.rows)
}
if (calculation === CALCULATION_TYPES.STATS) {
response.rows = response.rows.map(row => ({
group: row.key,
field,
...row.value,
avg: row.value.sum / row.value.count,
}))
rows = response.rows
}
if (
calculation === CALCULATION_TYPES.COUNT ||
calculation === CALCULATION_TYPES.SUM
) {View on GitHub (pinned to a81a902e9a)
Solutions
- Check the view's meta.tableId and confirm that table still exists
- Recreate the missing table or delete/rebuild the stale view
- Inspect the underlying error (the original cause is lost, so log before this throw if debugging)
- Re-save the view so its meta is regenerated from an existing table
Defensive patterns
Strategy: try-catch
Validate before calling
const view = await sdk.views.get(viewId) await sdk.tables.getTable(view.meta.tableId) // throws early if table missing
Type guard
function hasValidViewMeta(v: View | undefined): v is View & { meta: { tableId: string } } { return !!v && !!v.meta && typeof v.meta.tableId === 'string' } Try / catch
try { rows = await fetchLegacyView(...) } catch (e) { if (e.message.includes('Unable to retrieve view table')) { /* rebuild view or restore table */ } else throw e } Prevention
- Delete views when their source table is deleted
- Validate view meta.tableId resolves before querying
- Rebuild legacy views after app restores/copies
When it happens
Trigger: Querying a legacy (non-calculation) view whose meta.tableId points to a deleted, renamed, or inaccessible table.
Common situations: Table deleted while views remained; app copied/restored without the table doc; permission or replication issues making the table doc unreadable.
Related errors
- View name is required
- Cannot delete rows through a calculation view
- Cannot delete rows through a calculation view
- Legacy view metadata is missing
- View '${viewId}' not found in '${tableId}'
AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29).
Data as JSON: /api/errors/0b606fe6ee673803.
Report an issue: GitHub.