stablyai/orca · error · Error

No SSH connection for "${connectionId}"

Error message

No SSH connection for "${connectionId}"

What it means

Thrown by importExternalPathsSsh() when getSshConnectionManager() returns no manager or getConnection(connectionId) returns no connection. It fires before any state check, meaning the connectionId is not registered at all — there is no live or historic connection object for that id. The quoted id in the message identifies which connection the caller expected.

Source

Thrown at src/main/ipc/filesystem-import-ssh.ts:31

  uploadSshImportDirectory
} from './filesystem-import-ssh-directory'

// Why: the SSH import path uses SshFilesystemProvider instead of direct SFTP so
// system-SSH transports (ProxyCommand/ProxyJump/FIDO2) get the same workflows.
export async function importExternalPathsSsh(
  sourcePaths: string[],
  destDir: string,
  connectionId: string,
  options?: { ensureDir?: boolean; assertCurrent?: () => void }
): Promise<{ results: ImportItemResult[] }> {
  if (sourcePaths.length === 0) {
    return { results: [] }
  }

  const connManager = getSshConnectionManager()
  const conn = connManager?.getConnection(connectionId)
  if (!conn) {
    throw new Error(`No SSH connection for "${connectionId}"`)
  }

  const state = conn.getState()
  if (state.status !== 'connected') {
    if (state.status === 'reconnecting') {
      throw new Error('SSH connection is reconnecting — please try again in a moment')
    }
    throw new Error('SSH connection is not active — please reconnect and try again')
  }

  const provider = requireSshFilesystemProvider(connectionId)

  if (options?.ensureDir) {
    // Why: terminal-drop staging needs `${worktree}/.orca/drops` to exist
    // before the first upload. .orca/ is reserved as Orca-owned remote state;
    // see docs/terminal-drop-ssh.md.
    await ensureDropStagingDir(provider, destDir, options.assertCurrent)
  }

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Re-establish the SSH connection so a current connectionId is available, then retry the import.
  2. Refresh the renderer's connectionId reference from the connection manager before invoking import.
  3. Disable the import/drop action in the UI when no active connection exists for the target.
Defensive patterns

Strategy: retry

Validate before calling

// Verify the connection is registered before invoking import
import { getSshConnectionManager } from './ssh'
function isConnectionKnown(connectionId: string): boolean {
  return !!getSshConnectionManager()?.getConnection(connectionId)
}

Try / catch

try {
  await importExternalPathsSsh(sources, dest, connectionId, opts)
} catch (e) {
  if (e instanceof Error && /No SSH connection/.test(e.message)) {
    await reconnectSshTarget(connectionId) // then retry with the fresh connectionId
  } else throw e
}

Prevention

When it happens

Trigger: fs:ImportExternalPaths (or the terminal-drop staging path) is invoked with a connectionId that was never connected, was disconnected and evicted from the manager, or came from a stale renderer reference after the SSH target was removed.

Common situations: Renderer holds a connectionId from a previous session after the target was disconnected/closed; a race where the user initiated an import just as the connection tore down; the SSH target was deleted from settings while an import was queued.

Related errors


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