{"record":{"id":"a72597d18447b071","repo":"stablyai/orca","slug":"ssh-filesystem-provider-unavailable","errorCode":null,"errorMessage":"SSH filesystem provider unavailable","messagePattern":"SSH filesystem provider unavailable","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/main/ipc/worktrees.ts","lineNumber":2459,"sourceCode":"          const removedPushTarget = removedMeta?.pushTarget\n          const registeredWorktree = findRegisteredDeletableWorktree(\n            repo.path,\n            worktreePath,\n            registeredWorktrees\n          )\n          if (!registeredWorktree) {\n            const fsProvider = repo.connectionId\n              ? getSshFilesystemProvider(repo.connectionId)\n              : null\n            let canCleanOrphanedDirectory = false\n            if (\n              canCleanupUnregisteredOrcaWorktreeDirectory({\n                meta: removedMeta\n              })\n            ) {\n              if (repo.connectionId) {\n                if (!fsProvider) {\n                  throw new Error('SSH filesystem provider unavailable')\n                }\n                if (!fsProvider.lstat) {\n                  throw new Error('SSH filesystem provider lstat unavailable')\n                }\n                canCleanOrphanedDirectory = await canSafelyRemoveOrphanedWorktreeDirectory(\n                  worktreePath,\n                  repo.path,\n                  (path) => fsProvider.lstat!(path),\n                  (path) => fsProvider.readFile(path)\n                )\n              } else {\n                const access = getLocalWorktreePathAccess(localWorktreeGitOptions)\n                canCleanOrphanedDirectory =\n                  !isDangerousWorktreeRemovalPath(worktreePath, repo.path) &&\n                  (await canSafelyRemoveOrphanedWorktreeDirectory(\n                    toLocalWorktreeRuntimePath(worktreePath, localWorktreeGitOptions),\n                    toLocalWorktreeRuntimePath(repo.path, localWorktreeGitOptions),\n                    access.statPath,","sourceCodeStart":2441,"sourceCodeEnd":2477,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/ipc/worktrees.ts#L2441-L2477","documentation":"Thrown in the unregistered-worktree cleanup branch of worktrees:remove when repo.connectionId is set (SSH repo) but getSshFilesystemProvider returns undefined. Cleaning an orphaned worktree directory on the remote host requires filesystem inspection (lstat/readFile) to prove the directory is safe to delete; without a filesystem provider Orca refuses rather than delete blindly.","triggerScenarios":"Removing an SSH-backed worktree that is no longer Git-registered but whose directory remains, at a moment when the SSH filesystem provider is unavailable (disconnected) even though the git provider path may have proceeded.","commonSituations":"SSH connection dropped between the git listing and the orphan-cleanup step, or the filesystem provider was never registered for the target while the git provider was.","solutions":["Reconnect to the SSH target so the filesystem provider is available, then retry the removal.","Retry with args.force once the provider is back so the orphaned-directory cleanup can proceed.","Verify the SSH target registers both git and filesystem providers; an incomplete provider set is a connection/config defect."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"const fsProvider = await invoke('ssh:filesystemProviderStatus', repo.connectionId)\nif (!fsProvider) {\n  await invoke('ssh:reconnect', repo.connectionId)\n}","typeGuard":null,"tryCatchPattern":"try {\n  await invoke('worktrees:remove', { worktreeId, hostId })\n} catch (e) {\n  if (e.message === 'SSH filesystem provider unavailable') {\n    await invoke('ssh:reconnect', connectionId)\n    return invoke('worktrees:remove', { worktreeId, hostId, force: true })\n  }\n  throw e\n}","preventionTips":["Keep the SSH filesystem provider connected for SSH-backed repos.","Ensure the SSH target registers both git and filesystem providers.","Reconnect before retrying orphan-cleanup on SSH repos."],"tags":["ssh","worktree-remove","provider-unavailable","orphan-cleanup"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}