{"record":{"id":"2da649c3c8b99543","repo":"stablyai/orca","slug":"ssh-filesystem-provider-unavailable-for-target-c","errorCode":null,"errorMessage":"SSH filesystem provider unavailable for ${target.connectionId}","messagePattern":"SSH filesystem provider unavailable for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/main/ipc/worktree-base-directory-watcher.ts","lineNumber":146,"sourceCode":"    pendingHeadIdentityRepoIds: new Set(),\n    headIdentityRefresh: createWorktreeHeadIdentityRefreshState(),\n    gitStatusRefPaths,\n    watcherFailureRefresh: new WorktreeWatcherFailureRefreshCooldown(),\n    disposed: false\n  }\n}\n\nasync function subscribeTarget(\n  target: WorktreeBaseWatchTarget,\n  mainWindow: BrowserWindow\n): Promise<ActiveWatch> {\n  let activeWatch: ActiveWatch | null = null\n  const gitStatusRefPaths = new Set<string>()\n  applyActiveGitStatusRefBinding({ ...target, gitStatusRefPaths })\n  if (target.connectionId) {\n    const provider = getSshFilesystemProvider(target.connectionId)\n    if (!provider) {\n      throw new Error(`SSH filesystem provider unavailable for ${target.connectionId}`)\n    }\n    const unwatch = await provider.watch(target.path, (events) => {\n      const currentWatch = activeWatches.get(target.key) ?? activeWatch\n      if (!currentWatch || currentWatch.disposed) {\n        return\n      }\n      handleRemoteWatchEvents(currentWatch, events)\n    })\n    activeWatch = createActiveWatch(\n      target,\n      mainWindow,\n      { unsubscribe: async () => unwatch() },\n      gitStatusRefPaths\n    )\n    return activeWatch\n  }\n\n  // Why: a recursive native watcher here forced fseventsd to deliver every","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/ipc/worktree-base-directory-watcher.ts#L128-L164","documentation":"Thrown by subscribeTarget in the worktree base-directory watcher when target.connectionId is set but getSshFilesystemProvider(target.connectionId) returns a falsy value. The SSH filesystem provider is the abstraction that watches remote paths over the relay; without it, remote file-change events cannot be delivered, so subscribing is impossible. The error identifies which connectionId lacks a provider so the caller can reconnect that target.","triggerScenarios":"subscribeTarget is called for a remote worktree target whose SSH connection lost its filesystem provider — e.g. the relay was reset, the connection dropped, or the provider was never registered for that connectionId. The target carries a connectionId (so it expects remote watching) but no provider is mapped to it.","commonSituations":"Watcher subscription races ahead of connection-ready. Relay reset cleared providers but the watcher list still references the target. A reconnect is mid-flight and the new provider is not yet registered.","solutions":["Reconnect the SSH target so its filesystem provider is (re)registered, then re-subscribe.","Sequence watcher setup after the connection-ready event for the connectionId, not on target-list load.","If the target should be local, clear its connectionId before subscribing."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (target.connectionId && !getSshFilesystemProvider(target.connectionId)) {\n  await reconnectTarget(target.connectionId)\n}\nawait subscribeTarget(target, mainWindow)","typeGuard":"function hasSshFsProvider(connectionId: string): boolean {\n  return getSshFilesystemProvider(connectionId) !== undefined\n}","tryCatchPattern":"try {\n  await subscribeTarget(target, mainWindow)\n} catch (e) {\n  if (/SSH filesystem provider unavailable/.test((e as Error).message)) {\n    await reconnectTarget(target.connectionId!)\n    await subscribeTarget(target, mainWindow)\n  } else throw e\n}","preventionTips":["Subscribe remote targets only after the connection-ready event fires.","Clear connectionId for targets that should be treated as local.","Re-subscribe watchers after a relay reset/reconnect."],"tags":["ssh","filesystem","file-watcher","connection","worktree"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}