Budibase/budibase · error · Error

Deployment Failed: ${message}

Error message

Deployment Failed: ${message}

What it means

Generic deployment failure wrapper in publishWorkspaceInternal. Any error thrown by syncStaticFormulasToProduction is caught, the deployment is marked FAILURE with the underlying message, history is stored, and a new Error("Deployment Failed: <message>") is thrown with the original as cause. It standardizes publish failures surfaced to the caller.

Source

Thrown at packages/server/src/api/controllers/deploy/index.ts:558

        await initDeployedApp(prodId)

        return { app: appDoc, prodWorkspaceId: prodId }
      } finally {
        if (replication) {
          await replication.close()
        }
      }
    })
  } catch (error: unknown) {
    const message =
      error instanceof Error
        ? error.message
        : typeof error === "string"
          ? error
          : "Unknown error"
    deployment.setStatus(DeploymentStatus.FAILURE, message)
    await storeDeploymentHistory(deployment)
    throw new Error(`Deployment Failed: ${message}`, { cause: error })
  }

  try {
    await syncStaticFormulasToProduction(migrationResult.prodWorkspaceId)
  } catch (error: unknown) {
    const message =
      error instanceof Error
        ? error.message
        : typeof error === "string"
          ? error
          : "Unknown error"
    deployment.setStatus(DeploymentStatus.FAILURE, message)
    await storeDeploymentHistory(deployment)
    throw new Error(`Deployment Failed: ${message}`, { cause: error })
  }

  deployment.setStatus(DeploymentStatus.SUCCESS)
  await storeDeploymentHistory(deployment)

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Inspect error.cause / deployment history to see the underlying sync failure
  2. Verify the prod workspace DB exists and CouchDB is healthy
  3. Re-run the publish; static formula sync can be retried
  4. Check static formula definitions in the app for malformed entries
  5. Scale/verify CouchDB resources if writes are timing out on large apps
Defensive patterns

Strategy: retry

Validate before calling

await api.get(`/health`) // confirm server & CouchDB reachable before publishing
const apps = await api.get("/api/applications")
if (!apps.some(a => a.appId === appId)) throw new Error("app missing")

Try / catch

try {
  await api.post(`/api/applications/${appId}/publish`)
} catch (err) {
  if (err.message.startsWith("Deployment Failed")) {
    const cause = err.cause?.message ?? err.message
    console.error("Publish failed at:", cause)
    // inspect deployment history, fix root cause, retry
  } else { throw err }
}

Prevention

When it happens

Trigger: The second catch block in publishWorkspaceInternal fires when syncStaticFormulasToProduction(prodWorkspaceId) rejects — DB write failures on the prod workspace, missing prod DB, or formula sync exceptions.

Common situations: Prod workspace DB unavailable or locked; static formula definitions malformed after migration; CouchDB write conflicts; resource limits hit during a large publish.

Related errors


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