{"record":{"id":"d29e079141bb3d01","repo":"musistudio/claude-code-router","slug":"ccr-gateway-is-not-running-at-profilegatewayendp","errorCode":null,"errorMessage":"CCR gateway is not running at ${profileGatewayEndpoint(config)}${reason}. Start CCR Desktop or run ccr start before opening ${appName}.","messagePattern":"CCR gateway is not running at (.+?)(.+?)\\. Start CCR Desktop or run ccr start before opening (.+?)\\.","errorType":"exception","errorClass":"ProfileGatewayUnavailableError","httpStatus":null,"severity":"error","filePath":"packages/core/src/profiles/launch-service.ts","lineNumber":412,"sourceCode":"};\n\nasync function ensureGatewayConfigRunning(\n  config: AppConfig,\n  profile: ReturnType<typeof findProfileForOpen>,\n  appName: string,\n  options: { reuseExisting?: boolean; startIfMissing?: boolean } = {},\n  candidateConfig: AppConfig = config\n): Promise<EnsureGatewayConfigRunningResult> {\n  const startIfMissing = options.startIfMissing !== false;\n  if (options.reuseExisting) {\n    const existingGateway = await probeExistingProfileGateway(config, profile, candidateConfig);\n    if (existingGateway.state === \"usable\") {\n      return { acceptedApiKey: existingGateway.apiKey, config };\n    }\n    if (existingGateway.state === \"unavailable\") {\n      if (!startIfMissing) {\n        const reason = existingGateway.reason ? `: ${existingGateway.reason}` : \"\";\n        throw new ProfileGatewayUnavailableError(`CCR gateway is not running at ${profileGatewayEndpoint(config)}${reason}. Start CCR Desktop or run ccr start before opening ${appName}.`);\n      }\n    } else {\n      throw new Error(existingGatewayConflictMessage(existingGateway, appName));\n    }\n  }\n\n  if (!startIfMissing) {\n    throw new ProfileGatewayUnavailableError(`CCR gateway is not running at ${profileGatewayEndpoint(config)}. Start CCR Desktop or run ccr start before opening ${appName}.`);\n  }\n\n  const startedStatus = await gatewayService.start(config);\n  if (startedStatus.state === \"running\") {\n    return { config };\n  }\n\n  if (options.reuseExisting && isAddressInUseError(startedStatus.lastError)) {\n    const existingGateway = await probeExistingProfileGateway(config, profile, candidateConfig);\n    if (existingGateway.state === \"usable\") {","sourceCodeStart":394,"sourceCodeEnd":430,"githubUrl":"https://github.com/musistudio/claude-code-router/blob/99f24806c6a2c660b16e53e95211c517448a6c90/packages/core/src/profiles/launch-service.ts#L394-L430","documentation":"Error \"CCR gateway is not running at ${profileGatewayEndpoint(config)}${reason}. Start CCR Desktop or run ccr start before opening ${appName}.\" thrown in musistudio/claude-code-router.","triggerScenarios":"Thrown at packages/core/src/profiles/launch-service.ts:412 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"99f24806c6a2c660b16e53e95211c517448a6c90","analyzedAt":"2026-08-27T04:11:01.184Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}