{"record":{"id":"617c43dfeefee0ae","repo":"Budibase/budibase","slug":"litellm-requires-a-database-connection-set-databa","errorCode":null,"errorMessage":"LiteLLM requires a database connection. Set DATABASE_URL on LiteLLM when store_model_in_db is enabled.","messagePattern":"LiteLLM requires a database connection\\. Set DATABASE_URL on LiteLLM when store_model_in_db is enabled\\.","errorType":"http","errorClass":"HTTPError","httpStatus":400,"severity":"error","filePath":"packages/server/src/sdk/workspace/ai/configs/litellm.ts","lineNumber":345,"sourceCode":"    },\n    body: JSON.stringify({\n      litellm_params: {\n        model: `${mappedProvider}/${name}`,\n        custom_llm_provider: mappedProvider,\n        ...credentialFields,\n      },\n    }),\n  }\n\n  const res = await fetch(\n    `${liteLLMUrl}/health/test_connection`,\n    requestOptions\n  )\n\n  if (res.status !== 200) {\n    const text = await res.text()\n    if (text.includes(\"DB not connected\")) {\n      throw new HTTPError(\n        \"LiteLLM requires a database connection. Set DATABASE_URL on LiteLLM when store_model_in_db is enabled.\",\n        400\n      )\n    }\n    throw new HTTPError(text, 500)\n  }\n\n  const json = await res.json()\n  if (json?.status !== \"success\") {\n    const message = [\n      \"Error validating configuration\",\n      sanitizeLiteLLMErrorMessage(json.error?.message || json.result?.error),\n    ]\n      .filter(Boolean)\n      .join(\": \")\n\n    throw new HTTPError(message, 400)\n  }","sourceCodeStart":327,"sourceCodeEnd":363,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/sdk/workspace/ai/configs/litellm.ts#L327-L363","documentation":"Error \"LiteLLM requires a database connection. Set DATABASE_URL on LiteLLM when store_model_in_db is enabled.\" thrown in Budibase/budibase.","triggerScenarios":"Thrown at packages/server/src/sdk/workspace/ai/configs/litellm.ts:345 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}