stablyai/orca · error

SSH target "${targetId}" not found

Error message

SSH target "${targetId}" not found

What it means

Thrown inside doConnect (the SSH connect handler for 'ssh:connect') when sshStore.getTarget(targetId) returns undefined. The store is the source of truth for configured SSH targets, so a missing target means the targetId supplied by the renderer does not correspond to any saved SSH target configuration. The connect flow refuses to proceed because there is no host/user/port/credential tuple to dial.

Source

Thrown at src/main/ipc/ssh.ts:1131

        connectInFlight.delete(targetId)
      }
    }
  }

  registeredConnectSshTarget = connectTarget
  registeredGetSshState = (targetId: string) => getPublicSshState(targetId)

  ipcMain.handle('ssh:connect', async (_event, args: { targetId: string }) => {
    return connectTarget(args.targetId)
  })

  async function doConnect(
    targetId: string,
    replacePendingTransport = false
  ): Promise<SshConnectionState> {
    const target = sshStore!.getTarget(targetId)
    if (!target) {
      throw new Error(`SSH target "${targetId}" not found`)
    }

    const existingSession = activeSessions.get(targetId)
    const existingState = connectionManager!.getState(targetId)
    const existingMux = existingSession?.getMux()
    if (
      existingSession?.getState() === 'ready' &&
      existingState?.status === 'connected' &&
      connectionManager!.getConnection(targetId) &&
      existingMux &&
      !existingMux.isDisposed() &&
      !relayStateOverrides.has(targetId) &&
      !relayLostBackoff.has(targetId)
    ) {
      // Why: BrowserWindow reactivation re-fires ssh:connect for already-live targets; treat as a refresh instead of tearing down the relay and its forwards.
      broadcastSshState(getCurrentMainWindow, targetId, existingState)
      return getPublicSshState(targetId)!
    }

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Refresh the SSH target list in the renderer and reconnect using a currently-valid targetId.
  2. If the target was deleted intentionally, remove any UI affordance or saved state still referencing it.
  3. Validate targetId against sshStore list before issuing 'ssh:connect'.
Defensive patterns

Strategy: validation

Validate before calling

const targets = await ipcRenderer.invoke('ssh:listTargets')
if (!targets.some((t) => t.id === targetId)) {
  throw new Error(`Unknown SSH target: ${targetId}`)
}
await ipcRenderer.invoke('ssh:connect', { targetId })

Type guard

function isKnownTarget(targetId: string, targets: { id: string }[]): targetId is string {
  return targets.some((t) => t.id === targetId)
}

Try / catch

try {
  await ipcRenderer.invoke('ssh:connect', { targetId })
} catch (e) {
  if (/SSH target .* not found/.test((e as Error).message)) {
    refreshTargetList()
    showNotification('This SSH target no longer exists.')
  } else throw e
}

Prevention

When it happens

Trigger: ipcMain 'ssh:connect' handler invoked with a targetId that was deleted, never created, or is a stale ID retained in renderer state after a config reload. Also possible if the target was renamed and the renderer is sending the old identifier.

Common situations: Renderer holds a cached target list and sends an ID for a target the user just removed. A persisted window-state references a target that no longer exists. A typo or copy/paste error in an automated test or script supplies a nonexistent ID.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/e844d76336b648d7. Report an issue: GitHub.