ITADN

Config file with SSH tunnel fails while equivalent command-line arguments works

#270Opendz14 创建于 2025-09-20
kind/bug
D
dz14commented
## Bug Report: Config file with SSH tunnel times out while equivalent command-line arguments work ### Description When using dblab with a YAML configuration file that includes SSH tunneling parameters, the connection times out. However, when the exact same parameters are passed via command-line arguments, the connection works successfully. ### Environment - dblab version: 0.33.0 - OS: Fedora 42 - Database: PostgreSQL - Connection type: SSH tunnel to RDS instance ### Steps to Reproduce 1. Create a `.dblab.yaml` configuration file with SSH tunnel settings: ```yaml database: - name: "database-name" host: "rds-endpoint.region.rds.amazonaws.com" port: 5432 db: "database_name" user: "db_user" password: "password" schema: "schema_name" driver: "postgres" ssl: "require" ssh-host: "bastion.host.ip" ssh-port: 22 ssh-user: "ec2-user" ssh-key: "/path/to/ssh/key.pem" ``` 2. Run dblab with the config file: ```bash dblab --config .dblab.yaml --db database-name ``` 3. Observe connection timeout ### Expected Behavior The connection should establish successfully through the SSH tunnel using the configuration file, just as it does with command-line arguments. ### Actual Behavior The connection times out when using the configuration file. ### Workaround The same connection works when all parameters are passed as command-line arguments: ```bash dblab --host rds-endpoint.region.rds.amazonaws.com \ --user db_user \ --pass 'password' \ --db database_name \ --schema schema_name \ --ssl require \ --port 5432 \ --driver postgres \ --limit 50 \ --ssh-host bastion.host.ip \ --ssh-port 22 \ --ssh-user ec2-user \ --ssh-key /path/to/ssh/key.pem ``` ### Additional Context - The issue appears to be specific to how SSH tunnel connections are established when using a configuration file vs command-line arguments - Command-line version establishes the SSH tunnel and connects to the database without any issues - The same configuration values work perfectly when passed as CLI arguments but fail when loaded from YAML ### Impact Users cannot use configuration files for SSH tunnel connections, forcing them to use lengthy command-line arguments or create shell aliases as a workaround.
0 条评论