fix: raise AirbyteTracedException with config_error in SelectiveAuthenticator#1007
Draft
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Draft
Conversation
…nticator Replace ValueError with AirbyteTracedException in SelectiveAuthenticator for both missing config path and unrecognized authenticator key cases. - Sets failure_type=config_error (was system_error via generic fallback) - Provides clear user-facing message naming the specific config field - Includes detailed internal_message for debugging - Fixes the generic 'Something went wrong in the connector' fallback Co-Authored-By: bot_apk <apk@cognition.ai>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This CDK VersionYou can test this version of the CDK using the following: # Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@devin/1777540915-fix-selective-authenticator-error-message#egg=airbyte-python-cdk[dev]' --help
# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch devin/1777540915-fix-selective-authenticator-error-messagePR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
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.
Summary
Replaces
ValueErrorwithAirbyteTracedExceptioninSelectiveAuthenticatorfor both error cases (missing config path and unrecognized authenticator key).Before: When
SelectiveAuthenticatorcould not find the auth selection path in the config (e.g., missingcredentials.auth_type), it raised a plainValueError. The CDK's global exception handler wrapped this into a genericAirbyteTracedExceptionwithmessage=Noneandfailure_type=system_error, which surfaced to the user as:"Something went wrong in the connector. See the logs for more details."After:
SelectiveAuthenticatornow raisesAirbyteTracedExceptiondirectly with:messagenaming the specific config field (e.g.,Required field "credentials.auth_type" is missing from connector configuration.)internal_messagefor debugging (includes the full path and available config keys)failure_type=FailureType.config_errorinstead ofsystem_errorThis also converts the second error case (unrecognized authenticator key) from a try/except
KeyErrorto a guard statement, following the coding standards preference for upfront checks.Impact: Fixes the error for all connectors using
SelectiveAuthenticator, includingsource-google-analytics-data-api(the connector that triggered this issue). Theconfig_errorclassification stops unnecessary Sentry alerts and tells the platform the user needs to fix their configuration.Resolves https://github.com/airbytehq/airbyte-internal-issues/issues/16267
Related to https://github.com/airbytehq/oncall/issues/12125
Review & Testing Checklist for Human
config_erroris the correctFailureType— this stops retries for affected syncs, which is appropriate since missingauth_typerequires a config changeNotes
SelectiveAuthenticatorbenefit.internal_messageincludes available config keys for the missing-path case and available authenticator keys for the unrecognized-value case, aiding debugging.FailureTypereclassification (system_error→config_error) stops retries, which is correct since the error genuinely requires user action.Link to Devin session: https://app.devin.ai/sessions/b34bbdcc89b74b47940bf4532f3d5e5f