mingo-app / mingo

Found a bug? have a FR ?
60 stars 2 forks source link

Can't connect to mongo using SSH #594

Closed popstr closed 1 year ago

popstr commented 1 year ago

I am well aware that this probably isn't a bug, but I have found no other support forum. Please let me know if it exists.

Describe the bug Trying to connect to database through ssh gives "Server selection timed out after 5000 ms". I am using the "Connect via SSH" feature, supplying my private key. This works great in Studio3T (which I want to move away from). URL is mongodb://user:PASSWORDPLACEHOLDER@localhost:27018/clinicalDB?authSource=admin (And yes, 27018 is the correct port, since i have several mongodb instances running on that server :) )

If i start an ssh tunnel manually using the native ssh client, connection works great. I just would like to not have to fiddle with that every single day.

I have googled and googled for this issue, but nothing seem to fit my scenario. It's probably just a simple thing. I checked the logs on the server side, but there is nothing (i guess Mingo can't reach all the way to the server). Please let me know what else I can do to troubleshoot this. Is there a debug log in Mingo for example?

Screenshots

Skärmavbild 2023-06-19 kl  09 46 06

Desktop (please complete the following information):

popstr commented 1 year ago

I also found this thread on StackOverflow with the same issue, but it did not get any attention at all: https://stackoverflow.com/questions/76056821/issues-with-connection-to-mongo-via-ssh-got-message-mongoserverselectionerror

tothradoslav commented 1 year ago

Thank you for this. I will try to reproduce your error. We have been using mingo to connect via ssh and it worked fine, but this could be something specific.

tothradoslav commented 1 year ago

Trying to reproduce your error, but it works fine on my macOS using SSH. So I will need more details to be able to reproduce and then fix this.

I have added more debugging options, which we will add to the next release and we should be able to debug this.

popstr commented 1 year ago

I can see that mingo is opening A LOT of ports.. Maybe it's related to my problems? process id 7142 here is mingo:

Screenshot 2023-06-26 at 08 51 57
popstr commented 1 year ago

The ports that mingo is using for ssh tunnels (i suppose) are some of the same ports i use in my local software development (8080+). That means mingo could start an ssh tunnel on the same port where I run my applications.

This doesn't seem to be the problem here though.

Why are you using such a low series of port numbers (8000+)? Wouldn't it make more sense to use much higher numbers?

tothradoslav commented 1 year ago

Do all those ports stay opened even when you close mingo? Do they get opened immediately after mingo starts or it just keeps adding up as you are using mingo?

popstr commented 1 year ago

I don't remember now, and my trial has expired so I can't check. Maybe someone with a license can.

tothradoslav commented 1 year ago

@popstr Please send us an email to info@mingo.io and I will grant you access to mingo (a license). Thanks!