mongodb-js / compass

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

Compass UI doesn´t show DB and collections after ATLAS upgrade to 5.0.6 #2953

Closed Sebs030 closed 2 years ago

Sebs030 commented 2 years ago

When connecting to an Atlas hosted MongoDB the compass UI no longer shows the DB and the collections. image

This happened after MongoDB was upgraded to 5.0.6 In the mongoshell I can run show collections and the Collections of the DB will be listed:

image

Operating System: Win 11 Pro Compass Version: 1.31.1

I can still connect to other Atlas hosted DB with Compass which are still MongoDB Version 4.x

skasyn commented 2 years ago

I have the same issue.

image

Operating System: macOS Monterey 12.1 Compass Version: 1.30.1

Henrixounez commented 2 years ago

Same problem here. Tried to run show dbs or show databases but it gives me an error but I don't know if that's regular behavior or not.

image

Operating System: macOS Monterey 12.1 MongoDB Compass Version: 1.31.1

Anemy commented 2 years ago

Hi @Sebs030 , thanks for reporting. A couple questions if you have a moment to help us understand the issue: What permissions does the user you're connecting with have? Is the user able to listDatabases in the shell?

I think this is the same issue we have reported on JIRA: https://jira.mongodb.org/browse/COMPASS-5691 We'll use that to track the issue and we'll comment back here when we've got something to update on. Hopefully if this is an issue we can get a fix out to y'all quick.

Sebs030 commented 2 years ago

@Anemy , that´s interesting, so show dbs does not work, but db works. I actually did not change the connection string, it stopped working from one day to the other: image

The user for the connection String has readWrite access and even after adding dbAdmin rights I still get the above error

Anemy commented 2 years ago

Looks like this is happening as a result of the connectionStatus command response in Atlas shared tier clusters not containing values for authenticatedUserPrivileges. listDatabases as well is not inferring the privileges so we aren't showing the databases. We're investigating if this response is expected with these clusters, at the same time we'll see if there's a workaround using roles we can add to fix this issue in the short term so folks can use their databases. We'll post updates here when there's a fix/workaround.

Sebs030 commented 2 years ago

Thanks @Anemy . What i could figure out from the fix above as a somewhat workaround, for the time being, is to provide the user the build-in role "read and write to any database" in the Atlas UI. It is then possible to connect with the Compass UI, but of course only an option for dev environments due to sec issues

anubhab-parallel-reality commented 2 years ago

Facing the same issue with Win 10 + Compass 1.13.1, and providing read permission on the admin DB listed all the DB present, but only listed collections of the DBs in which read, readWrite or dbAdmin permissions are given. admin is the mongo authentication DB. This only happened once, on disconnecting and connecting again, it only shows admin DB with nothing in it.

Anemy commented 2 years ago

Hi folks, we have a new beta published which has a partial patch for this issue. v1.31.2-beta.5 If you have a moment please give it a try and let us know if it fixes what you were running into! We'd like to get this in a GA release early this week. You can find a download it here: https://www.mongodb.com/try/download/compass https://github.com/mongodb-js/compass/releases

I'll post here as well when the GA is out, thanks again for reporting.

While hopefully this patch will cover most general use cases, this is a partial workaround. This is partial because, without being able to retrieve the privileges for a certain user, we can currently only derive a user's permissions from the built in roles that users have. For permissions stemming from privileges given by custom roles we'll have to wait for a fix to be deployed on the Atlas side of things. So that will start working one day without a Compass release.

vviotto commented 2 years ago

As a workaround, you can create a custom role with the 'listDatabase' permission and assign this role to the user connecting via compass, this may not be feasible for everyone because this user will be able to see all of the existing databases.

Anemy commented 2 years ago

Hola folks! We've just released a new Compass version 1.31.2 with a fix for this issue. It's available for download here: https://www.mongodb.com/try/download/compass https://github.com/mongodb-js/compass/releases

While this fix will cover most general use cases, this is a partial workaround. This is partial because, without being able to retrieve the privileges for a certain user, we can currently only derive a user's permissions from the built in roles that users have. For permissions stemming from privileges given by custom roles we'll have to wait for a fix to be deployed on the Atlas side of things. So that will start working one day without a Compass release.

Going to close this, feel free to reopen if the issue persists. Thanks again for reporting this and helping improve Compass.