Budibase/budibase · error · HTTPError
SharePoint is not connected for this operation
Error message
SharePoint is not connected for this operation
What it means
syncSharePointSourcesForOperation looks up the agent's SharePoint knowledge sources attached to the given operationId via getSharePointSourcesForOperation and throws this 400 HTTPError when the operation has no SharePoint sources configured. It is an early guard so sync is not attempted for operations without a SharePoint integration.
Source
Thrown at packages/server/src/sdk/workspace/ai/rag/sources/sharepoint/sharepoint.ts:720
_deleted: true,
}))
if (docsToDelete.length > 0) {
await db.bulkDocs(docsToDelete)
}
}
const runSharePointSourcesForOperation = async (
agentId: string,
operationId: string,
sourceId: string,
signal?: AbortSignal
): Promise<SharePointSyncResult> => {
const lastRunAt = new Date().toISOString()
const agent = await agentsSdk.getOrThrow(agentId)
const sharepointSources = getSharePointSourcesForOperation(agent, operationId)
if (sharepointSources.length === 0) {
throw new HTTPError("SharePoint is not connected for this operation", 400)
}
const knowledgeSource = getSharePointSourcesForOperation(
agent,
operationId
).find(source => source.id === sourceId)
const site = knowledgeSource?.config.site
const sourceDatasourceId = knowledgeSource?.config.datasourceId
const sourceAuthConfigId = knowledgeSource?.config.authConfigId
if (!site) {
throw new HTTPError(
"Specified SharePoint site is not connected for this operation",
400
)
}
const siteId = site.id
const sourceScope = knowledgeSource?.config.scopeView on GitHub (pinned to a81a902e9a)
Solutions
- Add a SharePoint knowledge source to the agent operation before triggering sync
- Confirm the operationId belongs to the agent you are syncing (agentsSdk.getOrThrow + inspect its knowledge sources)
- Re-check the agent document for concurrent edits that removed the source
- Use the agent-level sync entry point which resolves the operationId from sourceId instead
Defensive patterns
Strategy: validation
Validate before calling
const agent = await agentsSdk.getOrThrow(agentId)
const sources = getSharePointSourcesForOperation(agent, operationId)
if (sources.length === 0) {
throw new Error(`Operation ${operationId} has no SharePoint sources`)
} Type guard
const hasSharePointSources = (agent: Agent, operationId: string): boolean => getSharePointSourcesForOperation(agent, operationId).length > 0
Try / catch
try {
await syncSharePointSourcesForOperation(agentId, operationId, sourceId)
} catch (err) {
if (err instanceof HTTPError && err.status === 400 && err.message === "SharePoint is not connected for this operation") {
// prompt user to connect a SharePoint source before syncing
} else { throw err }
} Prevention
- Only expose the sync action in UI when a SharePoint source is connected
- Verify the operationId matches the agent before syncing
- Watch for concurrent deletes of the source
- Prefer agent-level sync that resolves operationId from sourceId
When it happens
Trigger: Calling the sync API (e.g. syncSharePointSourcesForOperation or a route that reaches it) with an operationId that has no SharePoint knowledge source entries on the agent document.
Common situations: Sync triggered before the SharePoint source was saved on the agent; operationId typo or an operation from a different agent; the SharePoint source was deleted by another user before sync ran.
Related errors
- SharePoint is not connected for this operation
- No Microsoft datasource configuration found
- SharePoint site is not connected for this operation
- SharePoint is not connected for this workspace
- Specified SharePoint site is not connected for this operatio
AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29).
Data as JSON: /api/errors/361eeef70776a933.
Report an issue: GitHub.