pmm-client fails to connect if mongo user/pwd includes '@' symbol
Description
How to test
How to document
Smart Checklist
Activity
Kamil Dziedzic February 28, 2018 at 2:10 PM
Maybe this is worth to be mentioned in documentation, that password needs to be encoded for the uri.
Kamil Dziedzic February 28, 2018 at 2:03 PMEdited
Verified for pmm-client 1.7 and MongoDB 3.6.
PMM monitoring MongoDB with auth.
Test (copy & paste to your terminal):
Result
Kamil Dziedzic February 26, 2018 at 5:23 PM
We use Connection String URI Format to pass connection details to the driver. Because of the nature of the URI, passed params, e.g. pass, should be encoded e.g. with encodeURIComponent.
The same issue applies to mongo client, however there you have option to also use flag. Here is a test for mongo 3.6 which shows that mongo client also fails if you pass it not encoded password via URI:
Please have in mind that handling @ in mongo URI passed to mongo client was fixed just recently, Mongo connection uri doesn't support @ character in database name.
Now for encoded password mongo client works:
The same should apply and be valid for pmm-admin.
Nailya Kutlubaeva February 5, 2018 at 9:52 PM
Yes, confirmed the problem :
Michael Coburn June 19, 2017 at 12:38 PM
Hi , did we already resolve this through improvements to pmm-admin
to support non-alphanumeric characters? Is this issue closeable?
Details
Details
Assignee
Reporter
Priority
Components
Labels
Affects versions
Smart Checklist
Open Smart Checklist
Smart Checklist

If a you elect to use mongodb authentication and your password (or user, untested) contains an @ symbol, the client parses the --uri argument to consider values beyond the 1st '@' to be the hostname. I the below example, the password is legitimate and accepted by the mongo shell authentication.