Uploaded image for project: 'ProxySQL Admin Scripts'
  1. ProxySQL Admin Scripts
  2. PSQLADM-43

proxysql_galera_checker does not account for special chars in mysql-monitor_password

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Proxysql 1.4.6

      PXC 5.7

      Description

      Setup Proxysql with PXC 5.7

      Use the following:

       

      mysql-monitor_username = monitor
      mysql-monitor_password = monitor#

       

       

      mysql> show grants for 'monitor'@'10.%';
      +----------------------------------------+
      | Grants for monitor@10.%                |
      +----------------------------------------+
      | GRANT USAGE ON *.* TO 'monitor'@'10.%' |
      +----------------------------------------+
      1 row in set (0.00 sec)
      

       

       

      proxysql_galera_checker.log:

      Fri Apr  6 05:48:42 UTC 2018 log file /var/lib/proxysql/proxysql_galera_checker.log
      Fri Apr  6 05:48:42 UTC 2018 ###### HANDLE WRITER NODES ######
      ERROR 1045 (28000): Access denied for user 'monitor'@'proxysql_single' (using password: YES)
      ERROR 1045 (28000): Access denied for user 'monitor'@'proxysql_single' (using password: YES)
      Fri Apr  6 05:48:42 UTC 2018 --> Checking WRITE server 10:10.0.3.232:3306, current status OFFLINE_SOFT, wsrep_local_state
      Fri Apr  6 05:48:42 UTC 2018 server 10:10.0.3.232:3306 is already OFFLINE_SOFT, WSREP status is  which is not ok
      ERROR 1045 (28000): Access denied for user 'monitor'@'proxysql_single' (using password: YES)
      ERROR 1045 (28000): Access denied for user 'monitor'@'proxysql_single' (using password: YES)
      Fri Apr  6 05:48:42 UTC 2018 --> Checking WRITE server 10:10.0.3.68:3306, current status OFFLINE_SOFT, wsrep_local_state
      Fri Apr  6 05:48:42 UTC 2018 server 10:10.0.3.68:3306 is already OFFLINE_SOFT, WSREP status is  which is not ok
      ERROR 1045 (28000): Access denied for user 'monitor'@'proxysql_single' (using password: YES)
      ERROR 1045 (28000): Access denied for user 'monitor'@'proxysql_single' (using password: YES)
      Fri Apr  6 05:48:42 UTC 2018 --> Checking WRITE server 10:10.0.3.81:3306, current status OFFLINE_SOFT, wsrep_local_state
      Fri Apr  6 05:48:42 UTC 2018 server 10:10.0.3.81:3306 is already OFFLINE_SOFT, WSREP status is  which is not ok
      Fri Apr  6 05:48:42 UTC 2018 ###### HANDLE READER NODES ######

       

      Workaround/fix, edited proxysql_galera_checker and enclosed ${MYSQL_PASSWORD} with single quotes (line 80):

           75 mysql_exec() {
           76   local query="$1"
           77   printf "%s\n" \
           78       "[client]" \
           79       "user=${MYSQL_USERNAME}" \
           80       "password='${MYSQL_PASSWORD}'" \
           81       "host=${server}" \
           82       "port=${port}"  \
           83       | timeout $TIMEOUT mysql --defaults-file=/dev/stdin --protocol=tcp -nNE -e "${query}"
           84 }
      

      Result:

      Fri Apr  6 05:51:24 UTC 2018 log file /var/lib/proxysql/proxysql_galera_checker.log
      Fri Apr  6 05:51:24 UTC 2018 ###### HANDLE WRITER NODES ######
      Fri Apr  6 05:51:24 UTC 2018 --> Checking WRITE server 10:10.0.3.232:3306, current status ONLINE, wsrep_local_state 4
      Fri Apr  6 05:51:24 UTC 2018 --> Checking WRITE server 10:10.0.3.68:3306, current status ONLINE, wsrep_local_state 4
      Fri Apr  6 05:51:24 UTC 2018 --> Checking WRITE server 10:10.0.3.81:3306, current status ONLINE, wsrep_local_state 4
      Fri Apr  6 05:51:24 UTC 2018 ###### HANDLE READER NODES ######
      Fri Apr  6 05:51:24 UTC 2018 ###### SUMMARY ######
      Fri Apr  6 05:51:24 UTC 2018 --> Number of writers that are 'ONLINE': 3 : hostgroup: 10
      Fri Apr  6 05:51:24 UTC 2018 --> Number of readers that are 'ONLINE': 0 : hostgroup: 11
      Fri Apr  6 05:51:24 UTC 2018 --> No readers found, Trying to enable last available node of the cluster (in Donor/Desync state) or pick the master
      Fri Apr  6 05:51:24 UTC 2018 ###### Not loading mysql_servers, no change needed ######

        Smart Checklist

          Attachments

            Activity

              People

              • Assignee:
                ramesh.sivaraman Ramesh Sivaraman
                Reporter:
                jericho.rivera Jericho Rivera
              • Votes:
                0 Vote for this issue
                Watchers:
                2 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 hour, 17 minutes
                  1h 17m