Skip to content

fix: raise AirbyteTracedException with config_error in SelectiveAuthenticator#1007

Draft
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1777540915-fix-selective-authenticator-error-message
Draft

fix: raise AirbyteTracedException with config_error in SelectiveAuthenticator#1007
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1777540915-fix-selective-authenticator-error-message

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

Summary

Replaces ValueError with AirbyteTracedException in SelectiveAuthenticator for both error cases (missing config path and unrecognized authenticator key).

Before: When SelectiveAuthenticator could not find the auth selection path in the config (e.g., missing credentials.auth_type), it raised a plain ValueError. The CDK's global exception handler wrapped this into a generic AirbyteTracedException with message=None and failure_type=system_error, which surfaced to the user as: "Something went wrong in the connector. See the logs for more details."

After: SelectiveAuthenticator now raises AirbyteTracedException directly with:

  • A clear user-facing message naming the specific config field (e.g., Required field "credentials.auth_type" is missing from connector configuration.)
  • A detailed internal_message for debugging (includes the full path and available config keys)
  • failure_type=FailureType.config_error instead of system_error

This also converts the second error case (unrecognized authenticator key) from a try/except KeyError to a guard statement, following the coding standards preference for upfront checks.

Impact: Fixes the error for all connectors using SelectiveAuthenticator, including source-google-analytics-data-api (the connector that triggered this issue). The config_error classification 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

  • Verify the user-facing messages follow the error message guidelines — no remediation hints, deterministic, under 120 chars
  • Confirm config_error is the correct FailureType — this stops retries for affected syncs, which is appropriate since missing auth_type requires a config change

Notes

  • The fix is at the CDK level, not connector level. All connectors using SelectiveAuthenticator benefit.
  • The internal_message includes available config keys for the missing-path case and available authenticator keys for the unrecognized-value case, aiding debugging.
  • This is a non-breaking change (patch). Error messages are not part of the public API contract. The FailureType reclassification (system_errorconfig_error) stops retries, which is correct since the error genuinely requires user action.

Link to Devin session: https://app.devin.ai/sessions/b34bbdcc89b74b47940bf4532f3d5e5f

…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>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link
Copy Markdown

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

Testing This CDK Version

You 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-message

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /autofix - Fixes most formatting and linting issues
  • /poetry-lock - Updates poetry.lock file
  • /test - Runs connector tests with the updated CDK
  • /prerelease - Triggers a prerelease publish with default arguments
  • /poe build - Regenerate git-committed build artifacts, such as the pydantic models which are generated from the manifest JSON schema in YAML.
  • /poe <command> - Runs any poe command in the CDK environment
📚 Show Repo Guidance

Helpful Resources

📝 Edit this welcome message.

@github-actions
Copy link
Copy Markdown

PyTest Results (Fast)

4 042 tests  +2   4 031 ✅ +2   7m 52s ⏱️ +7s
    1 suites ±0      11 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit e3ab68a. ± Comparison against base commit 886fcf8.

@github-actions
Copy link
Copy Markdown

PyTest Results (Full)

4 045 tests  +2   4 033 ✅ +2   11m 20s ⏱️ -3s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit e3ab68a. ± Comparison against base commit 886fcf8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants