mongodb-js / compass

The GUI for MongoDB.
https://mongodb.com/compass
Other
1.15k stars 176 forks source link

connect ETIMEDOUT with SSH tunneling after upgrading from 1.26.1 to 1.27 #2311

Closed ye-petrov closed 3 years ago

ye-petrov commented 3 years ago

Bug Report

Current Behavior

Timing out when trying to connect to a "non-genuine mongo db" (AWS) through SSH tunnel, both built-in or external.

Expected Behavior/Code

Get connected.

Environment

Possible Solution

Downgrade to 1.26.1

Additional Context/Screenshots

I couldn't connect immediately after upgrading from 1.26.1 to 1.27. I was then able to find version 1.26.1 on my machine, run it alongside version 1.27, and the older version was able to connect just fine. Same connection string was used.

I tried two methods of SSH tunneling:

  1. Built-in
  2. A batch file containing `ssh -L 9999:something.docdb.amazonaws.com:27017 ec2-user@ -i key.pem

Both methods show same result.

DrakeAnglin commented 3 years ago

I am also getting timeout issue

charleskoehl commented 3 years ago

I'm not using SSH but I also get a timeout on 2 different connections that were working right before I upgraded from 1.26.1 to 1.27.

mongodb://:@elb-xxxxxxx-123456.aptible.in:27017/db?ssl=true

charleskoehl commented 3 years ago

Perhaps it has something to do with the commits for this issue. (Found by comparing 1.26.1 to 1.27.0)

AnatoleAM commented 3 years ago

Can't connect through kubectl port-forward after this update. It's fine after downgrading to 1.26.1.

gribnoysup commented 3 years ago

Hey y'all! Thanks for reporting the issue, just wanted to say that we acked and will look into this shortly. @charleskoehl you might be right, we updated Node.js driver in Compass to v4 and there might be some breaking changes that are causing issues that we missed during testing

gribnoysup commented 3 years ago

Are you all trying to connect using connection from favorites/history after the update? If that's the case, can you try creating a new connection with the same configuration instead? It would also help if you could share more connection info (excluding all private information of course) for those specific connections that stopped working for you if possible

gribnoysup commented 3 years ago

Another thing you can try doing to help us debug is trying to connect to your servers using latest version of mongosh. So far we are not able to reproduce the issue locally, so trying to limit the possibilities. mongosh is also using Node.js driver v4 and we are trying to confirm if that might be the thing that's causing the issue here

ye-petrov commented 3 years ago

Are you all trying to connect using connection from favorites/history after the update?

Same behavior if I simply Ctrl+C/Ctrl+V the connection string into 1.27 as new connection without using the favorites/history panel.

trying to connect to your servers using latest version of mongosh

Yep. Updated the shell, it works fine.

C:\Program Files\MongoDB\Server\4.4\bin>mongo mongodb://USERNAME:PASSWORD@localhost:9999
MongoDB shell version v4.4.6
connecting to: mongodb://localhost:9999/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("e8ec1503-79ef-4b08-b961-0bcb95485043") }
MongoDB server version: 4.0.0
WARNING: shell and server versions do not match

Warning: Non-Genuine MongoDB Detected

This server or service appears to be an emulation of MongoDB rather than an official MongoDB product.

Some documented MongoDB features may work differently, be entirely missing or incomplete, or have unexpected performance characteristics.

To learn more please visit: https://dochub.mongodb.org/core/non-genuine-mongodb-server-warning.
rs0:PRIMARY>
gribnoysup commented 3 years ago

Thanks for trying it all out! This confirms one of our suspicions and I think we finally found the root cause, the fix is on its way in #2314. In the meantime you can try using the builds produced by CI in this PR (scroll to the bottom to see artifacts), this hopefully should resolve the issue: https://github.com/mongodb-js/compass/actions/runs/993292805

ye-petrov commented 3 years ago

try using the builds produced by CI in this PR (scroll to the bottom to see artifacts), this hopefully should resolve the issue: https://github.com/mongodb-js/compass/actions/runs/993292805

Yes, I can confirm that Windows build 146 works.

Anemy commented 3 years ago

Nice - we've just released a new version of Compass 1.27.1 which has the fix for this connectivity issue, if you have a moment can you install it and see if the issue is solved? Thanks! And sorry for the inconvenience. Going to close this issue, feel free to reopen if you've updated and the connection is not working as expected.

https://github.com/mongodb-js/compass/releases/tag/v1.27.1

DrakeAnglin commented 3 years ago

I seem to still be having connection timeout issues with the 1.27.1. When i roll back to 1.26.1 it works.

image

Anemy commented 3 years ago

@DrakeAnglin Could you tell us a bit more about your connection configuration? Are you connecting to a replica set? Standalone? Single member in a replica set? TLS/SSL? SSH tunnel? How are you authenticating? Thanks, we'd like to get it working smooth for you.

DrakeAnglin commented 3 years ago

@Anemy Yes, I am connecting to a replica set, readPreference=primary, ssl=true. Not sure what you're looking for on how im authenticating, but i am using our application functional account with admin access using the user name and password via the mongodb.net hostname.

charleskoehl commented 3 years ago

1.27.1 working for me too. Thank you!

gribnoysup commented 3 years ago

Hey @DrakeAnglin, as your error message is different from what other people were getting in this thread and the fix from 1.27.1 worked for the person who opened the issue in the first place, I moved your comment to the new issue #2320, so please let's continue the discussion there

ye-petrov commented 3 years ago

Nice - we've just released a new version of Compass 1.27.1 which has the fix for this connectivity issue, if you have a moment can you install it and see if the issue is solved? Thanks! And sorry for the inconvenience. Going to close this issue, feel free to reopen if you've updated and the connection is not working as expected.

https://github.com/mongodb-js/compass/releases/tag/v1.27.1

Yes, 1.27.1 works fine. Thank you for the quick fix!