Skip to content

fix(source-salesforce): Handle 404 NOT_FOUND errors with specific error message and correct FailureType (AI-Triage PR)#74895

Draft
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1773679116-salesforce-404-error-handling
Draft

fix(source-salesforce): Handle 404 NOT_FOUND errors with specific error message and correct FailureType (AI-Triage PR)#74895
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1773679116-salesforce-404-error-handling

Conversation

@devin-ai-integration
Copy link
Contributor

What

Resolves https://github.com/airbytehq/oncall/issues/11668:

When a Salesforce instance doesn't have a particular object (e.g. Pricebook2History), the API returns a 404 NOT_FOUND. The connector was falling through to a generic error handler that produced a vague "An error occurred:" message classified as system_error, causing repeated sync failures with no actionable information for the user.

Related: https://github.com/airbytehq/airbyte-internal-issues/issues/16055 (error message quality tracking)

How

  1. rate_limiting.py — Added a specific NOT_FOUND / 404 handler in SalesforceErrorHandler before the generic fallback. Returns a descriptive error message and classifies it as config_error (since the object doesn't exist in the user's Salesforce instance, this is a configuration/selection issue, not a transient or system error).

  2. availability_strategy.py — Added codes.NOT_FOUND to the list of gracefully-handled status codes (FORBIDDEN, BAD_REQUEST, NOT_FOUND). This allows the availability check to skip streams whose objects don't exist, rather than failing the entire sync.

  3. Version bump 2.7.18 → 2.7.19.

Review guide

  1. source_salesforce/rate_limiting.py — Main logic change. Verify that config_error is the appropriate FailureType for all 404 scenarios (not just missing objects).
  2. source_salesforce/availability_strategy.pyImportant: Confirm that Salesforce 404 responses have the same JSON body structure ([{...}]) as 403/400 responses. If the 404 body differs, the error.response.json()[0] call on the next line could raise an unexpected error.

User Impact

  • Syncs that previously failed with a generic "An error occurred:" message will now show: "Salesforce object not found. The requested resource does not exist in this Salesforce instance." with the original Salesforce error details appended.
  • Streams referencing non-existent Salesforce objects will be gracefully skipped during availability checks instead of failing the entire sync.
  • The FailureType changes from system_error to config_error, which means these errors will no longer be retried and will be correctly surfaced as configuration issues.

Can this PR be safely reverted and rolled back?

  • YES 💚

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

…or message and correct FailureType (AI-Triage PR)

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@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

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


bot_apk seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@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.

@github-actions
Copy link
Contributor

source-salesforce Connector Test Results

107 tests   103 ✅  18s ⏱️
  2 suites    4 💤
  2 files      0 ❌

Results for commit 7efeaf9.

@github-actions
Copy link
Contributor

Deploy preview for airbyte-docs ready!

✅ Preview
https://airbyte-docs-ko179y5y7-airbyte-growth.vercel.app

Built with commit 7efeaf9.
This pull request is being automatically deployed with vercel-action

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.

2 participants