Skip to content

fix: raise InitializationError for invalid auth mode#1194

Open
EngHabu wants to merge 1 commit into
mainfrom
fix/sentry-50-auth-mode
Open

fix: raise InitializationError for invalid auth mode#1194
EngHabu wants to merge 1 commit into
mainfrom
fix/sentry-50-auth-mode

Conversation

@EngHabu

@EngHabu EngHabu commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Problem

An unrecognized auth mode in the creds config raised a bare ValueError from the authenticator factory (_authenticators/factory.py). During SelectCluster it gets wrapped as RuntimeError("SelectCluster failed...")RuntimeSystemError and leaked to Sentry as an SDK crash with no actionable signal — even though it's a user-config mistake.

Sentry: FLYTE-SDK-50RuntimeSystemError: ... Invalid auth mode [None] specified. Please update the creds config to use a valid value

Fix

Raise a typed InitializationError (a user-facing error already in the Sentry filter's allowlist) instead of a bare ValueError. The Sentry user-error filter walks the cause chain and now skips it, and the user still gets the clear 'update the creds config' message.

Tests

  • test_get_async_authenticator_invalid_mode_raises_initialization_error — factory raises InitializationError for None/bogus modes.
  • test_capture_exception_skips_invalid_auth_mode_wrapped_as_system_error — the wrapped RuntimeSystemError chain is filtered from Sentry.

fixes FLYTE-SDK-50

@EngHabu EngHabu added the sentry-fix Fix for an issue surfaced by Sentry label Jun 11, 2026

@EngHabu EngHabu left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

An unrecognized auth mode in the creds config previously raised a bare
ValueError from the authenticator factory. During SelectCluster it was
wrapped as RuntimeError -> RuntimeSystemError and leaked to Sentry as an
SDK crash with no actionable signal, even though it is a user-config
mistake (FLYTE-SDK-50).

Raise a typed InitializationError so the Sentry user-error filter skips
it and the user gets a clear 'update the creds config' message.

fixes FLYTE-SDK-50

Signed-off-by: Haytham Abuelfutuh <haytham@afutuh.com>
@EngHabu EngHabu force-pushed the fix/sentry-50-auth-mode branch from 8587c33 to c968bc9 Compare June 12, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sentry-fix Fix for an issue surfaced by Sentry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant