Skip to content

fix(databricks): surface an actionable error for a missing SQL warehouse - #73095

Merged
Gilbert09 merged 1 commit into
masterfrom
posthog-code/databricks-warehouse-not-found-error
Jul 23, 2026
Merged

fix(databricks): surface an actionable error for a missing SQL warehouse#73095
Gilbert09 merged 1 commit into
masterfrom
posthog-code/databricks-warehouse-not-found-error

Conversation

@Gilbert09

Copy link
Copy Markdown
Member

Problem

The Databricks source-creation wizard shows a generic "Could not connect to Databricks. Please check all connection details are valid." for a very common setup mistake: an HTTP path pointing at a SQL warehouse that was mistyped or deleted. That message gives the user nothing to act on, and it was the single biggest bucket of Databricks setup failures.

The root cause is drift between two error maps. The sync-time get_non_retryable_errors map already recognizes RESOURCE_DOES_NOT_EXIST and tells the user their warehouse is gone, but the validate-time DatabricksErrors map (used during source creation) never got the same entry. So a bad warehouse in the HTTP path was recognized during sync but fell through to the generic catch-all at create time.

Changes

  • Add RESOURCE_DOES_NOT_EXIST to the validate-time error map with a message that points the user at the HTTP path field.
  • Extend the existing test_validate_credentials_maps_connection_errors parameterized test with a case for it.

How did you test this code?

Extended the existing parameterized test_validate_credentials_maps_connection_errors test with a RESOURCE_DOES_NOT_EXIST case. It catches the regression where that mapping is dropped or mis-keyed and a wrong/deleted warehouse silently reverts to the generic message. Ran the test locally, all 7 cases pass. Also ran ruff check and format over the touched files.

🤖 Agent context

Autonomy: Fully autonomous

I (Claude) triaged a day of Databricks warehouse-source-creation failures and found they were all the generic "could not connect" fallback. Comparing the validate-time and sync-time error maps surfaced the missing RESOURCE_DOES_NOT_EXIST entry as a concrete, minimal fix. I kept the change to a single mapping plus one parameterized test case rather than broadening the reused message from the sync map, since that map's wording tells users to "resync" which is wrong in the create flow. Invoked the /writing-tests skill before adding the test.


Created with PostHog Code

The validate-credentials error map was missing the RESOURCE_DOES_NOT_EXIST
case that the sync-time non-retryable map already handles, so a mistyped or
deleted SQL warehouse in the HTTP path fell through to the generic "Could not
connect to Databricks" message. Map it to an actionable message pointing at
the HTTP path.

Generated-By: PostHog Code
Task-Id: bcf35e5a-9e8d-4794-8256-810b0e99cb65
@Gilbert09 Gilbert09 added the stamphog Request AI approval (no full review) label Jul 23, 2026 — with PostHog

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Trivial, contained error-message mapping addition with matching test coverage, by an author on the owning team; no showstoppers.

Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 3L, 1F substantive, 4L/2F incl. docs/generated/snapshots — within ceiling
tier T1-agent / T1a-trivial (4L, 2F, single-area, fix)
stamphog 2.0.0b3 .stamphog/policy.yml @ 24c0565 · reviewed head d2de662

@trunk-io

trunk-io Bot commented Jul 23, 2026

Copy link
Copy Markdown

😎 This pull request was merged.

@github-actions

Copy link
Copy Markdown
Contributor

Hey @Gilbert09! 👋

It looks like your git author email on this PR isn't your @posthog.com address (owerstom@gmail.com). Since you're on the PostHog team, it's worth pointing your local git author email at your @posthog.com address. Why it matters:

  • Consistent work identity in git history — internal tooling that attributes commits to team members keys off your @posthog.com address.
  • Keeps team contributions easy to tell apart from external community ones when scanning history.

You can fix it for this repo with:

git config user.email "you@posthog.com"

Or set it globally with git config --global user.email "you@posthog.com". No need to redo this PR — just a nudge for next time. 🙂

@pr-assigner-resolver-posthog
pr-assigner-resolver-posthog Bot requested a review from a team July 23, 2026 09:20
@Gilbert09
Gilbert09 merged commit be61536 into master Jul 23, 2026
499 of 521 checks passed
@Gilbert09
Gilbert09 deleted the posthog-code/databricks-warehouse-not-found-error branch July 23, 2026 09:55
@deployment-status-posthog

deployment-status-posthog Bot commented Jul 23, 2026

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-07-23 10:16 UTC Run
prod-us ✅ Deployed 2026-07-23 10:36 UTC Run
prod-eu ✅ Deployed 2026-07-23 10:37 UTC Run

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

Labels

stamphog Request AI approval (no full review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant