Skip to content

feat(remote-server): add fallback routing for install failures#10507

Draft
alokedesai wants to merge 2 commits intomasterfrom
oz/remote-install-fallback
Draft

feat(remote-server): add fallback routing for install failures#10507
alokedesai wants to merge 2 commits intomasterfrom
oz/remote-install-fallback

Conversation

@alokedesai
Copy link
Copy Markdown
Member

@alokedesai alokedesai commented May 8, 2026

Problem

The install script had a single remote-download path. Hosts without HTTP clients, hosts without tar, and hosts with transient remote download problems failed before Warp could try a different delivery mechanism. Some failures also lost useful stderr or retried permanent host conditions such as permissions and disk errors.

Solution

  • Add explicit install-script sentinels:
    • exit 3 when neither curl nor wget is available.
    • exit 4 when remote download attempts fail after trying available clients.
    • exit 5 when tar is unavailable.
  • Preserve curl/wget stderr so Rust can classify the real failure family.
  • Route sentinel failures in SshTransport:
    • no HTTP client and retriable download failures use SCP tarball upload fallback.
    • missing tar uses direct binary upload after local extraction.
    • non-retriable categories such as HTTP 403, permissions, no space, and read-only filesystem remain surfaced as typed script failures instead of being masked by fallback.
  • Add helper code for local tarball download, SCP upload, direct binary extraction/upload, and fallback timeouts.

Proof / validation

No screenshots are applicable because this is remote install behavior. Proof is before/after constructed-host output and validation commands:

  • Before/after Docker SSH harness examples:
    • 04_missing_tar: before origin/master exited 127 with tar: not found; after exited sentinel 5, which Rust routes to direct binary upload fallback.
    • 06_dns_failure: before exited 6; after exited sentinel 4 with combined curl/wget DNS stderr, which Rust can route to fallback when retriable.
    • 08_http_403: before exited 22; after exited sentinel 4 and the app-side classifier keeps it non-retriable so the original HTTP 403 is preserved.
  • Full current harness matrix after integration passed all expected outcomes, including baseline success, missing curl/wget success, no HTTP client 3, missing tar 5, retriable download/network/TLS failures 4, true host failures as expected failures, forced disconnect 255, and missing Bash success.
  • Validation commands passed after integration:
    • cargo fmt
    • cargo test -p remote_server — 136 tests passed
    • cargo check -p remote_server
    • cargo check -p warp
    • cargo clippy -p remote_server --all-targets -- -D warnings
    • cargo clippy -p warp --all-targets -- -D warnings

Co-Authored-By: Oz oz-agent@warp.dev

@cla-bot cla-bot Bot added the cla-signed label May 8, 2026
alokedesai and others added 2 commits May 8, 2026 18:32
- install_remote_server.sh: retry with alternate HTTP client (curl→wget,
  wget→curl) on download failure; add distinct exit codes for download
  failure (4) and missing tar (5); add --connect-timeout and --retry to
  curl; add --timeout to wget

- setup.rs: add DOWNLOAD_FAILED_EXIT_CODE (4) and NO_TAR_EXIT_CODE (5)
  constants; add is_non_retryable_host_error() to detect permission
  denied, no space, read-only FS, quota exceeded from stderr patterns;
  substitute new placeholders in install_script()

- ssh_transport.rs: enhanced install_binary fallback routing:
  - exit 3 (no HTTP client) → SCP tarball fallback (existing)
  - exit 4 (download failed) → SCP tarball fallback (new)
  - exit 5 (no tar) → direct binary upload fallback (new)
  - timeout → SCP fallback (new)
  - exit 255 / non-retryable host errors → propagate immediately
  Add scp_install_binary_direct(): downloads tarball locally, extracts
  locally, uploads only the binary via SCP, chmod+mv remotely — avoids
  needing tar on the remote host. Refactor shared download logic into
  download_tarball_locally() and find_oz_binary_in_dir().

- setup_tests.rs: add tests for exit code distinctness, placeholder
  substitution, and is_non_retryable_host_error classification

Co-Authored-By: Oz <oz-agent@warp.dev>
…iles

Add {download_failed_exit_code} and {no_tar_exit_code} substitutions to
the harness's prepare_install_script so it works with the updated
install_remote_server.sh template. Include the harness directory from
the remote-host-harness branch for before/after demo runs.

Co-Authored-By: Oz <oz-agent@warp.dev>
@alokedesai alokedesai force-pushed the oz/remote-install-fallback branch from 8a4e8ea to 6ad60c9 Compare May 8, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant