Budibase/budibase · error · HTTPError
Datasource has not been configured for plus API.
Error message
Datasource has not been configured for plus API.
What it means
exportRows fetches the datasource and checks that it exists and has configured entities (`datasource.entities`). Plus (REST/SQL connector) APIs need entity definitions to run queries; if missing, the export cannot proceed and a 400 is thrown.
Source
Thrown at packages/server/src/sdk/workspace/rows/search/external.ts:215
requestQuery = {
oneOf: {
_id: rowIds.map((row: string) => {
const ids = breakRowIdField(row)
if (ids.length > 1) {
return ids
}
return ids[0]
}),
},
}
} else {
requestQuery = query || {}
}
const datasource = await sdk.datasources.get(datasourceId)
const table = await sdk.tables.getTable(tableId)
if (!datasource || !datasource.entities) {
throw new HTTPError("Datasource has not been configured for plus API.", 400)
}
let result = await search(
{ tableId: table._id!, query: requestQuery, sort, sortOrder },
table
)
let rows: Row[] = []
let headers
// Filter data to only specified columns if required
if (columns && columns.length) {
for (let i = 0; i < result.rows.length; i++) {
rows[i] = {}
for (let column of columns) {
rows[i][column] = result.rows[i][column]
}
}
headers = columnsView on GitHub (pinned to a81a902e9a)
Solutions
- Re-fetch/sync the datasource so its entities are populated
- Confirm the datasourceId belongs to a configured plus datasource in this app
- Recreate the datasource if the entities document is missing/corrupt
- Verify the table exists under datasource.entities before exporting
Example fix
// before
await sdk.rows.exportRows({ tableId }) // datasource never fetched schema
// after
const ds = await sdk.datasources.get(datasourceId)
if (!ds?.entities) await sdk.datasources.sync(datasourceId)
await sdk.rows.exportRows({ tableId }) Defensive patterns
Strategy: validation
Validate before calling
const ds = await sdk.datasources.get(datasourceId)
if (!ds || !ds.entities || !Object.keys(ds.entities).length) throw new Error('Datasource entities not configured - run sync') Type guard
function isConfiguredDatasource(ds: Datasource | undefined): ds is Datasource & { entities: Record<string, TableSchema> } { return !!ds && !!ds.entities && Object.keys(ds.entities).length > 0 } Try / catch
try { await sdk.rows.exportRows(opts) } catch (e) { if (e.message.includes('not been configured for plus API')) { await sdk.datasources.sync(datasourceId) } else throw e } Prevention
- Always sync new plus datasources before querying
- Check entities exist after datasource creation
- Guard against referencing datasources from other apps
When it happens
Trigger: Calling exportRows where datasourceId resolves to a datasource with no `entities` map — a plus datasource that was created but never had its tables/schema fetched, or a deleted/corrupt datasource document.
Common situations: REST connector configured without running the schema fetch step; datasource doc corrupted or partially migrated; pointing at a datasourceId from a different app; a non-plus datasource mistakenly used with the plus export path.
Related errors
AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29).
Data as JSON: /api/errors/4ea30ab3e4d3f348.
Report an issue: GitHub.