[COMPASS-1930] Connect To Secondary "not authorized" (possible regression) Created: 06/Sep/17  Updated: 10/Jan/24  Resolved: 02/Mar/20

Status: Closed
Project: Compass
Component/s: Connectivity
Affects Version/s: 1.8.2, 1.16.4
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Davide De Angelis Assignee: Lucas Hrabovsky (Inactive)
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Compass_1_16_3_to_Community_3_4_19_via_mongos_for_readonly.png     PNG File Compass_1_16_3_to_Community_3_6_10_via_mongos_for_readonly.png     PNG File Compass_3_16_4_to_Community_3_4_13_via_mongos_for_readonly.png     PNG File Screen Shot 2017-09-06 at 11.15.00.png     PNG File Screen Shot 2017-09-06 at 11.15.49.png    
Issue Links:
Related
related to COMPASS-2744 Stuck in "loading navigation": db.adm... Closed
is related to NODE-1012 MongoError: "$queryOptions" is not a ... Closed
is related to SERVER-29407 BadValue error when passing readPrefe... Closed

 Description   

Hello,

A customer is reporting an issue while connecting to a mongoS (shard) with read preference Secondary:

The MongoDB instance you are connected to does not contain any collections, or you are not authorized to view them.

Compass works correctly if connecting to the Primary.

I have managed to reproduce the issue:

Hostname: agents.foobar.com
Port: 27200
Authentication: Username/Password
Authentication Database: test
Replica Set Name: test
Read Preference: Secondary
SSL: off
SSH Tunnel: off

Console Debug Log

/Applications/MongoDB Compass.app/Contents/Resources/app.asar/node_modules/debug/lib/browser-consol...:105 mongodb-instance-model:fetch checking we can get buildInfo... +0ms
/Applications/MongoDB Compass.app/Contents/Resources/app.asar/node_modules/debug/lib/browser-consol...:105 mongodb-instance-model:fetch user does not have hostInfo privilege, returning empty document {} +55ms
/Applications/MongoDB Compass.app/Contents/Resources/app.asar/node_modules/debug/lib/browser-consol...:105 mongodb-instance-model:fetch Command "usersInfo" could not be retrieved: "$queryOptions" is not a valid argument to usersInfo +9ms
/Applications/MongoDB Compass.app/Contents/Resources/app.asar/node_modules/debug/lib/browser-consol...:105 mongodb-instance-model:fetch allowed collections +1ms []
/Applications/MongoDB Compass.app/Contents/Resources/app.asar/node_modules/debug/lib/browser-consol...:105 mongodb-instance-model:fetch listDatabases failed. returning empty list [] +4ms

Similar bug fixed in 1.8.0 version: COMPASS-1234

Thank you


Generated at Wed Feb 07 22:28:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.