supabase/supabase · error · Error
Failed to fetch full values for truncated cells
Error message
Failed to fetch full values for truncated cells
What it means
Thrown in onCopyRows when hydrateTruncatedRows (a server query that fetches full values for cells whose displayed value was truncated) returns a non-'ok' status. This only fires for tables that have truncated string values AND a primary key (tables without a PK are blocked earlier with a dedicated toast). The error indicates the on-demand fetch of full cell values failed.
Source
Thrown at apps/studio/components/grid/components/header/Header.tsx:249
A selected row has a column value that needs to be fetched on demand due to its size,
but the table has no primary key.
</p>
</div>,
{ duration: 8000 }
)
}
setIsCopying(true)
const formatted = (async () => {
const hydrated = await hydrateTruncatedRows({
rows: selected,
table: snap.table,
projectRef: project.ref,
connectionString: project.connectionString ?? null,
roleImpersonationState: roleImpersonationState as RoleImpersonationState,
})
if (hydrated.status !== 'ok') {
throw new Error('Failed to fetch full values for truncated cells')
}
const rows = hydrated.rows
if (type === 'csv') {
return formatRowsForCSV({
rows,
columns: snap.table!.columns.map((column) => column.name),
})
} else if (type === 'sql') {
return formatTableRowsToSQL(snap.table, rows)
} else {
return JSON.stringify(rows)
}
})()
copyToClipboard(formatted, () => toast.success('Copied rows to clipboard')).finally(() => {
setIsCopying(false)
})
}View on GitHub (pinned to beee91b9c2)
Solutions
- Retry the copy — transient DB/network errors often resolve on the second attempt.
- If using role impersonation, switch to a role with SELECT on the truncated columns and retry.
- Verify the project is not paused and the database is reachable.
- As a workaround, run a direct SELECT in the SQL editor for the specific primary keys to fetch full values manually.
Example fix
// before
const hydrated = await hydrateTruncatedRows({ rows: selected, table: snap.table, projectRef, connectionString, roleImpersonationState })
if (hydrated.status !== 'ok') {
throw new Error('Failed to fetch full values for truncated cells')
}
// after — surface the underlying failure reason
if (hydrated.status !== 'ok') {
toast.error(`Failed to fetch full values for truncated cells: ${hydrated.error?.message ?? 'unknown error'}`)
return
} Defensive patterns
Strategy: try-catch
Validate before calling
// Pre-check: only attempt hydration when there are truncated cells and a usable PK
const canHydrate = snap.table.primaryKey && snap.table.primaryKey.length > 0 && selected.some((r) => Object.values(r).some((v) => typeof v === 'string' && isValueTruncated(v)))
if (!canHydrate) { /* skip hydration / warn user */ } Type guard
function isHydrateOk(r: unknown): r is { status: 'ok'; rows: any[] } {
return typeof r === 'object' && r !== null && (r as any).status === 'ok'
} Try / catch
copyToClipboard((async () => {
const hydrated = await hydrateTruncatedRows({ ... })
if (hydrated.status !== 'ok') {
toast.error(`Failed to fetch full values: ${(hydrated as any).error?.message ?? 'unknown'}`)
return null
}
return formatRowsForCSV({ rows: hydrated.rows, columns: snap.table!.columns.map((c) => c.name) })
})(), () => toast.success('Copied')) Prevention
- Ensure the table has a primary key before offering copy of truncated rows.
- Retry transient hydration failures before giving up.
- Surface the underlying hydrate error reason to the user instead of a generic message.
When it happens
Trigger: User selects rows containing truncated (oversized) cell values and copies them as CSV/JSON/SQL; the hydrate query to fetch full values by primary key fails (DB error, timeout, connection issue, or role-impersonation conflict).
Common situations: Large text/jsonb columns whose display is truncated; network blip or DB load during the hydration query; role impersonation or RLS blocking the select; connectionString stale; project paused.
Related errors
- Failed to get table schema
- Failed to get table schema
- Failed to get ${label} definition
- Failed to reveal secret API key
- Failed to generate completion
AI-assisted analysis of supabase/supabase@beee91b9c2 (2026-08-12).
Data as JSON: /api/errors/94d5b92f5eccdbfe.
Report an issue: GitHub.