Repository navigation
fix(no-ticket): do not report an input/output error from the terminal - #588
Open
cloudsmith-iduffy wants to merge 4 commits into
Open
cloudsmith-iduffy wants to merge 4 commits into
cloudsmith-iduffy wants to merge 4 commits into
Conversation
When the terminal closes or the SSH session drops while a command runs, the next write to stdout or stderr fails with OSError EIO. The error reached AliasGroup.main, and the CLI sent it to Sentry as a crash. Treat EIO as a device error in is_reportable. The CLI still shows the error and exits with status 1. Fixes CLOUDSMITH-CLI-2B Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The changelog incorrectly guarantees exit status 1 for EIO on a hung-up terminal, while a failed buffered stdout flush during shutdown can still produce status 120.
1 open issue
What changed in this PR
This PR suppresses telemetry reports for OSError exceptions with errno.EIO, including terminal disconnections, without changing existing error handling.
Changes:
- Exclude EIO errors from telemetry reporting.
- Add a regression test confirming no report is sent.
- Document the behavior in the changelog.
| File | Description |
|---|---|
cloudsmith_cli/core/tests/test_telemetry.py |
Tests that EIO exceptions produce no telemetry events. |
cloudsmith_cli/core/telemetry.py |
Marks EIO exceptions as non-reportable. |
CHANGELOG.md |
Describes suppression of EIO error reports. |
Review effort: Balanced
The change only stops the error report. The exit status after a failed write to a closed terminal depends on the platform. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cloudsmith-iduffy
marked this pull request as ready for review
November 5, 2026 11:20
Copilot started work to resolve merge conflicts on behalf of
cloudsmith-iduffy
November 11, 2026 21:39
…/fix-terminal-hangup-eio # Conflicts: # CHANGELOG.md Co-authored-by: cloudsmith-iduffy <178375997+cloudsmith-iduffy@users.noreply.github.com>
This branch has not been deployed
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
Sentry CLOUDSMITH-CLI-2B is an
OSError: [Errno 5] Input/output errorfromcloudsmith push, raised increate_package. That function only writes progress to the terminal and calls the API, and the error has no file name. So the error comes from a write to a terminal that is gone.When the terminal closes or the SSH session drops while a command runs, the next write to stdout or stderr fails with EIO. The error reaches
AliasGroup.main, and the CLI sends it to Sentry as a crash. The CLI cannot fix the terminal, so the report gives us nothing to act on.This PR makes
is_reportablereturn false for anOSErrorwitherrno.EIO. The CLI still shows the error and exits with status 1.To see the change, run a command with stdout on a pty whose other end is closed:
On master, the CLI prints
Error: OSError: [Errno 5] Input/output errorand sends a report. With this PR, it prints the same line and sends nothing.Fixes CLOUDSMITH-CLI-2B
Type of Change
Additional Notes
A disk read that fails with EIO is also not reported now. That is a hardware problem, not a CLI bug, and the user still sees the error.
🤖 Generated with Claude Code