{"record":{"id":"a7edb22420812eec","repo":"Budibase/budibase","slug":"quotas-do-not-exist-for-plantype-plantype-and-h","errorCode":null,"errorMessage":"Quotas do not exist for planType=${planType} and hosting=${hosting}","messagePattern":"Quotas do not exist for planType=(.+?) and hosting=(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/pro/src/sdk/licensing/licenses/quotas.ts","lineNumber":560,"sourceCode":"      },\n    },\n    constant: {\n      ...quotas.agentLogRetentionDays(UNLIMITED),\n      ...quotas.automationLogRetentionDays(UNLIMITED),\n      ...quotas.appBackupRetentionDays(UNLIMITED),\n    },\n  },\n}\n\nexport function getQuotas(hosting: Hosting, planType: PlanType): Quotas {\n  let defaultQuotas: Quotas\n\n  function readQuotas(planQuotas: PlanQuotas): Quotas {\n    const quotas = planQuotas[planType]\n\n    if (!quotas) {\n      // e.g. Premium plan doesn't exist on self host\n      throw new Error(\n        `Quotas do not exist for planType=${planType} and hosting=${hosting}`\n      )\n    }\n\n    return quotas\n  }\n\n  switch (hosting) {\n    case Hosting.SELF:\n      defaultQuotas = readQuotas(SELF_QUOTAS)\n      break\n    case Hosting.CLOUD:\n      defaultQuotas = readQuotas(CLOUD_QUOTAS)\n      break\n  }\n\n  // always return a deep copy\n  return JSON.parse(JSON.stringify(defaultQuotas))","sourceCodeStart":542,"sourceCodeEnd":578,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/pro/src/sdk/licensing/licenses/quotas.ts#L542-L578","documentation":"readQuotas looks up the quota table for the tenant's planType (e.g. Premium, Team, Free) within a plan-to-quotas map keyed by plan and selected by hosting environment (cloud vs self host). If the plan has no entry for the current hosting configuration — for example a Premium plan lookup against self-host quotas — it throws. It is a guard against plan/hosting combinations the licensing system cannot price.","triggerScenarios":"getQuotas -> readQuotas is called with a planType whose key is absent from planQuotas, e.g. resolving quotas for a Premium plan on a self-hosted install, or a plan/hosting pair removed from the plans table after a version change.","commonSituations":"Self-hosted Budibase where the license plan only exists in the cloud quota matrix; a stale or mismatched license file after upgrading; cloud license being validated on an instance whose HOSTING env does not match where the license was issued.","solutions":["Check the planType in the tenant's license against the hosting environment (self host vs cloud) — Premium and similar paid plans are not available on self host","Upgrade or re-issue the license so it matches the current hosting configuration","Verify the plans/quota definition table in this version of the code includes the planType/hosting pair (a version upgrade may have removed it)","Wrap getQuotas in a try/catch and fall back to the base/free plan quotas for unsupported combinations"],"exampleFix":"// before: blindly reading quotas for the license's plan\nconst quotas = await getQuotas()\n// after: fall back when the plan/hosting combo is unsupported\nlet quotas\ntry {\n  quotas = await getQuotas()\n} catch (err) {\n  if (String(err.message).startsWith(\"Quotas do not exist\")) {\n    quotas = defaultFreeQuotas\n  } else {\n    throw err\n  }\n}","handlingStrategy":"try-catch","validationCode":"const plans = planQuotas[planType]\nif (!plans) console.warn(`No quotas for planType=${planType} on hosting=${hosting}`)","typeGuard":"function hasPlanQuotas(pq: PlanQuotas, planType: string): boolean {\n  return Boolean(pq[planType])\n}","tryCatchPattern":"try {\n  quotas = await getQuotas()\n} catch (err: any) {\n  if (String(err.message).startsWith(\"Quotas do not exist\")) {\n    quotas = fallbackQuotas\n  } else { throw err }\n}","preventionTips":["Match license plan to hosting environment before enabling quota features","After upgrading, verify the license's planType exists in the deployed quota matrix","Maintain a documented fallback quota set for unsupported plan/hosting combos"],"tags":["licensing","self-host","configuration"],"backgroundTag":"plan-hosting-mismatch","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}