{"record":{"id":"65fa51a679d02e19","repo":"mastra-ai/mastra","slug":"mastra-auth-ee-featurelist-configuredfeatur","errorCode":null,"errorMessage":"[mastra/auth-ee] ${featureList} ${configuredFeatures.length === 1 ? 'is' : 'are'} configured but no valid EE license was found.\n${featureList} ${configuredFeatures.length === 1 ? 'requires' : 'require'} a Mastra Enterprise License for production use.\nSet the MASTRA_EE_LICENSE environment variable with your license key.\nLearn more: https://github.com/mastra-ai/mastra/blob/main/ee/LICENSE","messagePattern":"\\[mastra/auth-ee\\] (.+?) (.+?) configured but no valid EE license was found\\.\n(.+?) (.+?) a Mastra Enterprise License for production use\\.\nSet the MASTRA_EE_LICENSE environment variable with your license key\\.\nLearn more: https://github\\.com/mastra-ai/mastra/blob/main/ee/LICENSE","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/server/src/server/server-adapter/index.ts","lineNumber":852,"sourceCode":"   * Validate that EE features have a valid license in production.\n   * Throws if RBAC or FGA is configured without a valid license outside dev/test environments.\n   */\n  async validateEELicense(): Promise<void> {\n    const serverConfig = this.mastra.getServer();\n    const studioConfig = this.mastra.getStudio?.();\n    // Check both server and studio configs for EE features\n    const configuredFeatures = [\n      serverConfig?.rbac || studioConfig?.rbac ? 'RBAC' : null,\n      serverConfig?.fga || studioConfig?.fga ? 'FGA' : null,\n    ].filter((feature): feature is string => feature !== null);\n\n    if (configuredFeatures.length === 0) return;\n\n    try {\n      const { isEEEnabled } = await import('@mastra/core/auth/ee');\n      if (!isEEEnabled()) {\n        const featureList = configuredFeatures.join(' and ');\n        throw new Error(\n          `[mastra/auth-ee] ${featureList} ${configuredFeatures.length === 1 ? 'is' : 'are'} configured but no valid EE license was found.\\n` +\n            `${featureList} ${configuredFeatures.length === 1 ? 'requires' : 'require'} a Mastra Enterprise License for production use.\\n` +\n            'Set the MASTRA_EE_LICENSE environment variable with your license key.\\n' +\n            'Learn more: https://github.com/mastra-ai/mastra/blob/main/ee/LICENSE',\n        );\n      }\n    } catch (err) {\n      if (err instanceof Error && err.message.startsWith('[mastra/auth-ee]')) {\n        throw err;\n      }\n      // @mastra/core/auth/ee module not available; EE authorization cannot function.\n      throw new Error(\n        `[mastra/auth-ee] ${configuredFeatures.join(' and ')} ${configuredFeatures.length === 1 ? 'is' : 'are'} configured but the EE module (@mastra/core/auth/ee) could not be loaded.\\n` +\n          'Ensure @mastra/core is updated to a version that includes EE support.',\n      );\n    }\n  }\n","sourceCodeStart":834,"sourceCodeEnd":870,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/server-adapter/index.ts#L834-L870","documentation":"Startup/ configuration error from the server adapter's EE gate: one or more enterprise features are configured (featureList), but isEEEnabled() from @mastra/core/auth/ee reports no valid EE license (typically no/invalid MASTRA_EE_LICENSE). Mastra blocks boot rather than silently running licensed features without a license.","triggerScenarios":"Configuring any EE feature (checked in server-adapter, e.g. EE authorization options) while isEEEnabled() returns false because MASTRA_EE_LICENSE is unset, expired, malformed, or not visible to the process environment.","commonSituations":"Deploying with EE auth config copied from another project without the license env var; license key present locally but missing in the deployment's environment variables; expired trial/enterprise license; running features in dev that require enterprise licensing.","solutions":["Set the MASTRA_EE_LICENSE environment variable to a valid license key in the environment where the server runs.","Verify the env var actually reaches the process (docker-compose env, k8s secret, .env loaded before boot).","Check license validity/expiry with the license issuer and renew if expired.","If you don't need the feature, remove the EE feature configuration so the gate passes."],"exampleFix":"// before\nnew MastraServer({ mastra, ee: { authorization: {...} } }); // no MASTRA_EE_LICENSE\n\n// after\n// .env\n// MASTRA_EE_LICENSE=eyJhbGciOi...\nnew MastraServer({ mastra, ee: { authorization: {...} } });","handlingStrategy":"validation","validationCode":"const license = process.env.MASTRA_EE_LICENSE;\nif (!license || license.trim() === '') {\n  throw new Error('EE features are configured but MASTRA_EE_LICENSE is not set; set a valid license key before booting the server');\n}","typeGuard":"function hasEeLicense(env: NodeJS.ProcessEnv): env is NodeJS.ProcessEnv & { MASTRA_EE_LICENSE: string } {\n  return typeof env.MASTRA_EE_LICENSE === 'string' && env.MASTRA_EE_LICENSE.trim().length > 0;\n}","tryCatchPattern":"try {\n  await startServer(mastra);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('no valid EE license was found')) {\n    console.error('EE license missing/invalid: set MASTRA_EE_LICENSE or remove EE feature config.');\n    process.exitCode = 1;\n    return;\n  }\n  throw e;\n}","preventionTips":["Add MASTRA_EE_LICENSE to every deployment environment's secret manager and verify it at boot with a preflight check.","Only enable EE features in environments that are licensed.","Track license expiry and alert before renewal deadlines.","Never copy EE config between projects without the license env var."],"tags":["licensing","enterprise","configuration","env-var","startup"],"backgroundTag":"missing-license-key","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}