René's URL Explorer Experiment


Title: coder ssh: add retry loop for transient connection failures · Issue #24005 · coder/coder · GitHub

Open Graph Title: coder ssh: add retry loop for transient connection failures · Issue #24005 · coder/coder

X Title: coder ssh: add retry loop for transient connection failures · Issue #24005 · coder/coder

Description: coder ssh --stdio exits immediately on transient errors (DNS failure, connection timeout, API unreachable). When used as an SSH ProxyCommand, this causes VS Code's Remote SSH extension to throw a permanent SshResolverError.Create() error...

Open Graph Description: coder ssh --stdio exits immediately on transient errors (DNS failure, connection timeout, API unreachable). When used as an SSH ProxyCommand, this causes VS Code's Remote SSH extension to throw a p...

X Description: coder ssh --stdio exits immediately on transient errors (DNS failure, connection timeout, API unreachable). When used as an SSH ProxyCommand, this causes VS Code's Remote SSH extension to throw...

Opengraph URL: https://github.com/coder/coder/issues/24005

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"coder ssh: add retry loop for transient connection failures","articleBody":"`coder ssh --stdio` exits immediately on transient errors (DNS failure, connection timeout, API unreachable). When used as an SSH ProxyCommand, this causes VS Code's Remote SSH extension to throw a permanent `SshResolverError.Create()` error, which kills the reconnection loop on the first attempt. The user sees \"Reload Window\" even though the error would resolve itself in seconds.\n\n## Confirmed failure mode\n\nCaptured from `remote.SSH.logLevel: \"trace\"` during a real sleep/wake cycle on Linux with `systemd-resolved`:\n\n1. Wake from sleep, VS Code detects disconnect (\\~20s), starts reconnection\n2. Remote SSH extension spawns new SSH with ProxyCommand: `coder ssh --stdio`\n3. `coder ssh` immediately queries the workspace API\n4. **DNS lookup fails**: `dial tcp: lookup dev.coder.com: server misbehaving` (`systemd-resolved` not ready after wake)\n5. `coder ssh` exits immediately with error\n6. Remote SSH sees unparsable bash script output\n7. `SshResolverError.Create()` (permanent) -> \"Reload Window\"\n\nDNS recovers within seconds, but `coder ssh` has already exited. VS Code does not retry because the error is classified as permanent.\n\nThis affects any configuration where `coder ssh` errors produce terminal output that the Remote SSH extension tries to parse as bash script output (i.e. when `useLocalServer` is `false`). With `useLocalServer: true`, the local server manages SSH with its own retry logic and doesn't depend on script parsing, making it more resilient to transient ProxyCommand failures.\n\nA separate but related issue exists with the Coder Connect code path, where a broken tunnel causes a \\~55 minute hang before `coder ssh` exits. The retry loop proposed here would eventually recover from that too, but a dial timeout and tailnet fallback are needed to avoid the long wait. See [ENG-2346](https://linear.app/codercom/issue/ENG-2346/coder-ssh-coder-connect-path-has-no-dial-timeout-no-health-check-no).\n\n## Proposed change\n\nWrap the connection establishment logic in [`cli/ssh.go`](\u003chttps://github.com/coder/coder/blob/main/cli/ssh.go>) (handler function, lines \\~280-474) in a retry loop with backoff. This covers workspace resolution, API calls, agent readiness checks, and the dial to the workspace.\n\n```go\nretryDelays := []time.Duration{0, 2 * time.Second, 5 * time.Second, 10 * time.Second, 10 * time.Second}\n\nfor attempt := range retryDelays {\n    err := connectAndServe(ctx, ...)\n    if err == nil {\n        return nil\n    }\n    if !isRetryable(err) || attempt == len(retryDelays)-1 {\n        return err\n    }\n    logger.Warn(ctx, \"connection failed, retrying\",\n        slog.Error(err), slog.F(\"attempt\", attempt+1))\n    select {\n    case \u003c-ctx.Done():\n        return ctx.Err()\n    case \u003c-time.After(retryDelays[attempt]):\n    }\n}\n```\n\n**Error classification:**\n\n\u003c!-- linear:table-colwidths:266,266,266 -->\n| Error | Retryable? | Rationale |\n| -- | -- | -- |\n| DNS lookup failure | Yes | Resolvers recover within seconds after wake |\n| Connection refused / reset | Yes | Network interface may still be coming up |\n| Connection timeout | Yes | Transient network issue |\n| `DialAgent` failure | Yes | Tailnet coordinator may be temporarily unreachable |\n| HTTP 401/403 (auth) | No | Credentials are wrong, retrying won't help |\n| HTTP 404 (workspace not found) | No | Workspace doesn't exist |\n| Context canceled (SIGINT/SIGHUP) | No | User or SSH parent requested exit |\n\n## Current workaround\n\nA vscode-coder extension PR ([https://github.com/coder/vscode-coder/pull/872](\u003chttps://github.com/coder/vscode-coder/pull/872>)) wraps the ProxyCommand with a shell-level retry as a stopgap. This works but is fragile (platform-specific shell behavior, can't classify errors) and only helps VS Code/Cursor users.\n\n## Why the CLI is the right layer\n\n* Covers all editors (VS Code, Cursor, JetBrains, plain SSH)\n* Can accurately distinguish transient vs permanent errors\n* Avoids platform-specific shell wrapper issues\n* Logs retries to the `coder ssh` log file for debugging\n* Removes the need for an extension-side ProxyCommand retry wrapper","author":{"url":"https://github.com/EhabY","@type":"Person","name":"EhabY"},"datePublished":"2026-04-03T09:35:49Z","url":"https://github.com/coder/coder/issues/24005"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:782451ba-6e54-b6d2-275b-e29e5980b43c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8D94:1201C:2C79F3A:3B1DB75:6B01C4C6
html-safe-noncebdc59b9aa7290d9b14f400f7f35e5ca41757dccbb3efaa32f6c0f704fe924a96
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RDk0OjEyMDFDOjJDNzlGM0E6M0IxREI3NTo2QjAxQzRDNiIsInZpc2l0b3JfaWQiOiIyMDk2MDA0ODI4OTE1NDE4MzEwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmace89095ce36b0b8574bc8d2ec75402005bc106122a079c0072b8490cdbdef9f1a
hovercard-subject-tagissue:4199550825
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/24005/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d6a8e22a0d6ca7fc7356a0fba5377a27226b8301738566f1968e2b23adc52aae/coder/coder/issues/24005
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d6a8e22a0d6ca7fc7356a0fba5377a27226b8301738566f1968e2b23adc52aae/coder/coder/issues/24005
og:image:altcoder ssh --stdio exits immediately on transient errors (DNS failure, connection timeout, API unreachable). When used as an SSH ProxyCommand, this causes VS Code's Remote SSH extension to throw a p...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameEhabY
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/coder/coder git https://github.com/coder/coder.git
octolytics-dimension-user_id95932066
octolytics-dimension-user_logincoder
octolytics-dimension-repository_id440752086
octolytics-dimension-repository_nwocoder/coder
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id440752086
octolytics-dimension-repository_network_root_nwocoder/coder
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/coder/coder/issues/24005#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcoder%2Fissues%2F24005
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcoder%2Fissues%2F24005
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=coder%2Fcoder
Reloadhttps://github.com/coder/coder/issues/24005
Reloadhttps://github.com/coder/coder/issues/24005
Reloadhttps://github.com/coder/coder/issues/24005
coderhttps://github.com/coder
coderhttps://github.com/coder/coder
Codehttps://github.com/coder/coder
Issues320 (320)https://github.com/coder/coder/issues
Pull requests470 (470)https://github.com/coder/coder/pulls
Discussionshttps://github.com/coder/coder/discussions
Actionshttps://github.com/coder/coder/actions
Projectshttps://github.com/coder/coder/projects
Security and quality49 (49)https://github.com/coder/coder/security
Insightshttps://github.com/coder/coder/insights
https://github.com/coder/coder
New issuehttps://github.com/login?return_to=https://github.com/coder/coder/issues/24005
New issuehttps://github.com/login?return_to=https://github.com/coder/coder/issues/24005
#24010https://github.com/coder/coder/pull/24010
coder ssh: add retry loop for transient connection failureshttps://github.com/coder/coder/issues/24005#top
#24010https://github.com/coder/coder/pull/24010
https://github.com/EhabY
https://github.com/EhabY
EhabYhttps://github.com/EhabY
on Apr 3, 2026https://github.com/coder/coder/issues/24005#issue-4199550825
ENG-2346https://linear.app/codercom/issue/ENG-2346/coder-ssh-coder-connect-path-has-no-dial-timeout-no-health-check-no
cli/ssh.gohttps://github.com/coder/coder/blob/main/cli/ssh.go
coder/vscode-coder#872https://github.com/coder/vscode-coder/pull/872
EhabYhttps://github.com/EhabY
on Apr 3, 2026https://github.com/coder/coder/issues/24005#event-24178539195
EhabYhttps://github.com/EhabY
completedhttps://github.com/coder/coder/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#24010https://github.com/coder/coder/pull/24010
on Apr 7, 2026https://github.com/coder/coder/issues/24005#event-24274944755
Sign up for freehttps://github.com/signup?return_to=https://github.com/coder/coder/issues/24005
Sign in to commenthttps://github.com/login?return_to=https://github.com/coder/coder/issues/24005
EhabYhttps://github.com/EhabY
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.