Budibase/budibase · error · HTTPError

${payload.error}

Error message

${payload.error}

What it means

When the LiteLLM rag/ingest response has status "failed" with an error that is not the recognized 403/404 fileSearchStores patterns, ingestGeminiFile throws HTTPError 500 with the raw upstream error string. This is a catch-all for Gemini ingest failures not otherwise classified.

Source

Thrown at packages/server/src/sdk/workspace/ai/knowledgeBase/geminiFileStore.ts:248

  const payload = (await response.json()) as RagIngestResponse
  if (payload.status === "failed" && payload.error) {
    console.error("Gemini ingest failed", { error: payload.error })
    if (payload.error.includes("fileSearchStores")) {
      if (payload.error.includes("403")) {
        throw new HTTPError(
          "Gemini file store is inaccessible (403 Forbidden). Use 'Reset store' to recreate it.",
          403
        )
      }
      if (payload.error.includes("404")) {
        throw new HTTPError(
          "Gemini file store was not found (404). Use 'Reset store' to recreate it.",
          404
        )
      }
    }
    throw new HTTPError(payload.error, 500)
  }
  if (!payload.file_id) {
    throw new HTTPError("Gemini ingest did not return file_id", 500)
  }
  return {
    fileId: payload.file_id,
  }
}

export async function searchGeminiFileStore({
  vectorStoreId,
  query,
}: {
  vectorStoreId: string
  query: string
}): Promise<RagSearchResultItem[]> {
  const geminiApiKey = getGeminiApiKey()
  const sessionId = getLiteLLMSessionId()

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Read payload.error in the thrown message/logs for the underlying Gemini cause
  2. Retry the upload for transient errors
  3. Check file format/size against Gemini File Search limits and re-upload a supported file
  4. If it is a 403/404 in disguise (message format changed), reset the store
Defensive patterns

Strategy: retry

Validate before calling

// validate inputs before ingest
if (!buffer?.byteLength) throw new Error("Empty file")
if (mimetype && !SUPPORTED_GEMINI_TYPES.has(mimetype)) throw new Error(`Unsupported type: ${mimetype}`)

Try / catch

try {
  await ingestGeminiFile({ vectorStoreId, ... })
} catch (e) {
  if (e instanceof HTTPError && e.status === 500) {
    console.error("Gemini ingest error:", e.message) // raw upstream error
    await retryWithBackoff(() => ingestGeminiFile({ ... }), 3)
  }
}

Prevention

When it happens

Trigger: Upstream ingest reports failed with any error other than the fileSearchStores/403/404 patterns — e.g. unsupported file type, file too large, content processing error, quota/permission errors phrased differently.

Common situations: Ingesting a corrupt or unsupported document; Gemini file size limits exceeded; transient Gemini processing failure; LiteLLM error format changed so the 403/404 classifiers no longer match.

Related errors


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