{"record":{"id":"377bb839954a5e27","repo":"nocobase/nocobase","slug":"env-runtime-envname-does-not-support-automati","errorCode":null,"errorMessage":"Env \"${runtime.envName}\" does not support automatic app version detection.","messagePattern":"Env \"(.+?)\" does not support automatic app version detection\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/cli/src/commands/license/plugins/sync.ts","lineNumber":145,"sourceCode":"    );\n  }\n\n  const versionMatch = output.match(/@nocobase\\/cli\\/([^\\s]+)/);\n  const version = trimValue(versionMatch?.[1] ?? output.replace(/^\"+|\"+$/g, ''));\n  if (!version) {\n    throw new Error(`Missing app version for env \"${runtime.envName}\" inside Docker image ${imageRef}.`);\n  }\n  return version;\n}\n\nasync function resolveManagedAppVersion(runtime: ManagedAppRuntime): Promise<string> {\n  if (runtime.kind === 'local') {\n    return await resolveLocalAppVersion(runtime);\n  }\n  if (runtime.kind === 'docker') {\n    return await resolveDockerAppVersion(runtime);\n  }\n  throw new Error(`Env \"${runtime.envName}\" does not support automatic app version detection.`);\n}\n\nfunction buildNoLicenseSkipPayload(runtime: ManagedAppRuntime, dryRun: boolean) {\n  return {\n    ok: true,\n    env: runtime.envName,\n    kind: runtime.kind,\n    dryRun,\n    status: 'skipped',\n    skipReason: 'no-license-key',\n  };\n}\n\nexport default class LicensePluginsSync extends Command {\n  static override summary = 'Synchronize commercial plugins for the selected env';\n  static override description = 'Synchronize the commercial plugins allowed by the current saved license key.';\n  static override examples = [\n    '<%= config.bin %> <%= command.id %>',","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/nocobase/nocobase/blob/fa42722fefe44265490dff2c27d79e2882bce4fa/packages/core/cli/src/commands/license/plugins/sync.ts#L127-L163","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect the env configuration and change it to a supported kind: 'local' (with valid projectRoot) or 'docker' (with a NocoBase image).","Set the app version explicitly for the env if automatic detection is not supported (pin the version in the env config).","Register the env as a local or docker runtime instead of the exotic kind.","Update the CLI in case a newer version supports that runtime kind.","Remove the unsupported env and re-register it with a supported deployment type."],"exampleFix":"// before (env config)\n// kind: ssh, host: app.example.com\n// after\n// kind: local, projectRoot: /srv/nocobase  (or kind: docker with imageRef)","handlingStrategy":"fallback","validationCode":"const kind = getManagedEnvConfig(envName).kind;\nif (kind !== 'local' && kind !== 'docker') throw new Error(`Env \"${envName}\" kind \"${kind}\" is unsupported for version detection; use local or docker`);","typeGuard":"function isSupportedRuntime(runtime: { kind: string }): runtime is { kind: 'local' | 'docker' } {\n  return runtime.kind === 'local' || runtime.kind === 'docker';\n}","tryCatchPattern":"try {\n  const version = await resolveManagedAppVersion(runtime);\n} catch (err) {\n  if (err instanceof Error && err.message.includes('does not support automatic app version detection')) {\n    // fall back to a manually pinned version from env config\n    const version = runtime.env.config?.appVersion ?? promptForVersion();\n  } else {\n    throw err;\n  }\n}","preventionTips":["Register managed envs only as local or docker runtimes for license flows.","Store an explicit appVersion in env config as a fallback for exotic runtimes.","Keep the CLI updated so newly supported runtime kinds are handled.","Audit env configs after migrations to ensure kinds are recognized.","Document the deployment type when registering a new env."],"tags":["config","version","unsupported","cli"],"backgroundTag":"unsupported-runtime-kind","analyzedSha":"fa42722fefe44265490dff2c27d79e2882bce4fa","analyzedAt":"2026-09-01T00:54:31.202Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}