{"record":{"id":"4c0ce118c3371d46","repo":"Budibase/budibase","slug":"datasource-is-not-configured-fully","errorCode":null,"errorMessage":"Datasource is not configured fully.","messagePattern":"Datasource is not configured fully\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/server/src/sdk/workspace/tables/getters.ts","lineNumber":272,"sourceCode":"    const [internal, external] = await Promise.all([\n      getAllInternalTables(),\n      getAllExternalTables(),\n    ])\n    span.addTags({\n      numInternalTables: internal.length,\n      numExternalTables: external.length,\n    })\n    return await processTables([...internal, ...external])\n  })\n}\n\nexport async function getExternalTablesInDatasource(\n  datasourceId: string\n): Promise<Record<string, Table>> {\n  return await tracer.trace(\"getExternalTablesInDatasource\", async span => {\n    const datasource = await datasources.get(datasourceId, { enriched: true })\n    if (!datasource || !datasource.entities) {\n      throw new Error(\"Datasource is not configured fully.\")\n    }\n    span.addTags({\n      datasourceId,\n      numEntities: Object.keys(datasource.entities).length,\n    })\n    return await processEntities(datasource.entities)\n  })\n}\n\nexport async function getTables(tableIds: string[]): Promise<Table[]> {\n  return tracer.trace(\"getTables\", async span => {\n    span.addTags({ numTableIds: tableIds.length })\n    const externalTableIds = tableIds.filter(tableId =>\n        isExternalTableID(tableId)\n      ),\n      internalTableIds = tableIds.filter(tableId => !isExternalTableID(tableId))\n    let tables: Table[] = []\n    if (externalTableIds.length) {","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/sdk/workspace/tables/getters.ts#L254-L290","documentation":"getExternalTablesInDatasource loads the datasource document with enriched entities (tables extracted by the connector). If the datasource doesn't exist or its entities were never fetched/attached, the datasource is unusable for table operations, so it throws.","triggerScenarios":"Calling getExternalTablesInDatasource (directly or via getExternalTable) with a datasourceId whose document is missing, deleted, or has no entities — e.g. a datasource created but never fetched/synced, or an app whose datasource config failed.","commonSituations":"Connecting a datasource without completing the fetch/sync step; datasource deleted while app pages still reference it; invalid credentials preventing entity extraction; environment misconfiguration for the SQL connection.","solutions":["Verify the datasourceId is valid and the datasource document exists","Complete the datasource connection flow so entities are fetched and attached","Check datasource credentials/connectivity and re-sync","Delete and recreate the datasource if its configuration is corrupt"],"exampleFix":"// before\nawait tables.external.getExternalTablesInDatasource(unsyncedDsId)\n// after\nconst ds = await datasources.get(unsyncedDsId)\nif (!ds?.entities) {\n  await datasources.update({ ...ds, entities: await fetchEntities(ds) })\n}\nawait tables.external.getExternalTablesInDatasource(unsyncedDsId)","handlingStrategy":"validation","validationCode":"const ds = await datasources.get(datasourceId, { enriched: true })\nif (!ds || !ds.entities) throw new Error(\"Datasource missing or not synced\")","typeGuard":"function isConfigured(ds: Datasource | undefined): ds is Datasource & { entities: Record<string, Table> } {\n  return !!ds && !!ds.entities\n}","tryCatchPattern":"try {\n  const entities = await tables.external.getExternalTablesInDatasource(datasourceId)\n} catch (err) {\n  if (err.message === \"Datasource is not configured fully.\") {\n    // re-fetch/sync the datasource or recreate it\n  }\n}","preventionTips":["Complete the datasource connect/fetch flow before reading tables","Verify credentials and connectivity for the SQL source","Guard against using datasource IDs from deleted documents"],"tags":["external-datasource","missing-config","sync"],"backgroundTag":"datasource-not-configured","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}