Skip to content

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
devin/1774054582-source-postgres-unicode-escape-error-handler
Draft

fix(source-postgres): Add error handler for unsupported Unicode escape sequence (AI-Triage PR)#75266
devin-ai-integration[bot] wants to merge 2 commits intomasterfrom
devin/1774054582-source-postgres-unicode-escape-error-handler

Conversation

@devin-ai-integration
Copy link
Contributor

What

Adds error handling for the PostgreSQL unsupported Unicode escape sequence PSQLException in source-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 as system_error, causing unnecessary retries (the data won't change between attempts). Now it is classified as config_error with 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 ConnectorErrorProfile entry in PostgresSourceExceptionHandler.initializeErrorDictionary() that matches (?i).*unsupported Unicode escape sequence.* and maps it to a CONFIG failure type with a specific external message.

Review guide

  1. PostgresSourceExceptionHandler.kt — new error profile (lines 201–217)
  2. PostgresSourceExceptionHandlerTest.kt — unit test for the new profile

Key review questions:

  • Is CONFIG the right FailureType? The user needs to clean \u0000 from 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 whether TRANSIENT or leaving as system_error is more appropriate.
  • Version bump: This diff does not include a connector version bump in metadata.yaml. A reviewer should determine if one is needed to ship this change.
  • Error message wording: The message includes remediation guidance ("Remove or replace null characters…"), which follows the existing convention in this handler but may not align with newer error message guidelines that prefer remediation in docs/UI only.

User Impact

Users whose PostgreSQL source databases contain JSON/JSONB data with \u0000 null 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 a config_error (no retries) rather than retrying 3 times as a system_error.

Can this PR be safely reverted and rolled back?

  • YES 💚

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

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

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

PR Slash Commands

Airbyte Maintainers (that's you!) can execute the following slash commands on your PR:

  • 🛠️ Quick Fixes
    • /format-fix - Fixes most formatting issues.
    • /bump-version - Bumps connector versions, scraping changelog description from the PR title.
  • ❇️ AI Testing and Review (internal link: AI-SDLC Docs):
    • /ai-prove-fix - Runs prerelease readiness checks, including testing against customer connections.
    • /ai-canary-prerelease - Rolls out prerelease to 5-10 connections for canary testing.
    • /ai-review - AI-powered PR review for connector safety and quality gates.
  • 🚀 Connector Releases:
    • /publish-connectors-prerelease - Publishes pre-release connector builds (tagged as {version}-preview.{git-sha}) for all modified connectors in the PR.
    • /bump-progressive-rollout-version - Bumps connector version with an RC suffix (2.16.10-rc.1) for progressive rollouts (enableProgressiveRollout: true).
      • Example: /bump-progressive-rollout-version changelog="Add new feature for progressive rollout"
  • ☕️ JVM connectors:
    • /update-connector-cdk-version connector=<CONNECTOR_NAME> - Updates the specified connector to the latest CDK version.
      Example: /update-connector-cdk-version connector=destination-bigquery
  • 🐍 Python connectors:
    • /poe connector source-example lock - Run the Poe lock task on the source-example connector, committing the results back to the branch.
    • /poe source example lock - Alias for /poe connector source-example lock.
    • /poe source example use-cdk-branch my/branch - Pin the source-example CDK reference to the branch name specified.
    • /poe source example use-cdk-latest - Update the source-example CDK dependency to the latest available version.
  • ⚙️ Admin commands:
    • /force-merge reason="<REASON>" - Force merges the PR using admin privileges, bypassing CI checks. Requires a reason.
      Example: /force-merge reason="CI is flaky, tests pass locally"
📚 Show Repo Guidance

Helpful Resources

📝 Edit this welcome message.

Co-Authored-By: bot_apk <apk@cognition.ai>
@github-actions
Copy link
Contributor

source-postgres Connector Test Results

332 tests   331 ✅  14m 0s ⏱️
 38 suites    1 💤
 38 files      0 ❌

Results for commit 222b6db.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant