-
Type: Investigation
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: 3.4.14
-
Component/s: mongofiles
-
1
-
1,885
Updated: mongofiles handling of the --db argument is different from other tools:
- mongofiles allows it with a URI, whereas other tools prohibits it
- mongofiles has --db supersede a database in the URI
- mongofiles provides a default for --db ('test') that still supersedes the URI
This can result in a surprising auth failure, as users may not realize they need to add an authSource parameter to work around the behaviors above.
Original
The mongofiles command with --uri argument returns an SASL authentication failed, tested in replicaSet context (same uri with mongo shell grants access) :
mongofiles --uri mongodb://user:pass@primary:port,secondary:port,monitor:port/database?replicaSet=replica search test
Failed: error connecting to db server: server returned error on SASL authentication step: Authentication failed.