fix(source-postgres): Add error handler for unsupported Unicode escape sequence (AI-Triage PR)#75266
Draft
devin-ai-integration[bot] wants to merge 2 commits intomasterfrom
Conversation
…e sequence Add a ConnectorErrorProfile for the 'unsupported Unicode escape sequence' PSQLException to PostgresSourceExceptionHandler. This error occurs when the source PostgreSQL database contains JSON/JSONB data with null character (\u0000) escape sequences. Previously, this error fell through to the generic 'Something went wrong in the connector' message classified as system_error, causing unnecessary retries. Now it is correctly classified as config_error with an actionable message directing users to clean up their source data. Related to airbytehq/oncall#11724 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:
|
Contributor
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksPR Slash CommandsAirbyte Maintainers (that's you!) can execute the following slash commands on your PR:
📚 Show Repo GuidanceHelpful Resources
|
Co-Authored-By: bot_apk <apk@cognition.ai>
Contributor
|
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.
What
Adds error handling for the PostgreSQL
unsupported Unicode escape sequencePSQLException insource-postgres. This error occurs when JSON/JSONB columns in the source database contain null character (\u0000) escape sequences, which PostgreSQL's JDBC driver cannot process.Previously, this error fell through to the generic
"Something went wrong in the connector"message classified assystem_error, causing unnecessary retries (the data won't change between attempts). Now it is classified asconfig_errorwith an actionable message.Resolves https://github.com/airbytehq/oncall/issues/11724:
Related prior art on the destination side: #5336, #3476
Error message improvement issue: https://github.com/airbytehq/airbyte-internal-issues/issues/16084
How
Added a new
ConnectorErrorProfileentry inPostgresSourceExceptionHandler.initializeErrorDictionary()that matches(?i).*unsupported Unicode escape sequence.*and maps it to aCONFIGfailure type with a specific external message.Review guide
PostgresSourceExceptionHandler.kt— new error profile (lines 201–217)PostgresSourceExceptionHandlerTest.kt— unit test for the new profileKey review questions:
CONFIGthe rightFailureType? The user needs to clean\u0000from their source data to resolve this — retries won't help. However, it's arguably a data quality issue rather than a misconfiguration. Open to feedback on whetherTRANSIENTor leaving assystem_erroris more appropriate.metadata.yaml. A reviewer should determine if one is needed to ship this change.User Impact
Users whose PostgreSQL source databases contain JSON/JSONB data with
\u0000null characters will now see a specific, actionable error message instead of the generic "Something went wrong in the connector." The sync will fail immediately as aconfig_error(no retries) rather than retrying 3 times as asystem_error.Can this PR be safely reverted and rolled back?
Link to Devin session: https://app.devin.ai/sessions/6ea00903b60d4f75be17c95d75b067bd