mongodb-js / compass

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

"Authentication failed" when SSH to MongoDB on Ubuntu 18.04 #1947

Closed VladimirVLF closed 4 years ago

VladimirVLF commented 4 years ago

After upgrading to v1.21.0 I got a problem with connecting to MongoDB instance running on Ubuntu 18.04 via SSH. The response is always "Authentication failed". All credentials are correct.

Tunneling works fine: In mongod logs in Ubuntu I can see "...connection from 127.0.0.1...", but after 15-30 seconds it disconnects, and Compass client gives "Authentication failed".

After downgrading to v1.20.5 it started to work again. v1.21.0 fails both in basic and Community configurations.

Server-side configuration is Ubuntu 18.04:

db version v4.2.6
git version: 20364840b8f1af16917e4c23c1b5f5efd8b352f8
OpenSSL version: OpenSSL 1.1.1  11 Sep 2018
allocator: tcmalloc
modules: none
build environment:
    distmod: ubuntu1804
    distarch: x86_64
    target_arch: x86_64

Client-side configuration is Windows 10 + MongoDB Compass (basic/community)

hmaesta commented 4 years ago

Maybe related to this bug?

VladimirVLF commented 4 years ago

Maybe, but connect ECONNREFUSED 127.0.0.1:27017 seems like happening after any connection error and trying to connect again right after. Something to do with socket busy, not sure how it is implemented in Compass. Often it is just a matter of waiting and connecting again, or restarting mongo service, at least for me.

"Authentication failed" is an error, which one cannot go around.

ihor-tkachenko commented 4 years ago

In addition to the previous problem. When I try to connect via ssh tunnel I get an error getaddrinfo ENOTFOUND mongo On the bastion server side, the hostname mongo is resolving. So it looks like compass try to resolve these hostname locally instead of building tunnel. With v1.20.5 same configuration working fine. Tried on: Catalina 10.15.4 Ubuntu 18.04 Ubuntu 20.04 Please see the configuration example in attachment. image image

Anemy commented 4 years ago

Thanks - this was a bug in 1.21.0 we've looked into and fixed, there should be an update out now. (Fixed in 1.21.2). Closing now, feel free to reopen if anyone is experiencing this bug on a newer version. Thanks again for letting us know.