{"record":{"id":"06386b5cc2a88336","repo":"Budibase/budibase","slug":"error-activating-license-key-message","errorCode":null,"errorMessage":"Error activating license key: ${message}","messagePattern":"Error activating license key: (.+?)","errorType":"exception","errorClass":"HTTPError","httpStatus":null,"severity":"error","filePath":"packages/pro/src/sdk/licensing/licenses/client.ts","lineNumber":248,"sourceCode":"  const response = await api.post(`/api/license/activate`, {\n    headers: {\n      [constants.Header.LICENSE_KEY]: licenseKey,\n    },\n    body,\n  })\n\n  // don't propagate the 403 to prevent logout\n  if (response.status === 403) {\n    throw new HTTPError(\"Invalid license key\", 400)\n  }\n\n  if (response.status === 409) {\n    throw new HTTPError(\"License key has already been activated\", 409)\n  }\n\n  if (response.status !== 200) {\n    const message = await getResponseErrorMessage(response)\n    throw new HTTPError(\n      `Error activating license key: ${message}`,\n      response.status\n    )\n  }\n\n  return response.json()\n}\n","sourceCodeStart":230,"sourceCodeEnd":256,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/pro/src/sdk/licensing/licenses/client.ts#L230-L256","documentation":"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).","triggerScenarios":"Calling activateLicenseKey(licenseKey) and receiving e.g. 400 (malformed body/install info), 401, 429 or 5xx from the account portal.","commonSituations":"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.","solutions":["Inspect the embedded `message` for the portal's specific reason.","Check account portal service health/status; retry after transient 5xx.","Ensure the Budibase install version (installVersion sent in the request) is up to date and supported by the portal.","Verify network egress to the account portal URL isn't intercepted by a proxy or firewall returning error pages."],"exampleFix":"// before\nawait activateLicenseKey(key)\n// after\ntry {\n  await activateLicenseKey(key)\n} catch (e) {\n  if (e instanceof HTTPError && e.status >= 500) {\n    await retry(() => activateLicenseKey(key), { retries: 3 })\n  } else {\n    throw e\n  }\n}","handlingStrategy":"retry","validationCode":"if (!env.INTERNAL_ACCOUNT_PORTAL_URL && !env.ACCOUNT_PORTAL_URL) {\n  throw new Error(\"Account portal URL not configured\")\n}","typeGuard":"function isServerError(e: unknown): boolean {\n  return e instanceof HTTPError && e.status >= 500\n}","tryCatchPattern":"try {\n  await activateLicenseKey(key)\n} catch (e) {\n  if (isServerError(e)) {\n    await retryWithBackoff(() => activateLicenseKey(key), 3)\n  } else throw e\n}","preventionTips":["Log the embedded message from the portal response for diagnosis.","Implement bounded retries with backoff for 429/5xx only.","Keep the Budibase install version current so the portal accepts installVersion.","Check corporate proxies don't intercept portal traffic."],"tags":["licensing","activation","account-portal","http-error"],"backgroundTag":"license-activation-failed","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}