OtterMind/Chat2DB · warning · Error

License flow is disabled in community mode

Error message

License flow is disabled in community mode

What it means

This error is thrown by the community-mode license stub when validLicense() is called. The Community build (UMI_ENV=community / __RUNTIME_ENV__==='community') ships a no-op license service where every method returns a safe default except validLicense, which deliberately throws to signal that the licensing subsystem is intentionally absent. It exists because the Community edition has no paid license flow, so any attempt to validate a license must fail loudly rather than silently return true.

Source

Thrown at chat2db-community-client/src/community-stubs/service/license.ts:4

const licenseService = {
  startTrial: async () => undefined,
  validLicense: async () => {
    throw new Error('License flow is disabled in community mode');
  },
  removeLicense: async () => undefined,
  sendEmailLicense: async () => undefined,
  checkPasscode: async () => undefined,
  getDeviceId: async () => '',
  activateCer: async () => undefined,
  getLicenseList: async () => [],
  generateCertificate: async () => '',
  listCertificate: async () => [],
  deactivateOnline: async () => undefined,
};

export default licenseService;

View on GitHub (pinned to 5ee1e990e7)

Solutions

  1. Guard the call site with an edition check (e.g., __RUNTIME_ENV__ !== 'community') before invoking validLicense.
  2. Wrap the call in try/catch and treat the error as 'no valid license' to fall back to Community-appropriate UI.
  3. Remove or disable the UI component that triggers validLicense in Community builds via conditional rendering.

Example fix

// before
const isValid = await licenseService.validLicense();

// after
let isValid = false;
try {
  isValid = await licenseService.validLicense();
} catch {
  // Community mode has no license; treat as unlicensed
}
Defensive patterns

Strategy: try-catch

Validate before calling

const isLicenseCheckAvailable = __RUNTIME_ENV__ !== 'community';
// Only call validLicense when isLicenseCheckAvailable is true

Type guard

function canCheckLicense(): boolean {
  return typeof __RUNTIME_ENV__ === 'string' && __RUNTIME_ENV__ !== 'community';
}

Try / catch

let valid = false;
try {
  valid = await licenseService.validLicense();
} catch (e) {
  if (e instanceof Error && /disabled in community mode/.test(e.message)) {
    valid = false;
  } else {
    throw e;
  }
}

Prevention

When it happens

Trigger: Calling licenseService.validLicense() in a Community build. This happens when UI components gated behind an isEnterprise/isLicensed check render and invoke the license check, or when a persisted/legacy code path calls validLicense unconditionally without checking runtime edition.

Common situations: Running the frontend with UMI_ENV=community but a component still calls validLicense (e.g., a feature flag not fully gated by edition). Migrating from Enterprise to Community without removing a license-check call site. A shared component used across editions that unconditionally probes license validity.

Related errors


AI-assisted analysis of OtterMind/Chat2DB@5ee1e990e7 (2026-08-14). Data as JSON: /api/errors/9a5a2823924ca072. Report an issue: GitHub.