Connection Issues
DSN Format Errors
Symptom:Invalid DSN format error on startup
Common mistakes:
Authentication Failures
PostgreSQL:password authentication failed for user "username"
Access denied for user 'username'@'host'
Login failed for user 'username'
SSL/TLS Issues
Error:SSL connection required or SSL error
Solutions:
sslmode=disable: No SSLsslmode=require: SSL without certificate verification- Default (no parameter): SSL with certificate verification
Connection Timeouts
Error:Connection timeout or Could not connect to database
Solutions:
Debugging with Workbench
Enable HTTP Transport
Start DBHub with workbench:http://localhost:8080
Workbench Features
- Test SQL queries - Validate syntax before using in Claude
- Inspect results - See formatted output
- View request traces - Debug tool execution
- Test custom tools - Execute tools with parameters
- Multi-database routing - Test source_id parameter
Testing Queries in Workbench
MCP Client Integration
Claude Desktop Configuration
Config file location:- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
~ or relative paths in Claude Desktop config.
Stdio Transport Issues
Symptom: Claude Desktop shows “MCP server not responding” Check:- MCP server is using
stdiotransport (default) - Command is executable (
npxshould be in PATH) - No syntax errors in
claude_desktop_config.json - Restart Claude Desktop after config changes
- macOS:
~/Library/Logs/Claude/ - Windows:
%APPDATA%\Claude\logs\ - Linux:
~/.config/Claude/logs/
Environment Variables in Claude Desktop
Option 1: Inline in config (not recommended for secrets)~/bin/dbhub-wrapper.sh:
SSH Tunnel Issues
SSH Key Permissions
Error:Permission denied (publickey) or Bad permissions
Fix permissions:
SSH Configuration Parsing
Using SSH config files (from src/utils/ssh-config-parser.ts):SSH Tunnel Connection Failures
Error:SSH connection error: connect ECONNREFUSED
Check:
- SSH server is running on bastion
- Port 22 (or custom SSH port) is open
- Firewall allows SSH connections
- SSH user exists on bastion
SSH forward error: connect ECONNREFUSED
Check:
- Database server is reachable from bastion
- Database port (5432, 3306, 1433) is open from bastion to database
- Database is listening on specified IP (not just 127.0.0.1)
ProxyJump Issues
Error:SSH connection error (jump host 1) or SSH connection error (jump host 2)
From src/utils/ssh-tunnel.ts:70-138, connections fail sequentially:
Database-Specific Issues
PostgreSQL Schema Access
Error:relation "table_name" does not exist
Cause: Table is in a non-public schema
Solution 1: Set search_path in TOML (from src/types/config.ts:54)
SQL Server Named Instances
Error:Failed to connect to server
Solution: Specify instance name in DSN (from CLAUDE.md:147)
SQL Server Windows Authentication
Error:Login failed for user
Solution: Use NTLM authentication (from dbhub.toml.example:115-130)
SQLite File Path Issues
Error:unable to open database file
Check:
sqlite:///) followed by the path.
MySQL/MariaDB Connection Issues
Error:ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol
Cause: MySQL 8.0 uses caching_sha2_password by default
Solution: Change user authentication plugin
ECONNREFUSED on MySQL connection
Check:
Performance Issues
Query Timeouts
Error:Query execution timeout or canceling statement due to user request
Solution: Increase query timeout (from src/types/config.ts:51)
Large Result Sets
Error: Memory issues or slow responses with large datasets Solution 1: Set max_rows limitMulti-Database Routing
source_id Parameter Usage
Error:Source 'source_id' not found
Check TOML configuration:
Lazy Source Connection Errors
Error:Source 'lazy_source' not connected
Expected: Lazy sources connect on first use (from src/connectors/manager.ts:80-110)
Debug:
- Check DSN is valid
- Check database is reachable
- Check SSH tunnel config (if used)
- Review connection_timeout setting
Error Messages and Meanings
Common Error Codes
READONLY_VIOLATION (from src/tools/execute-sql.ts:61)
- Query contains non-SELECT operations in readonly mode
- Check allowed keywords for your database type
- Solution: Use
readonly = falseor change query to SELECT-only
SCHEMA_REQUIRED (from src/tools/search-objects.ts:528)
tableparameter used withoutschemaparameter- Solution: Add
schemaparameter when filtering by table
SCHEMA_NOT_FOUND (from src/tools/search-objects.ts:543)
- Specified schema does not exist in database
- Solution: Check schema name spelling, verify schema exists
INVALID_TABLE_FILTER (from src/tools/search-objects.ts:534)
tableparameter only applies to columns and indexes- Solution: Remove
tableparameter for other object types
EXECUTION_ERROR (from src/tools/execute-sql.ts:83)
- General SQL execution failure
- Check error message for database-specific details
- Common causes: syntax error, permission denied, object not found
SEARCH_ERROR (from src/tools/search-objects.ts:590)
- Error during schema object search
- Check error message for details
- Common causes: permission denied, invalid pattern
Checking Logs and Request Traces
Startup Logs
Successful startup:Request Traces in Workbench
Access traces: Open workbench (--transport http --port 8080), navigate to “Requests” tab
Trace information includes:
- Timestamp
- Source ID
- Tool name
- SQL query
- Execution time
- Success/failure status
- Error message (if failed)
Testing with curl (HTTP Transport)
Basic MCP Request
Start DBHub with HTTP transport:Testing Multi-Database Routing
Getting Help
Enable Debug Logging
Gather Information for Bug Reports
When reporting issues, include:- DBHub version: Check startup banner or
package.json - Database type and version:
SELECT version()output - Configuration: TOML config (redact credentials) or command-line args
- Error message: Full error output from logs
- Steps to reproduce: Minimal example to trigger the issue
- Environment: OS, Node.js version (
node --version)
Check Documentation
- Configuration: https://dbhub.ai/config/toml
- Tools: https://dbhub.ai/tools/execute-sql, https://dbhub.ai/tools/search-objects
- Workbench: https://dbhub.ai/workbench/overview
- GitHub Issues: https://github.com/bytebase/dbhub/issues
Common Solutions Summary
| Issue | Quick Fix |
|---|---|
| DSN format error | Check protocol prefix (postgres://, not postgresql://) |
| Authentication failure | Verify username/password, check database user grants |
| SSL error | Add ?sslmode=disable for local, ?sslmode=require for prod |
| Connection timeout | Increase connection_timeout in TOML |
| Schema not found | Set search_path in TOML for PostgreSQL |
| SSH permission denied | Fix key permissions: chmod 600 ~/.ssh/id_* |
| Read-only violation | Set readonly = false or use SELECT queries only |
| Query timeout | Increase query_timeout or optimize query |
| Large result set | Set max_rows limit or use pagination |
| Source not found | Check id in TOML matches exactly (case-sensitive) |
Contact and Support
For issues not covered here:- GitHub Issues: https://github.com/bytebase/dbhub/issues
- Documentation: https://dbhub.ai/
- Community: Check existing issues for similar problems