{"record":{"id":"ede05e49485a4d46","repo":"Budibase/budibase","slug":"no-budibase-url-found","errorCode":null,"errorMessage":"No Budibase URL found","messagePattern":"No Budibase URL found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/server/src/sdk/workspace/ai/llm/bbai.ts","lineNumber":269,"sourceCode":"\n        if (!response.ok) {\n          throw await HTTPError.fromResponse(response)\n        }\n\n        const result = await response.json()\n        if (typeof result.id !== \"string\") {\n          throw new Error(\"File id not found\")\n        }\n        return unwrapLiteLLMFileId(result.id)\n      } else {\n        const fileBuffer = Buffer.from(await fileBlob.arrayBuffer())\n        const base64 = fileBuffer.toString(\"base64\")\n\n        if (isImage) {\n          return `data:${type};base64,${base64}`\n        }\n        if (!env.BUDICLOUD_URL) {\n          throw new Error(\"No Budibase URL found\")\n        }\n        const licenseKey = await licensing.keys.getLicenseKey()\n        if (!licenseKey) {\n          throw new Error(\"No license key found\")\n        }\n\n        const response = await fetch(\n          `${env.BUDICLOUD_URL}/api/ai/upload-file`,\n          {\n            method: \"POST\",\n            headers: {\n              \"Content-Type\": \"application/json\",\n              [constants.Header.LICENSE_KEY]: licenseKey,\n            },\n            body: JSON.stringify({\n              data: base64,\n              filename,\n              contentType: type,","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/sdk/workspace/ai/llm/bbai.ts#L251-L287","documentation":"Thrown when converting a file to base64 for upload via the Budibase Cloud AI file-upload endpoint, but env.BUDICLOUD_URL is not set. File uploads through Budibase AI (non-image, or images routed through cloud) require the cloud upload service, so without the URL the operation cannot proceed.","triggerScenarios":"createBBAIClient attempts to upload a non-image file (or file requiring cloud path) while BUDICLOUD_URL is missing from the environment — typical in self-hosted installations without a Budibase Cloud license endpoint configured.","commonSituations":"Self-hosted deployments that never set BUDICLOUD_URL; cloud URL configured on server but not on the service performing the upload (worker); typos like BUDI_CLOUD_URL.","solutions":["Set BUDICLOUD_URL to your Budibase Cloud endpoint in the environment of the service performing the upload","Confirm the variable name is exactly BUDICLOUD_URL (no underscores)","Restart the service after adding the env var","If you do not use cloud file upload, avoid attaching files to Budibase AI chat/agents"],"exampleFix":"# before: .env missing cloud url\nLITELLM_URL=http://litellm:4000\n# after\nBUDICLOUD_URL=https://cloud.budibase.com\nLITELLM_URL=http://litellm:4000","handlingStrategy":"validation","validationCode":"if (!env.BUDICLOUD_URL) {\n  throw new Error(\"BUDICLOUD_URL must be set to upload files via Budibase AI\")\n}","typeGuard":null,"tryCatchPattern":"try {\n  await uploadToCloud(file)\n} catch (e) {\n  if (e.message === \"No Budibase URL found\") {\n    return { error: \"File upload unavailable: Budibase Cloud is not configured\" }\n  }\n  throw e\n}","preventionTips":["Set BUDICLOUD_URL (exact spelling) in every backend service env","Add a config validation step at boot listing required AI-related env vars","Disable file-attachment features in UI/config when cloud upload is unavailable"],"tags":["configuration","environment-variable","budibase-cloud","file-upload"],"backgroundTag":"missing-env-var","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}