fix(source-salesforce): Handle 404 NOT_FOUND errors with specific error message and correct FailureType (AI-Triage PR)#74895
Conversation
…or message and correct FailureType (AI-Triage PR) Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 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:
|
|
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. |
👋 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
|
|
|
Deploy preview for airbyte-docs ready! ✅ Preview Built with commit 7efeaf9. |
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 assystem_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
rate_limiting.py— Added a specificNOT_FOUND/ 404 handler inSalesforceErrorHandlerbefore the generic fallback. Returns a descriptive error message and classifies it asconfig_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).availability_strategy.py— Addedcodes.NOT_FOUNDto 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.Version bump 2.7.18 → 2.7.19.
Review guide
source_salesforce/rate_limiting.py— Main logic change. Verify thatconfig_erroris the appropriate FailureType for all 404 scenarios (not just missing objects).source_salesforce/availability_strategy.py— Important: Confirm that Salesforce 404 responses have the same JSON body structure ([{...}]) as 403/400 responses. If the 404 body differs, theerror.response.json()[0]call on the next line could raise an unexpected error.User Impact
"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.system_errortoconfig_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?
Link to Devin session: https://app.devin.ai/sessions/3cd347ae22944bd1bcd9c6d026c3d733