Budibase/budibase · warning · HTTPError

Config id "${configId}" not found

Error message

Config id "${configId}" not found

What it means

Thrown by createLLM when a configId is provided but sdk.ai.configs.find(configId) returns nothing — the id is well-formed but no AI config with that id exists in the workspace. HTTPError 422 includes the offending id in the message.

Source

Thrown at packages/server/src/sdk/workspace/ai/llm/index.ts:24

import { createBBAIClient } from "./bbai"
import { createLiteLLMOpenAI } from "./litellm"

export * as bbai from "./bbai"
export * from "./utils"
export * from "./messages"

export async function createLLM(
  configId: string,
  sessionId?: string,
  span?: tracer.Span,
  agentId?: string
): Promise<LLMResponse> {
  if (!configId) {
    throw new HTTPError("Config id not found", 422)
  }
  const aiConfig = await sdk.ai.configs.find(configId)
  if (!aiConfig) {
    throw new HTTPError(`Config id "${configId}" not found`, 422)
  }

  if (aiConfig.provider === BUDIBASE_AI_PROVIDER_ID) {
    await quotas.throwIfBudibaseAICreditsExceeded()
  }

  if (aiConfig.provider === BUDIBASE_AI_PROVIDER_ID && !env.SELF_HOSTED) {
    return createBBAIClient(
      aiConfig.model,
      sessionId,
      span,
      aiConfig.reasoningEffort,
      agentId
    )
  }

  return createLiteLLMOpenAI(aiConfig, sessionId, span, agentId)
}

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Confirm the config id in the error message exists in THIS workspace's AI configurations
  2. Recreate the AI config and update all references (automations, app definitions) with the new id
  3. If migrating environments, re-link AI configs after import rather than copying ids
  4. Check you are operating on the intended app/tenant — ids are workspace-scoped

Example fix

// before: id copied across environments
const configId = "prod-config-id"
// after: resolve per environment
const config = (await sdk.ai.configs.fetch()).find(c => c.name === "my-agent")
await createLLM(config!._id!, sessionId)
Defensive patterns

Strategy: validation

Validate before calling

const config = await sdk.ai.configs.find(configId)
if (!config) {
  throw new HTTPError(`AI config "${configId}" does not exist in this workspace`, 422)
}

Try / catch

try {
  await createLLM(configId, sessionId)
} catch (e) {
  if (e instanceof HTTPError && /^Config id ".*" not found$/.test(e.message)) {
    const configs = await sdk.ai.configs.fetch()
    return { error: `Unknown AI config; available: ${configs.map(c => c.name).join(", ")}` }
  }
  throw e
}

Prevention

When it happens

Trigger: Chat/agent/reviewer flows referencing an AI config id that was deleted, belongs to a different workspace/app, or was copied from another environment (prod id used in dev, or vice versa).

Common situations: Exporting/importing apps between environments where AI config ids are not preserved; automation JSON copied across apps; config deleted while automations still reference it; database restore from a different workspace.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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