Budibase/budibase · error · HTTPError

Error activating license key: ${message}

Error message

Error activating license key: ${message}

What it means

Generic failure path of activateLicenseKey: when POST /api/license/activate returns any status other than 200, 403 or 409, the account portal's error message is extracted from the response body and wrapped in this HTTPError. It means activation failed for a reason other than an invalid key (403) or duplicate activation (409).

Source

Thrown at packages/pro/src/sdk/licensing/licenses/client.ts:248

  const response = await api.post(`/api/license/activate`, {
    headers: {
      [constants.Header.LICENSE_KEY]: licenseKey,
    },
    body,
  })

  // don't propagate the 403 to prevent logout
  if (response.status === 403) {
    throw new HTTPError("Invalid license key", 400)
  }

  if (response.status === 409) {
    throw new HTTPError("License key has already been activated", 409)
  }

  if (response.status !== 200) {
    const message = await getResponseErrorMessage(response)
    throw new HTTPError(
      `Error activating license key: ${message}`,
      response.status
    )
  }

  return response.json()
}

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Inspect the embedded `message` for the portal's specific reason.
  2. Check account portal service health/status; retry after transient 5xx.
  3. Ensure the Budibase install version (installVersion sent in the request) is up to date and supported by the portal.
  4. Verify network egress to the account portal URL isn't intercepted by a proxy or firewall returning error pages.

Example fix

// before
await activateLicenseKey(key)
// after
try {
  await activateLicenseKey(key)
} catch (e) {
  if (e instanceof HTTPError && e.status >= 500) {
    await retry(() => activateLicenseKey(key), { retries: 3 })
  } else {
    throw e
  }
}
Defensive patterns

Strategy: retry

Validate before calling

if (!env.INTERNAL_ACCOUNT_PORTAL_URL && !env.ACCOUNT_PORTAL_URL) {
  throw new Error("Account portal URL not configured")
}

Type guard

function isServerError(e: unknown): boolean {
  return e instanceof HTTPError && e.status >= 500
}

Try / catch

try {
  await activateLicenseKey(key)
} catch (e) {
  if (isServerError(e)) {
    await retryWithBackoff(() => activateLicenseKey(key), 3)
  } else throw e
}

Prevention

When it happens

Trigger: Calling activateLicenseKey(licenseKey) and receiving e.g. 400 (malformed body/install info), 401, 429 or 5xx from the account portal.

Common situations: Account portal outage or maintenance window; network proxy returning an unexpected response; install version not supported by the portal (installVersion mismatch); rate limiting during automated activation scripts.

Related errors


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