fix: improve ERROR_READING_FILE message and raise AirbyteTracedException with system_error#955
Draft
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Draft
Conversation
…ion with system_error Replace misleading credential-focused error message with accurate 'File read failed during availability check.' message. Raise AirbyteTracedException with FailureType.system_error instead of CheckAvailabilityError, since the error is not necessarily caused by invalid credentials. Resolves airbytehq/airbyte-internal-issues#16082 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/1774038090-improve-error-reading-file-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/1774038090-improve-error-reading-file-messagePR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
…n is caught by check_connection Co-Authored-By: bot_apk <apk@cognition.ai>
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
Improves the generic
ERROR_READING_FILEerror in the file-based CDK availability strategy. The previous message ("Error opening file. Please check the credentials provided...") was misleading because file read failures during availability checks are not necessarily credential issues — they can be caused by dependency conflicts, corrupted files, or transient I/O errors.Changes:
exceptions.py: UpdatedERROR_READING_FILEmessage from credential-focused text to"File read failed during availability check."default_file_based_availability_strategy.py: In_check_parse_record, the catch-allexcept Exceptionnow raisesAirbyteTracedExceptionwithFailureType.system_errorinstead ofCheckAvailabilityError. Theinternal_messagepreserves the file URI, stream name, and original exception for debugging.No test changes were required. The
AirbyteTracedExceptionraised here is caught upstream bycheck_connectioninfile_based_source.py, which wraps it withconfig_errorand returns a gracefulconnectionStatus: FAILED— so the existing test scenarios continue to expect a returned status object (not a raised exception).Resolves https://github.com/airbytehq/airbyte-internal-issues/issues/16082
Related to https://github.com/airbytehq/oncall/issues/11723
Review & Testing Checklist for Human
AirbyteTracedException(system_error)propagates out of_check_parse_recordand is caught bycheck_connectioninfile_based_source.py(lines ~204-230), which wraps it into a newAirbyteTracedException(config_error). The entrypoint then handlesconfig_errorgracefully (returnsconnectionStatus: FAILED). Confirm this is the desired end-to-end behavior — in particular thatsystem_errorbeing re-wrapped asconfig_erroris acceptable.CheckAvailabilityErrorcatch sites: Verify no other code paths catchCheckAvailabilityErrorspecifically and would now miss theAirbyteTracedException."File read failed during availability check."is accurate but gives the user no remediation hint. Consider whether a follow-up sentence is needed.Recommended test plan: Run the file-based check scenario tests (
test_file_based_check[error_reading_file_scenario]andtest_file_based_check[error_multi_stream_scenario]) and confirm they pass. CI already passes these.Notes
ERROR_LISTING_FILESenum value still has the old credential-focused message pattern — that's a separate concern and intentionally not changed here.set_expected_check_errorto expectAirbyteTracedException) were reverted after CI showed the exception is handled internally bycheck_connection, not raised to the test harness.Link to Devin session: https://app.devin.ai/sessions/924b76b526934bf59aedb5cbb21d7e43