dbgate / dbgate

Database manager for MySQL, PostgreSQL, SQL Server, MongoDB, SQLite and others. Runs under Windows, Linux, Mac or as web application
https://dbgate.org
GNU General Public License v3.0
5.34k stars 308 forks source link

SSH Tunnel does not work: ECONNREFUSED 127.0.0.1 #656

Open sky0hunter opened 11 months ago

sky0hunter commented 11 months ago

https://github.com/dbgate/dbgate/blob/aea2c64703bbdd2a2937e51a8ffd57cbe41d8b3b/packages/api/src/utility/connectUtility.js#L55

I've notcied that the SSH tunnel that is generated listens on IPv6 only on my system ( [::1]:10000 ), when the app is trying to connect to 127.0.0.1:10000 it fails.

I did build a version locally where I changed the "127.0.0.1" to "localhost", which should work for both, IPv4 and IPv6, in my case this fixed the problem.

ProjectInfinity commented 11 months ago

What platform are you on and how did you install DbGate?

mattskinosix commented 9 months ago

Same here, I use archlinux

Error: connect ECONNREFUSED 127.0.0.1:10001 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16)

Error JSON: { "errno": -111, "code": "ECONNREFUSED", "syscall": "connect", "address": "127.0.0.1", "port": 10001 } Connection: { "server": "", "engine": "postgres@dbgate-plugin-postgres", "sshMode": "agent", "sshKeyfile": "", "useSshTunnel": true, "user": "", "password": "", "sshLogin": "", "sshHost": "", "unsaved": false, "_id": "", "databases": "", "status": "", "displayName": "", "connectionColor": "***" }

Platform: linux

If I do tunnelling manually it works on the same port.

Pavel-Husakouski commented 9 months ago

Same for me, Manjaro linux, Arch linux, Endeavour. Installed from AUR Being run from AppImage works fine. Looks like it is an AUR package issue

mattskinosix commented 8 months ago

Same for me, Manjaro linux, Arch linux, Endeavour. Installed from AUR Being run from AppImage works fine. Looks like it is an AUR package issue

Yes I confirm, from AppImage works!

lucaspereirasouzat commented 5 months ago

on .deb popos version breaks

ProjectInfinity commented 5 months ago

on .deb popos version breaks

Make sure you are on latest beta. And what do you mean breaks? Run from terminal and post output.