nocobase/nocobase · error

Env "${runtime.envName}" does not support automatic app vers

Error message

Env "${runtime.envName}" does not support automatic app version detection.

What it means

resolveManagedAppVersion supports only two runtime kinds: 'local' (read package.json) and 'docker' (docker run). If a managed app runtime has any other kind, the CLI cannot automatically detect the app version and throws this error naming the env.

Source

Thrown at packages/core/cli/src/commands/license/plugins/sync.ts:145

    );
  }

  const versionMatch = output.match(/@nocobase\/cli\/([^\s]+)/);
  const version = trimValue(versionMatch?.[1] ?? output.replace(/^"+|"+$/g, ''));
  if (!version) {
    throw new Error(`Missing app version for env "${runtime.envName}" inside Docker image ${imageRef}.`);
  }
  return version;
}

async function resolveManagedAppVersion(runtime: ManagedAppRuntime): Promise<string> {
  if (runtime.kind === 'local') {
    return await resolveLocalAppVersion(runtime);
  }
  if (runtime.kind === 'docker') {
    return await resolveDockerAppVersion(runtime);
  }
  throw new Error(`Env "${runtime.envName}" does not support automatic app version detection.`);
}

function buildNoLicenseSkipPayload(runtime: ManagedAppRuntime, dryRun: boolean) {
  return {
    ok: true,
    env: runtime.envName,
    kind: runtime.kind,
    dryRun,
    status: 'skipped',
    skipReason: 'no-license-key',
  };
}

export default class LicensePluginsSync extends Command {
  static override summary = 'Synchronize commercial plugins for the selected env';
  static override description = 'Synchronize the commercial plugins allowed by the current saved license key.';
  static override examples = [
    '<%= config.bin %> <%= command.id %>',

View on GitHub (pinned to fa42722fef)

Solutions

  1. Inspect the env configuration and change it to a supported kind: 'local' (with valid projectRoot) or 'docker' (with a NocoBase image).
  2. Set the app version explicitly for the env if automatic detection is not supported (pin the version in the env config).
  3. Register the env as a local or docker runtime instead of the exotic kind.
  4. Update the CLI in case a newer version supports that runtime kind.
  5. Remove the unsupported env and re-register it with a supported deployment type.

Example fix

// before (env config)
// kind: ssh, host: app.example.com
// after
// kind: local, projectRoot: /srv/nocobase  (or kind: docker with imageRef)
Defensive patterns

Strategy: fallback

Validate before calling

const kind = getManagedEnvConfig(envName).kind;
if (kind !== 'local' && kind !== 'docker') throw new Error(`Env "${envName}" kind "${kind}" is unsupported for version detection; use local or docker`);

Type guard

function isSupportedRuntime(runtime: { kind: string }): runtime is { kind: 'local' | 'docker' } {
  return runtime.kind === 'local' || runtime.kind === 'docker';
}

Try / catch

try {
  const version = await resolveManagedAppVersion(runtime);
} catch (err) {
  if (err instanceof Error && err.message.includes('does not support automatic app version detection')) {
    // fall back to a manually pinned version from env config
    const version = runtime.env.config?.appVersion ?? promptForVersion();
  } else {
    throw err;
  }
}

Prevention

When it happens

Trigger: A license sync/version command runs against a managed env whose runtime kind is neither local nor docker (e.g. a remote/ssh or other runtime type added by config), reaching the final `throw` in resolveManagedAppVersion.

Common situations: Env configured with an unsupported runtime kind in the managed-env config; newer/other deployment targets registered in app.env; misparsed env config defaulting to an unknown kind; plugin/extension introducing a new runtime kind not yet handled by version detection.

Related errors


AI-assisted analysis of nocobase/nocobase@fa42722fef (2026-09-01). Data as JSON: /api/errors/377bb839954a5e27. Report an issue: GitHub.