{"record":{"id":"d3d415a9e79a77e4","repo":"mastra-ai/mastra","slug":"mastra-auth-ee-agent-builder-is-configured-but-n","errorCode":null,"errorMessage":"[mastra/auth-ee] Agent Builder is configured but no valid EE license was found.\nAgent Builder requires 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\\] Agent Builder is configured but no valid EE license was found\\.\nAgent Builder requires 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":882,"sourceCode":"      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\n  /**\n   * Validate that an Agent Builder configuration has a valid EE license.\n   * Throws if the editor is configured with builder support but no valid EE license is available.\n   */\n  async validateAgentBuilderLicense(): Promise<void> {\n    const editor = this.mastra.getEditor();\n    if (!editor?.hasEnabledBuilderConfig?.()) return;\n\n    try {\n      const { isEEEnabled } = await import('@mastra/core/auth/ee');\n      if (!isEEEnabled()) {\n        throw new Error(\n          '[mastra/auth-ee] Agent Builder is configured but no valid EE license was found.\\n' +\n            'Agent Builder requires 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 — Agent Builder cannot function\n      throw new Error(\n        '[mastra/auth-ee] Agent Builder is 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":864,"sourceCodeEnd":900,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/server-adapter/index.ts#L864-L900","documentation":"Startup error thrown when the Mastra editor has an enabled Agent Builder configuration (editor.hasEnabledBuilderConfig()) but no valid EE license is present (isEEEnabled() is false). Agent Builder is an enterprise-gated feature, so the server refuses to start rather than exposing it unlicensed.","triggerScenarios":"Enabling Agent Builder in the editor/mastra config while MASTRA_EE_LICENSE is unset, invalid, or not visible to the server process, and then booting the server via server-adapter.","commonSituations":"Turning on Agent Builder locally without a license to try it; license configured in local .env but not in the deployed environment; expired enterprise license; environment variable name typo (e.g. MAESTRA_EE_LICENSE).","solutions":["Set MASTRA_EE_LICENSE with a valid license key in the server's environment.","If Agent Builder is not needed, disable the builder configuration in the editor/mastra config.","Confirm the env var name and value are correct and loaded before server boot.","Renew the license if it has expired."],"exampleFix":"// before\nnew Mastra({ editor: { builder: { enabled: true } } }); // no license in env\n\n// after\n// export MASTRA_EE_LICENSE=<key> in the deployment environment\nnew Mastra({ editor: { builder: { enabled: true } } });","handlingStrategy":"validation","validationCode":"if (mastra.getEditor()?.hasEnabledBuilderConfig?.() && !process.env.MASTRA_EE_LICENSE) {\n  throw new Error('Agent Builder is enabled but MASTRA_EE_LICENSE is not set; provide a license or disable the builder config');\n}","typeGuard":"function builderRequiresLicense(editor: unknown): boolean {\n  return typeof editor === 'object' && editor !== null &&\n    typeof (editor as any).hasEnabledBuilderConfig === 'function' &&\n    (editor as any).hasEnabledBuilderConfig() === true;\n}","tryCatchPattern":"try {\n  await startServer(mastra);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('Agent Builder') && e.message.includes('no valid EE license')) {\n    console.error('Disable Agent Builder or set MASTRA_EE_LICENSE with a valid enterprise key.');\n    process.exitCode = 1;\n    return;\n  }\n  throw e;\n}","preventionTips":["Gate Agent Builder enablement behind the presence of MASTRA_EE_LICENSE in config code.","Keep license env vars in all environments where builder config is enabled, including dev.","Alert on license expiry so Agent Builder doesn't fail boot unexpectedly."],"tags":["licensing","enterprise","agent-builder","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"}