Skip to content

fix: improve SSH tunnel credential validation and error handling#1390

Draft
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/warehouse-ssh-key-error
Draft

fix: improve SSH tunnel credential validation and error handling#1390
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/warehouse-ssh-key-error

Conversation

@sentry

@sentry sentry Bot commented May 28, 2026

Copy link
Copy Markdown

This PR addresses an issue where warehouse connections configured with SSH tunneling could fail with a KeyError if required SSH credentials (specifically ssh_key) were missing from the stored configuration. Previously, this resulted in a generic HttpError: Failed to get schemas (500 Internal Server Error).

Changes Made:

  1. ddpui/utils/helpers.py - map_airbyte_keys_to_postgres_keys:
    • Replaced hard bracket access (method["ssh_key"], method["tunnel_host"], etc.) with safe .get() calls.
    • Introduced explicit validation for the presence of all required SSH tunnel fields (tunnel_host, tunnel_port, tunnel_user, and ssh_key for key-based authentication).
    • If any required field is missing, a ValueError is now raised with a descriptive message.
  2. ddpui/core/warehousefunctions.py - get_warehouse_data:
    • Modified the exception handling to specifically catch ValueError (raised by the helper function).
    • When a ValueError is caught, an HttpError(400) (Bad Request) is now returned to the user, providing a clear, actionable message about the misconfigured credentials, instead of a generic 500 error.

This ensures that misconfigured SSH tunnel connections provide a user-friendly error message, improving the debugging experience and preventing unexpected server errors.

Fixes DALGO-BACKEND-2BE

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants