musistudio/claude-code-router · error · ProfileGatewayUnavailableError

CCR gateway is not running at ${profileGatewayEndpoint(confi

Error message

CCR gateway is not running at ${profileGatewayEndpoint(config)}. Start CCR Desktop or run ccr start before opening ${appName}.

What it means

Error "CCR gateway is not running at ${profileGatewayEndpoint(config)}. Start CCR Desktop or run ccr start before opening ${appName}." thrown in musistudio/claude-code-router.

Source

Thrown at packages/core/src/profiles/launch-service.ts:420

): Promise<EnsureGatewayConfigRunningResult> {
  const startIfMissing = options.startIfMissing !== false;
  if (options.reuseExisting) {
    const existingGateway = await probeExistingProfileGateway(config, profile, candidateConfig);
    if (existingGateway.state === "usable") {
      return { acceptedApiKey: existingGateway.apiKey, config };
    }
    if (existingGateway.state === "unavailable") {
      if (!startIfMissing) {
        const reason = existingGateway.reason ? `: ${existingGateway.reason}` : "";
        throw new ProfileGatewayUnavailableError(`CCR gateway is not running at ${profileGatewayEndpoint(config)}${reason}. Start CCR Desktop or run ccr start before opening ${appName}.`);
      }
    } else {
      throw new Error(existingGatewayConflictMessage(existingGateway, appName));
    }
  }

  if (!startIfMissing) {
    throw new ProfileGatewayUnavailableError(`CCR gateway is not running at ${profileGatewayEndpoint(config)}. Start CCR Desktop or run ccr start before opening ${appName}.`);
  }

  const startedStatus = await gatewayService.start(config);
  if (startedStatus.state === "running") {
    return { config };
  }

  if (options.reuseExisting && isAddressInUseError(startedStatus.lastError)) {
    const existingGateway = await probeExistingProfileGateway(config, profile, candidateConfig);
    if (existingGateway.state === "usable") {
      return { acceptedApiKey: existingGateway.apiKey, config };
    }
    throw new Error(existingGatewayConflictMessage(existingGateway, appName));
  }

  throw new Error(startedStatus.lastError || `CCR gateway did not start for ${appName}.`);
}

View on GitHub (pinned to 99f24806c6)

When it happens

Trigger: Thrown at packages/core/src/profiles/launch-service.ts:420 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of musistudio/claude-code-router@99f24806c6 (2026-08-27). Data as JSON: /api/errors/9cc9f8a8c5273e82. Report an issue: GitHub.