Uploaded image for project: 'Percona Monitoring and Management'
  1. Percona Monitoring and Management
  2. PMM-741

pmm-client fails to connect if mongo user/pwd includes '@' symbol

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Low
    • Resolution: Won't Do
    • Affects Version/s: 1.1.1
    • Fix Version/s: None
    • Component/s: PMM Client
    • Labels:

      Description

      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.

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      moore@bubbles:/var/lib/mongodb$ mongo -u moore -p secret admin
      MongoDB shell version: 2.6.10
      connecting to: admin
      > use whatever
      switched to db whatever
      > db.createUser({user:"dba",pwd:"badp@ss", roles:[{role:"readWrite",db:"whatever"}]})
      Successfully added user: {
      	"user" : "dba",
      	"roles" : [
      		{
      			"role" : "readWrite",
      			"db" : "whatever"
      		}
      	]
      }
      > exit
      bye
      moore@bubbles:/var/lib/mongodb$ mongo -udba -p"badp@ss" whatever
      MongoDB shell version: 2.6.10
      connecting to: whatever
      > exit
      bye
      moore@bubbles:/var/lib/mongodb$ sudo pmm-admin add mongodb:metrics --uri mongodb://dba:'badp@ss'@127.0.0.1:27017/whatever
      Cannot connect to MongoDB using uri mongodb://dba:badp@ss@127.0.0.1:27017/whatever: no reachable servers
      

        Smart Checklist

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  nailya.kutlubaeva Nailya Kutlubaeva
                  Reporter:
                  andrew.moore@percona.com Andrew Moore (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 1 day
                    1d