Skip to content
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

BUG: Connect via ssh tunnel failed #757

Open
syntaxys opened this issue Apr 22, 2024 · 5 comments
Open

BUG: Connect via ssh tunnel failed #757

syntaxys opened this issue Apr 22, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@syntaxys
Copy link

Describe the bug
Can't connect to a specific MySQL host via ssh tunnel while it is possible with i. e. the app „Sequel Ace“ on the same machine. Other tunneled connections work without a problem in DbGate. Is there a way to debug this? I don't have access to the host providers log files.

Log details

Error
    at e.exports (/Applications/DbGate.app/Contents/Resources/app.asar/packages/api/dist/bundle.js:11:86455)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async process.<anonymous> (/Applications/DbGate.app/Contents/Resources/app.asar/packages/api/dist/bundle.js:456:325634)

Error JSON: {}

Connection: {
  "server": "***",
  "engine": "mariadb@dbgate-plugin-mysql",
  "sshMode": "keyFile",
  "sshKeyfile": "***",
  "displayName": "***",
  "connectionColor": "***",
  "useSshTunnel": true,
  "sshHost": "***",
  "sshLogin": "***",
  "sshKeyfilePassword": "***",
  "_id": "***",
  "unsaved": false,
  "user": "***",
  "defaultDatabase": "***",
  "singleDatabase": false,
  "password": "***",
  "parent": "***",
  "passwordMode": "saveRaw",
  "sshPassword": "***"
}

Platform: darwin

Version Information:

  • OS: MacOS Big Sur
  • App Version 5.2.7
  • Install source: installer
  • Database engine: MySQL
@ProjectInfinity
Copy link
Collaborator

ProjectInfinity commented May 17, 2024

Please try the following Beta https://github.com/dbgate/dbgate/releases/tag/v5.2.9-beta.2

@janproch janproch added the bug Something isn't working label May 27, 2024
@0rax
Copy link

0rax commented May 27, 2024

Had a similar issue on Linux with SSH tunneling no longer working running:

  • OS: Arch Linux (Linux 6.9.1)
  • App Version 5.2.8
  • Install source: AppImage
  • Database engine: PostgreSQL

Tried the latest beta (v5.2.9-beta.4) which fixed the issue for me.

@gordonlau
Copy link

The issue still persists for Linux.

  • OS: Ubuntu Linux 24.04
  • App Version: 5.3.0
  • Installation: AppImage
  • Engine: PostgreSQL

Installing older version does not work anymore. The error is still the same.

Error
    at e.exports (/tmp/.mount_dbgateWrc88x/resources/app.asar/packages/api/dist/bundle.js:2:2117465)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async process.<anonymous> (/tmp/.mount_dbgateWrc88x/resources/app.asar/packages/api/dist/bundle.js:2:2076560)

Error JSON: {}

Connection: {
  "server": "***",
  "engine": "postgres@dbgate-plugin-postgres",
  "sshMode": "keyFile",
  "sshKeyfile": "***",
  "user": "***",
  "defaultDatabase": "***",
  "displayName": "***",
  "connectionColor": "***",
  "password": "***",
  "useSshTunnel": true,
  "sshHost": "***",
  "sshLogin": "***",
  "_id": "***",
  "unsaved": false,
  "singleDatabase": true
}

Platform: linux

@gordonlau
Copy link

gordonlau commented Jun 15, 2024

Just to document for people who want to use SSH Tunnel with DBGate but is currently blocking by this issue.

It is perfectly working to use ssh command to create the ssh tunnel and set the tunnel to connect to the local port 5433.

ssh -NfL 5433:<db-host>:5432 <ssh-host>

Then you can connect to the database by connecting the local port 5433 instead. The performance seems to be better than using DBGate built-in ssh-tunnel feature.
You can also use autossh if you want to maintain the tunnel automatically.

@josbeir
Copy link

josbeir commented Jul 8, 2024

Check if

127.0.0.1 localhost

is missing in your /ets/hosts file. It was missing for me on Arch, it started working after adding it (using the flatpak version).

Authentication mode: Username & password
Didn't check Agent / key mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants