Improve user-facing error messages for remote server install failures#10531
Draft
alokedesai wants to merge 2 commits intomasterfrom
Draft
Improve user-facing error messages for remote server install failures#10531alokedesai wants to merge 2 commits intomasterfrom
alokedesai wants to merge 2 commits intomasterfrom
Conversation
Improve the ScriptFailed arm in Error::user_facing_error() to detect specific patterns in stderr and produce targeted, actionable messages instead of the generic 'Script exited with code N: <stderr>'. New patterns detected: - Permission denied / Read-only file system → write permissions advice - No space left on device → disk space advice - Exit code 255 + empty stderr → SSH disconnect message - unsupported arch: <name> → architecture not supported message Includes 12 unit tests covering all error patterns and edge cases. Co-Authored-By: Oz <oz-agent@warp.dev>
Docker testing revealed that when the install directory runs out of space, curl exits with code 23 and 'Failure writing output to destination' rather than the OS-level 'No space left on device'. Add this pattern to the disk-full check and a corresponding unit test. Co-Authored-By: Oz <oz-agent@warp.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Problem: When the remote server install fails due to permission denied, disk full, SSH disconnect, or unsupported architecture, users see a generic "Script exited with code N: " message. The raw stderr is often hundreds of characters of curl progress bars or tar errors, making it hard to understand what went wrong or how to fix it.
Solution: Pattern-match stderr content in
Error::user_facing_error()to detect 4 common failure modes and produce actionable messages:Script exited with code 1: mkdir: cannot create directory...Cannot create install directory — check write permissions on your home directoryScript exited with code 2: tar: No space left on device...(hundreds of lines)Not enough disk space on the remote host — free up space and try againScript exited with code 255:(empty)SSH connection was lost during installation — please reconnect and try againScript exited with code 2: unsupported arch: armv7lThis remote host uses a armv7l processor, which is not supported. Warp SSH extension requires x86_64 or aarch64 (arm64).Unrecognized errors fall through to the existing truncated-stderr format.
Linked Issue
ready-to-specorready-to-implement.Testing
Unit tests (all passing):
cargo test -p remote_server -- transport::tests— 12 passed, 0 failedcargo fmt/cargo clippy— cleanNew tests (12 total):
script_failed_permission_denied_produces_targeted_messagescript_failed_read_only_fs_produces_targeted_messagescript_failed_disk_full_produces_targeted_messagescript_failed_curl_write_failure_produces_disk_full_messagescript_failed_ssh_disconnect_produces_targeted_messagescript_failed_ssh_disconnect_only_whitespace_stderrscript_failed_ssh_255_with_stderr_uses_defaultscript_failed_unsupported_arch_produces_targeted_messagescript_failed_default_format_for_unrecognised_errorscript_failed_truncates_long_stderr_in_default_formatscript_failed_body_reflects_stagetimed_out_error_message/other_error_has_no_detailImpact: Addresses permission denied (4.5%), disk full (3.7%), SSH disconnect (1.6%), unsupported arch (3.2%) — ~13% of errors get improved messages.
./script/runAgent Mode
Co-Authored-By: Oz oz-agent@warp.dev
CHANGELOG-IMPROVEMENT: Improved error messages for SSH extension install failures (permission denied, disk full, SSH disconnect)