Uploaded image for project: 'Percona Operator for MySQL based on Percona XtraDB Cluster'
  1. Percona Operator for MySQL based on Percona XtraDB Cluster
  2. K8SPXC-573

Pod cluster1-pxc-0 fails with error: sed: -e expression #1, char 65: unterminated `s' command on OpenShift 4.6.9

Details

    • Bug
    • Status: Done
    • Medium
    • Resolution: Fixed
    • 1.6.0
    • 1.8.0
    • Support Request
    • None

    Description

      An error occured when trying to instantiate a Percona PerconaXtraDBCluster on OpenShift 4.6.9. Operator was installed from the integrated OpenShift Operator Hub, and is the supported (non-community) version 1.6.0-2:

      I created a secret called 'percona', with the following data in it:

      apiVersion: v1
      kind: Secret
      metadata:
        name: percona
      type: Opaque
      data:
        root: <SOMEDATAHERE>
        xtrabackup: <SOMEDATAHERE>
        monitor: <SOMEDATAHERE>
        clustercheck: <SOMEDATAHERE>
        proxyadmin: <SOMEDATAHERE>
        pmmserver: <SOMEDATAHERE> 

      The YAML I used for the instance is:

      apiVersion: pxc.percona.com/v1-6-0
      kind: PerconaXtraDBCluster
      metadata:
        name: cluster1
        finalizers:
          - delete-pxc-pods-in-order
        namespace: mydemoapp
      spec:
        crVersion: 1.6.0
        secretsName: percona
        vaultSecretName: keyring-secret-vault
        sslSecretName: my-cluster-ssl
        sslInternalSecretName: my-cluster-ssl-internal
        allowUnsafeConfigurations: false
        updateStrategy: SmartUpdate
        upgradeOptions:
          versionServiceEndpoint: 'https://check.percona.com'
          apply: disabled
          schedule: 0 4 * * *
        pxc:
          size: 3
          image: >-
            registry.connect.redhat.com/percona/[email protected]:81d388304cb665ca510dc514482561b68291e7f8b8891789c9f4596747f6f9e6
          resources:
            limits:
              cpu: 1000m
              memory: 2G
            requests:
              memory: 1G
              cpu: 600m
          affinity:
            antiAffinityTopologyKey: kubernetes.io/hostname
          podDisruptionBudget:
            maxUnavailable: 1
          volumeSpec:
            persistentVolumeClaim:
              resources:
                requests:
                  storage: 6Gi
              storageClassName: percona
          gracePeriod: 600
        haproxy:
          enabled: false
        proxysql:
          enabled: true
          size: 3
          image: >-
            registry.connect.redhat.com/percona/[email protected]:7fa07d4c841c5df0584d3c1d1af9d01cd749802f17158e675623d0a391f48f7a
          resources:
            limits:
              cpu: 1000m
              memory: 2G
            requests:
              memory: 1G
              cpu: 600m
          affinity:
            antiAffinityTopologyKey: kubernetes.io/hostname
          volumeSpec:
            persistentVolumeClaim:
              resources:
                requests:
                  storage: 2Gi
              storageClassName: percona
          podDisruptionBudget:
            maxUnavailable: 1
          gracePeriod: 30
        pmm:
          enabled: false 

      While installing, I first hit a small issue with the 'operator' key missing in the secret, but that was easily fixed (but not according to the documentation) by adding the key to the secret.

      The second issue is one I cannot fix myself, and is this one:

      [[email protected] ~]$ oc logs pod/cluster1-pxc-0
      + '[' m = - ']'
      + CFG=/etc/mysql/node.cnf
      + wantHelp=
      + for arg in "[email protected]"
      + case "$arg" in
      ++ awk -F. '{print $1"."$2}'
      ++ mysqld -V
      ++ awk '{print $3}'
      + MYSQL_VERSION=8.0
      + vault_secret=/etc/mysql/vault-keyring-secret/keyring_vault.conf
      + '[' -f /etc/mysql/vault-keyring-secret/keyring_vault.conf ']'
      + grep -q '^[sst]' /etc/mysql/node.cnf
      + grep -q '^cpat=' /etc/mysql/node.cnf
      + sed '/^\[sst\]/a cpat=.*\\.pem$\\|.*init\\.ok$\\|.*galera\\.cache$\\|.*wsrep_recovery_verbose\\.log$\\|.*readiness-check\\.sh$\\|.*liveness-check\\.sh$\\|.*sst_in_progress$\\|.*sst-xb-tmpdir$\\|.*\\.sst$\\|.*gvwstate\\.dat$\\|.*grastate\\.dat$\\|.*\\.err$\\|.*\\.log$\\|.*RPM_UPGRADE_MARKER$\\|.*RPM_UPGRADE_HISTORY$\\|.*pxc-entrypoint\\.sh$\\|.*unsafe-bootstrap\\.sh$\\|.*pxc-configure-pxc\\.sh\\|.*peer-list$' /etc/mysql/node.cnf
      + file_env XTRABACKUP_PASSWORD xtrabackup
      + set +o xtrace
      + file_env CLUSTERCHECK_PASSWORD clustercheck
      + set +o xtrace
      ++ hostname -f
      + NODE_NAME=cluster1-pxc-0.cluster1-pxc.mydemoapp.svc.cluster.local
      + NODE_PORT=3306
      + '[' -n cluster1-pxc-unready ']'
      + echo 'Percona XtraDB Cluster: Finding peers'
      Percona XtraDB Cluster: Finding peers
      + /var/lib/mysql/peer-list -on-start=/var/lib/mysql/pxc-configure-pxc.sh -service=cluster1-pxc-unready
      2021/01/03 14:31:00 Peer finder enter
      2021/01/03 14:31:00 Determined Domain to be mydemoapp.svc.cluster.local
      2021/01/03 14:31:00 Peer list updated
      was []
      now [10-130-0-67.cluster1-pxc-unready.mydemoapp.svc.cluster.local]
      2021/01/03 14:31:00 execing: /var/lib/mysql/pxc-configure-pxc.sh with stdin: 10-130-0-67.cluster1-pxc-unready.mydemoapp.svc.cluster.local
      2021/01/03 14:31:01 Failed to execute /var/lib/mysql/pxc-configure-pxc.sh: ++ hostname -I
      ++ awk ' { print $1 } '
      + NODE_IP=10.130.0.67
      ++ hostname -f
      ++ cut -d. -f2
      + CLUSTER_NAME=cluster1-pxc
      + SERVER_ID=0
      ++ hostname -f
      + NODE_NAME=cluster1-pxc-0.cluster1-pxc.mydemoapp.svc.cluster.local
      + NODE_PORT=3306
      + read -ra LINE
      + echo 'read line 10-130-0-67.cluster1-pxc-unready.mydemoapp.svc.cluster.local'
      read line 10-130-0-67.cluster1-pxc-unready.mydemoapp.svc.cluster.local
      ++ awk '{ print $1 }'
      ++ getent hosts 10-130-0-67.cluster1-pxc-unready.mydemoapp.svc.cluster.local
      + LINE_IP=10.130.0.67
      + '[' 10.130.0.67 '!=' 10.130.0.67 ']'
      + read -ra LINE
      + '[' 0 '!=' 0 ']'
      + '[' 0 '!=' 0 ']'
      + CFG=/etc/mysql/node.cnf
      ++ awk -F. '{print $1"."$2}'
      ++ mysqld -V
      ++ awk '{print $3}'
      + MYSQL_VERSION=8.0
      + '[' 8.0 == 8.0 ']'
      + egrep -q '^[#]?admin-address' /etc/mysql/node.cnf
      + sed '/^\[mysqld\]/a admin-address=\n' /etc/mysql/node.cnf
      + egrep -q '^[#]?log_error_suppression_list' /etc/mysql/node.cnf
      + sed '/^\[mysqld\]/a log_error_suppression_list="MY-010055"\n' /etc/mysql/node.cnf
      + egrep -q '^[#]?wsrep_sst_donor' /etc/mysql/node.cnf
      + sed '/^\[mysqld\]/a wsrep_sst_donor=\n' /etc/mysql/node.cnf
      + egrep -q '^[#]?wsrep_node_incoming_address' /etc/mysql/node.cnf
      + sed -r 's|^[#]?server_id=.*$|server_id=10|' /etc/mysql/node.cnf
      + sed -r 's|^[#]?wsrep_node_address=.*$|wsrep_node_address=10.130.0.67|' /etc/mysql/node.cnf
      + sed -r 's|^[#]?wsrep_cluster_name=.*$|wsrep_cluster_name=cluster1-pxc|' /etc/mysql/node.cnf
      + sed -r 's|^[#]?wsrep_sst_donor=.*$|wsrep_sst_donor=|' /etc/mysql/node.cnf
      + sed -r 's|^[#]?wsrep_cluster_address=.*$|wsrep_cluster_address=gcomm://|' /etc/mysql/node.cnf
      + sed -r 's|^[#]?wsrep_node_incoming_address=.*$|wsrep_node_incoming_address=cluster1-pxc-0.cluster1-pxc.mydemoapp.svc.cluster.local:3306|' /etc/mysql/node.cnf
      sed: -e expression #1, char 65: unterminated `s' command
      , err: exit status 1
      

      I don't know if this error is specific to my environment or that it's a general issue with this version of the operator.

      Attachments

        Activity

          People

            mykola.marzhan Mykola Marzhan (Inactive)
            gbbijl Gertjan Bijl
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - Not Specified
                Not Specified
                Logged:
                Time Spent - 3 hours
                3h

                Smart Checklist