Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 1.2.2
    • Fix Version/s: 1.9.0
    • Component/s: PMM Client
    • Labels:

      Description

      Basically, passwords with "$" doesn't work properly with the latest pmm-client

      mysql> set password for pmm@'localhost' = password('testpmm'); flush privileges;
      Query OK, 0 rows affected, 1 warning (0.00 sec)
      
      Query OK, 0 rows affected (0.00 sec)
      
      mysql> Bye
      [root@dbnode vagrant]# mysql -u pmm -ptestpmm
      mysql: [Warning] Using a password on the command line interface can be insecure.
      Welcome to the MySQL monitor.  Commands end with ; or \g.
      Your MySQL connection id is 8938
      Server version: 5.7.19-17 Percona Server (GPL), Release 17, Revision e19a6b7b73f
      
      Copyright (c) 2009-2017 Percona LLC and/or its affiliates
      Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
      
      Oracle is a registered trademark of Oracle Corporation and/or its
      affiliates. Other names may be trademarks of their respective
      owners.
      
      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
      
      mysql> Bye
      
      [root@dbnode vagrant]# pmm-admin add mysql --user pmm --socket /var/lib/mysql/mysql.sock --password testpmm
      [linux:metrics] OK, already monitoring this system.
      [mysql:metrics] OK, now monitoring MySQL metrics using DSN pmm:***@unix(/var/lib/mysql/mysql.sock)
      [mysql:queries] OK, now monitoring MySQL queries from slowlog using DSN pmm:***@unix(/var/lib/mysql/mysql.sock)
      
      [root@dbnode vagrant]# pmm-admin list
      pmm-admin 1.2.2
      
      PMM Server      | 192.168.170.81
      Client Name     | dbnode.local
      Client Address  | 192.168.170.82
      Service Manager | unix-systemv
      
      -------------- ------------- ----------- -------- ---------------------------------------- ------------------------------------------
      SERVICE TYPE   NAME          LOCAL PORT  RUNNING  DATA SOURCE                              OPTIONS
      -------------- ------------- ----------- -------- ---------------------------------------- ------------------------------------------
      mysql:queries  dbnode.local  -           YES      pmm:***@unix(/var/lib/mysql/mysql.sock)  query_source=slowlog, query_examples=true
      linux:metrics  dbnode.local  42000       YES      -
      mysql:metrics  dbnode.local  42002       YES      pmm:***@unix(/var/lib/mysql/mysql.sock)
      

      Inside the docker container you can see the mysql data:

      [root@f9c943bc08af opt]# curl 'http://localhost:9090/prometheus/api/v1/query?query=mysql_global_status_connections'
      {"status":"success","data":{"resultType":"vector","result":[{"metric":{"__name__":"mysql_global_status_connections","instance":"dbnode.local","job":"mysql"},"value":[1505756815.849,"9893"]}]}}
      [root@f9c943bc08af opt]#
      {
        "status": "success",
        "data": {
          "resultType": "vector",
          "result": [
            {
              "metric": {
                "__name__": "mysql_global_status_connections",
                "instance": "dbnode.local",
                "job": "mysql"
              },
              "value": [
                1505756815.849,
                "9893"
              ]
            }
          ]
        }
      }
      [root@f9c943bc08af opt]# date +%s
      1505756818
      

      So if we change the password to a password with "$"

      mysql> set password for pmm@'localhost' = password('test$pmm'); flush privileges;
      Query OK, 0 rows affected, 1 warning (0.00 sec)
      
      Query OK, 0 rows affected (0.00 sec)
      
      mysql> Bye
      
      [root@dbnode vagrant]# pmm-admin remove --all
      [root@dbnode vagrant]# pmm-admin add mysql --user pmm --password 'test$pmm' --socket /var/lib/mysql/mysql.sock
      [linux:metrics] OK, now monitoring this system.
      [mysql:metrics] OK, now monitoring MySQL metrics using DSN pmm:***@unix(/var/lib/mysql/mysql.sock)
      [mysql:queries] OK, now monitoring MySQL queries from slowlog using DSN pmm:***@unix(/var/lib/mysql/mysql.sock)
      [root@dbnode vagrant]# pmm-admin list
      pmm-admin 1.2.2
      
      PMM Server      | 192.168.170.81
      Client Name     | dbnode.local
      Client Address  | 192.168.170.82
      Service Manager | unix-systemv
      
      -------------- ------------- ----------- -------- ---------------------------------------- ------------------------------------------
      SERVICE TYPE   NAME          LOCAL PORT  RUNNING  DATA SOURCE                              OPTIONS
      -------------- ------------- ----------- -------- ---------------------------------------- ------------------------------------------
      mysql:queries  dbnode.local  -           YES      pmm:***@unix(/var/lib/mysql/mysql.sock)  query_source=slowlog, query_examples=true
      linux:metrics  dbnode.local  42000       YES      -
      mysql:metrics  dbnode.local  42002       YES      pmm:***@unix(/var/lib/mysql/mysql.sock)
      

      At this point everything looks fine but If I check the data inside the docker container I get:

      [root@f9c943bc08af opt]# curl 'http://localhost:9090/prometheus/api/v1/query?query=mysql_global_status_connections'
      {"status":"success","data":{"resultType":"vector","result":[]}}
      

      As you can see, I don't get any result.

      So to verify that the password was the issue, I change the password again to testpmm and after remove/add the collector everything back to normal state.

      mysql> set password for pmm@'localhost' = password('testpmm'); flush privileges;
      [root@dbnode vagrant]# pmm-admin remove --all
      OK, 3 services were removed.
      [root@dbnode vagrant]# mysql -u root -p
      mysql> set password for pmm@'localhost' = password('testpmm'); flush privileges;
      Query OK, 0 rows affected, 1 warning (0.00 sec)
      
      Query OK, 0 rows affected (0.00 sec)
      
      mysql> Bye
      [root@dbnode vagrant]# pmm-admin add mysql --user pmm --socket /var/lib/mysql/mysql.sock --password 'testpmm'
      [linux:metrics] OK, now monitoring this system.
      [mysql:metrics] OK, now monitoring MySQL metrics using DSN pmm:***@unix(/var/lib/mysql/mysql.sock)
      [mysql:queries] OK, now monitoring MySQL queries from slowlog using DSN pmm:***@unix(/var/lib/mysql/mysql.sock)
      

      And inside the docker container:

      [root@f9c943bc08af opt]# curl 'http://localhost:9090/prometheus/api/v1/query?query=mysql_global_status_connections'
      {"status":"success","data":{"resultType":"vector","result":[{"metric":{"__name__":"mysql_global_status_connections","instance":"dbnode.local","job":"mysql"},"value":[1505758078.087,"10979"]}]}}
      

        Smart Checklist

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  martinarrieta Martin Arrieta
                • 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, 4 hours, 30 minutes
                    1d 4h 30m