Uploaded image for project: 'Red Hat OpenStack Services on OpenShift'
  1. Red Hat OpenStack Services on OpenShift
  2. OSPRH-19719

Documentation feedback: Step 4.1.1 failes with error: Invalid JSON Patch

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • rhos-18.0.z
    • rhos-18.0.z
    • documentation
    • None
    • 1
    • False
    • Hide

      None

      Show
      None
    • False
    • ?
    • rhos-ops-day1day2-upgrades
    • None
    • RHOS Upgrades 2025 Sprint 17
    • 1
    • Moderate

      https://docs.redhat.com/en/documentation/red_hat_openstack_services_on_openshift/18.0/html/adopting_a_red_hat_openstack_platform_director_operator_environment/migrating-databases-to-the-control-plane_configuring-network#proc_retrieving-topology-specific-service-configuration_migrating-databases

      4.1.1 

      [kni@prodospd-basition ~]$ unset PULL_OPENSTACK_CONFIGURATION_DATABASES
      
      declare -xA PULL_OPENSTACK_CONFIGURATION_DATABASES
      
      for CELL in $(echo $CELLS); do
      
          PULL_OPENSTACK_CONFIGURATION_DATABASES[$CELL]=$(oc run mariadb-client-1-$CELL ${MARIADB_RUN_OVERRIDES} -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \
      
              mysql -rsh "${SOURCE_MARIADB_IP[$CELL]}" -uroot -p"${SOURCE_DB_ROOT_PASSWORD[$CELL]}" -e 'SHOW databases;')
      
      done
      
      error: Invalid JSON Patch
      
      
      

      I suspect it might be an issue with the format of 

      ${MARIADB_RUN_OVERRIDES}

      Created by 
      $ MARIADB_RUN_OVERRIDES="--overrides=${RUN_OVERRIDES} $MARIADB_CLIENT_ANNOTATIONS"
      in the previous step

      echo $MARIADB_RUN_OVERRIDES
      
      --overrides={ "apiVersion": "v1", "metadata": { "annotations": { "k8s.v1.cni.cncf.io/networks": "[{\"name\": \"internalapi-static\",\"namespace\": \"openstack\", \"ips\":[\"172.17.0.99/24\"]}]" } }, "spec": { "node
      Name": "prodospd-worker-1.internal.tme.redhat.com", "securityContext": { "allowPrivilegeEscalation": false, "capabilities": { "drop": ["ALL"] }, "runAsNonRoot": true, "seccompProfile": { "type": "RuntimeDefault" } 
      } } }
      
      [kni@prodospd-basition

      If I expand the variables manually and enclose the override in single quotes, then run the command it works 

      [kni@prodospd-basition ~]$ oc run mariadb-client-1-$CELL --overrides='{ "apiVersion": "v1", "metadata": { "annotations": { "k8s.v1.cni.cncf.io/networks": "[{\"name\": \"internalapi-static\",\"namespace\": \"opensta
      ck\", \"ips\":[\"172.17.0.99/24\"]}]" } }, "spec": { "nodeName": "prodospd-worker-1.internal.tme.redhat.com", "securityContext": { "allowPrivilegeEscalation": false, "capabilities": { "drop": ["ALL"] }, "runAsNonRo
      ot": true, "seccompProfile": { "type": "RuntimeDefault" } } } }' --image ${MARIADB_IMAGE} -i  --restart=Never  --         mysql -rsh "${SOURCE_MARIADB_IP[$CELL]}" -uroot -p"${SOURCE_DB_ROOT_PASSWORD[$CELL]}" -e 'SH
      OW databases;'
      
      cinder
      
      glance
      
      heat
      
      information_schema
      
      keystone
      
      mysql
      
      nova
      
      nova_api
      
      nova_cell0
      
      ovs_neutron
      
      performance_schema
      
      placement
      
      
       

      Without the single quotes I get the same error

       oc run mariadb-client-1-$CELL --overrides={ "apiVersion": "v1", "metadata": { "annotations": { "k8s.v1.cni.cncf.io/networks": "[{\"name\": \"internalapi-static\",\"namespace\": \"openstac
      k\", \"ips\":[\"172.17.0.99/24\"]}]" } }, "spec": { "nodeName": "prodospd-worker-1.internal.tme.redhat.com", "securityContext": { "allowPrivilegeEscalation": false, "capabilities": { "drop": ["ALL"] }, "runAsNonRoo
      t": true, "seccompProfile": { "type": "RuntimeDefault" } } } } --image ${MARIADB_IMAGE} -i  --restart=Never  --         mysql -rsh "${SOURCE_MARIADB_IP[$CELL]}" -uroot -p"${SOURCE_DB_ROOT_PASSWORD[$CELL]}" -e 'SHOW
       databases;'
      
      error: Invalid JSON Patch
       

       

              kgilliga@redhat.com Katie Gilligan
              rhn-support-dsedgmen David Sedgmen
              David Sedgmen
              rhos-dfg-upgrades
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: