Summary
The article discusses an error message that can occur when using a MongoDB data source in Dremio, and provides information on the cause and potential resolution.
Reported Issue
When using a MongoDB data source in Dremio, the following error message may be displayed:
Could not get the mongo compatibility version from the server. Defaulting to detected version: 5.0
This message may be accompanied in the server.log by:
com.mongodb.MongoCommandException: Command failed with error 13 (Unauthorized): 'not authorized on admin to execute command { getParameter: true, featureCompatibilityVersion: true, $db: "admin", $clusterTime: { clusterTime: Timestamp(1685115555, 1), signature: { hash: BinData(0, ***), keyId: *** } }, lsid: { id: UUID("***") }, $readPreference: { mode: "primaryPreferred" } }' on server ***:***. The full response is {"ok": 0.0, "errmsg": "not authorized on admin to execute command { getParameter: true, featureCompatibilityVersion: true, $db: \"admin\"...
Relevant Versions
This can take place on all Dremio releases.
Troubleshooting Steps
Once the error is displayed in the UI, check the server.log for any additional errors.
Cause
The error message indicates that Dremio was unable to obtain the 'compatibility version' from MongoDB and defaulted it to version 5.0. Certain versions of MongoDB offer differing capabilities, and also cause the mongo server to behave differently.
The additional error message suggests that the issue is related to not having the necessary authorization to execute the 'getParameter' command on the admin database in MongoDB.
Steps to Resolve
To resolve the issue, you need to ensure that you run against an admin database in MongoDB that has the necessary authorization to execute the 'getParameter' command.
Additional Resources
For more information on the behaviour of the 'getParameter' command in MongoDB, refer to the official MongoDB documentation:
https://www.mongodb.com/docs/manual/reference/command/getParameter/#behavior