Budibase/budibase · error · Error
Escalation ${escalationId} not found
Error message
Escalation ${escalationId} not found What it means
resolveWithRetry loads the escalation context doc (escalation context/{escalationId}) from the workspace DB when resolving an escalation. If the document doesn't exist it throws immediately — there is nothing to resolve. Note the retry loop only retries document-conflict (409) writes; a missing doc is a permanent failure on every attempt.
Source
Thrown at packages/server/src/escalation/processors/bull.ts:130
escalationId: string,
response?: EscalationResponse
): Promise<void> {
await this.resolveWithRetry(escalationId, response)
}
private async resolveWithRetry(
escalationId: string,
response?: EscalationResponse,
maxRetries = 3
): Promise<void> {
const db = context.getWorkspaceDB()
const docId = getDocId(escalationId)
for (let attempt = 0; attempt < maxRetries; attempt++) {
const doc = await db.tryGet<EscalationContextDoc>(docId)
if (!doc) {
throw new Error(`Escalation ${escalationId} not found`)
}
if (doc.resolution !== "pending") {
// Another writer already resolved it - nothing to do
return
}
const now = new Date().toISOString()
try {
await db.put({
...doc,
resolution: "resolved",
resolvedAt: now,
updatedAt: now,
...(response && { response }),
})
} catch (err) {
if (dbCore.isDocumentConflictError(err) && attempt < maxRetries - 1) {View on GitHub (pinned to a81a902e9a)
Solutions
- Check the escalationId and ensure the code runs inside the correct workspace/tenant context (doInWorkspace/doInTenant) so the right DB is queried.
- Verify the escalation still exists: query the workspace DB for doc id escalation context/{escalationId} before resolving.
- If the doc was already cleaned up, treat the resolution as no-op instead of erroring (guard the call with try/catch or an existence check).
- If doc purges are causing this, extend the escalation context doc retention period.
Example fix
// before
await processor.resolve(escalationId, response) // throws if doc purged
// after
try {
await processor.resolve(escalationId, response)
} catch (err) {
if (!/not found$/.test(err.message)) throw err // already gone: ignore
} Defensive patterns
Strategy: try-catch
Validate before calling
const docId = `escalation context${SEPARATOR}${escalationId}`
const exists = !!(await workspaceDb.tryGet(docId))
if (!exists) return // already resolved or purged — nothing to do Try / catch
try {
await processor.resolve(escalationId, response)
} catch (err) {
if (err.message.endsWith("not found")) {
console.warn("Escalation already gone, ignoring", { escalationId })
return
}
throw err
} Prevention
- Always resolve escalations within the correct workspace/tenant context
- Treat 'not found' as an idempotent no-op for card-based Approve/Reject flows
- Extend context doc retention if escalations can outlive cleanup windows
- Verify escalationIds come from the same app's logs/DB
When it happens
Trigger: Calling resolve(escalationId) with an ID that was never created, one whose context doc was deleted (cleanup/TTL purge), an ID from a different workspace/tenant DB, or a typo'd ID.
Common situations: Double-clicking an Approve/Reject card after the escalation doc was pruned; resolving an escalation after a test run cleaned up context docs; tenant context not established so getWorkspaceDB() points at the wrong DB; resuming with an escalationId copied from logs of another app.
Related errors
- DB does not exist
- CouchDB error: ${err.message}
- Unable to retrieve user list
- ${err.message}
- Unable to get bulk documents: ${missingIds}
AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29).
Data as JSON: /api/errors/f165026795acd155.
Report an issue: GitHub.