Budibase/budibase · error · HTTPError

This SharePoint source uses an outdated configuration. Delet

Error message

This SharePoint source uses an outdated configuration. Delete and reconnect it to continue syncing.

What it means

The sync path requires the knowledge source's scope to have mode ALL or SELECTED. If config.scope is missing or its mode is not one of these two recognized values, this 400 HTTPError is thrown and the user is told to delete and reconnect the source, because the saved scope predates the current scope schema and cannot be interpreted.

Source

Thrown at packages/server/src/sdk/workspace/ai/rag/sources/sharepoint/sharepoint.ts:744

  ).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.scope
  if (
    !sourceScope ||
    (sourceScope.mode !== SharePointScopeMode.ALL &&
      sourceScope.mode !== SharePointScopeMode.SELECTED)
  ) {
    throw new HTTPError(
      "This SharePoint source uses an outdated configuration. Delete and reconnect it to continue syncing.",
      400
    )
  }

  console.log("Starting SharePoint sync for agent", {
    agentId,
    sourceId: sourceId,
    siteId,
    runAt: lastRunAt,
    sourceScope,
  })
  throwIfSyncAborted(signal)

  if (!sourceDatasourceId || !sourceAuthConfigId) {
    throw new HTTPError("SharePoint is not connected for this workspace", 400)
  }
  const bearerToken = await getSharePointBearerToken(

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Delete the SharePoint knowledge source and reconnect it (as the error states) so it saves the current scope schema
  2. Re-save the source's scope in the builder to refresh config.scope to mode ALL or SELECTED
  3. Check the agent document and rewrite config.scope to { mode: "all" } or { mode: "selected", targets: [...] } if direct DB fix is acceptable
  4. Upgrade the agent creation code path so new sources always persist a valid scope

Example fix

// before (legacy saved config)
{ id: "ks_1", config: { site: {...}, datasourceId: "ds", authConfigId: "ac" } }
// after (reconnect/re-save with current schema)
{ id: "ks_1", config: { site: {...}, datasourceId: "ds", authConfigId: "ac", scope: { mode: "selected", targets: [{ type: "drive", driveId: "b!abc" }] } } }
Defensive patterns

Strategy: validation

Validate before calling

const scope = source?.config?.scope
if (!scope || (scope.mode !== "all" && scope.mode !== "selected")) {
  throw new Error("Source scope uses an outdated schema; reconnect required")
}

Type guard

const hasValidScope = (
  source: AgentSharePointKnowledgeSource | undefined
): source is AgentSharePointKnowledgeSource & {
  config: { scope: AgentSharePointKnowledgeSourceScope }
} =>
  source?.config?.scope?.mode === SharePointScopeMode.ALL ||
  source?.config?.scope?.mode === SharePointScopeMode.SELECTED

Try / catch

try {
  await syncSharePointSourceForAgent(agentId, sourceId)
} catch (err) {
  if (err instanceof HTTPError && err.status === 400 && err.message.includes("outdated configuration")) {
    // show reconnect flow to the user
  } else { throw err }
}

Prevention

When it happens

Trigger: Syncing a source whose saved config has no scope or a legacy scope.mode value (anything other than 'all' or 'selected') — typically a source created before the scope-mode format was introduced.

Common situations: Upgraded deployment with old agent documents; source saved by an older builder version; manually patched agent config; partial migration of knowledge-source schema.

Related errors


AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29). Data as JSON: /api/errors/b58076e62c428095. Report an issue: GitHub.