<#1133 fix: filter OSError(ENOSPC) from Sentry as ...
# flyte-github
a
#1133 fix: filter OSError(ENOSPC) from Sentry as user environment error Pull request opened by EngHabu Summary
OSError
with
errno=ENOSPC
("No space left on device") surfaces from
shutil._fastcopy_sendfile
during
flyte deploy
bundle uploads when the user's machine is out of disk. It is currently captured by the
@_sentry.capture_errors
decorator on the deploy CLI invoke path and reported to the SDK's Sentry project as if it were an SDK crash. Disk-full is a user environment problem the SDK cannot fix, so it shouldn't reach Sentry. This change extends
flyte/_sentry.py:_is_user_error
to recognize
OSError(errno=ENOSPC)
anywhere in the `__cause__`/`__context__` chain via a new tightly scoped helper
_is_user_environment_oserror
. The filter is intentionally narrow — only
ENOSPC
for now. Other
OSError
errnos (
EACCES
,
ENOENT
, etc.) may legitimately indicate SDK bugs and continue to be reported. A regression test pins this behavior. Closes • FLYTE-SDK-32 —
OSError: [Errno 28] No space left on device
from
shutil._fastcopy_sendfile
during deploy bundle copy.
fixes FLYTE-SDK-32
Test plan •
test_capture_exception_skips_oserror_no_space_left
— bare
OSError(ENOSPC)
is filtered. •
test_capture_exception_still_reports_other_oserror
—
PermissionError(EACCES)
is NOT filtered (regression guard against over-broad suppression). • All 22 tests in
tests/flyte/test_sentry.py
pass. •
make fmt
clean. 🤖 Generated with Claude Code flyteorg/flyte-sdk