Skip to content

fix(core): Don't swallow connection errors when fetching credentials #16181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2025

Conversation

despairblue
Copy link
Contributor

@despairblue despairblue commented Jun 10, 2025

Summary

We have had multiple reports of executions failing, because the credential could not be found:
Credential with ID "305" does not exist for type "googleBigQueryOAuth2Api".
image

Sometimes these have been false positives, because the error thrown by TypeORM was actually a connection error that we just ignore.
This PR first checks if the error thrown is an EntityNotFoundError before replacing it with a CredentialNotFoundError.
If it's any other error it will be re-thrown so that user reports contain the correct error when they report this. (most of the time it's this, but we can't be sure because we're hiding it).

Related Linear tickets, Github issues, and Community forum posts

https://n8nio.slack.com/archives/C035KBDA917/p1748612791750639

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

Copy link

codecov bot commented Jun 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Jun 10, 2025
@despairblue despairblue marked this pull request as ready for review June 10, 2025 12:25
@despairblue despairblue requested a review from ivov June 10, 2025 12:25
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cubic reviewed 2 files and found no issues. Review PR in cubic.dev.

Copy link
Contributor

@ivov ivov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! We might want a lint rule to prevent specifying an unused error arg in a catch block.

Copy link
Contributor

✅ All Cypress E2E specs passed

@despairblue
Copy link
Contributor Author

Nice catch! We might want a lint rule to prevent specifying an unused error arg in a catch block.

This could also help a little: https://www.typescriptlang.org/tsconfig/#useUnknownInCatchVariables

@despairblue despairblue merged commit 9f83fcc into master Jun 11, 2025
45 checks passed
@despairblue despairblue deleted the fix-hiding-db-connection-errors branch June 11, 2025 08:08
This was referenced Jun 11, 2025
@janober
Copy link
Member

janober commented Jun 11, 2025

Got released with [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants