Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-7774

RawCNIConfig is printed in byte representation on failure, not human readable

XMLWordPrintable

    • Informational
    • No
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      Error message Failed to Unmarshal RawCNIConfig shows the raw byte output which is not very helpful in the status conditions of the network.operator (it's not human readable). Let's convert the output to its string representation.

      Example:

      $ oc get network.operator cluster -o yaml
      apiVersion: operator.openshift.io/v1
      kind: Network
      metadata:
        annotations:
          networkoperator.openshift.io/ovn-cluster-initiator: 192.168.18.22
        creationTimestamp: "2023-02-01T18:09:10Z"
        generation: 37
        name: cluster
        resourceVersion: "5560137"
        uid: 28e10896-5c2d-4cc3-aeee-846a48b8bf36
      spec:
        additionalNetworks:
        - name: br1-net
          namespace: default
          rawCNIConfig: "{\n\t\"cniVersion\": \"0.3.1\",\n\t\"name\": \"test-nad\",\n\t\"plugins\":
            [{\n\t\t\"type\": \"bridge\",\n\t\t\"bridge\": \"br1\",\n\t\t\"vlan\": 0,\n\t\t\"ipMasq\":
            true,\n\t\t\"ipam\": {\n\t\t\t\"datastore\": \"kubernetes\",\n\t\t\t\"kubernetes\":
            {\n\t\t\t\t\"kubeconfig\": \"/etc/kubernetes/cni/net.d/whereabouts.d/whereabouts.kubeconfig\"\n\t\t\t},\n\t\t\t\"type\":
            \"whereabouts\",\n            \"ipRanges\": [{\n\t\t\t  \"range\": \"fc00:123::/64\",\n
            \ \t\t\t  \"range_start\": \"fc00:123::20\",\n\t\t\t  \"range_end\": \"fc00:123::29\"\n
            \           },{\n\t\t\t  \"range\": \"192.168.123.0/24\",\n\t\t\t  \"range_start\":
            \"192.168.123.20\",\n\t\t\t  \"range_end\": \"192.168.123.29\",\n            }],\n\t\t\t\"routes\":
            [{\n\t\t\t\t\"dst\": \"fc00:124::/64\",\n\t\t\t\t\"gw\": \"fc00:123::10\"\n\t\t\t},{\n\t\t\t\t\"dst\":
            \"2600:52:7:18::/64\",\n\t\t\t\t\"gw\": \"fc00:123::10\"\n\t\t\t},{\n\t\t\t\t\"dst\":
            \"9.0.0.0/24\",\n\t\t\t\t\"gw\": \"192.168.123.1\"\n            ],\n\t\t\t\"log_file\":
            \"/var/log/whereabouts.log\",\n\t\t\t\"log_level\": \"debug\"\n\t\t}\n\t}]\n}"
          type: Raw
        clusterNetwork:
        - cidr: 10.128.0.0/14
          hostPrefix: 23
        - cidr: fd01::/48
          hostPrefix: 64
        defaultNetwork:
          ovnKubernetesConfig:
            gatewayConfig:
              routingViaHost: false
            genevePort: 6081
            mtu: 1400
            policyAuditConfig:
              destination: "null"
              maxFileSize: 50
              rateLimit: 20
              syslogFacility: local0
          type: OVNKubernetes
        deployKubeProxy: false
        disableMultiNetwork: false
        disableNetworkDiagnostics: false
        logLevel: Normal
        managementState: Managed
        observedConfig: null
        operatorLogLevel: Normal
        serviceNetwork:
        - 172.30.0.0/16
        - fd02::/112
        unsupportedConfigOverrides: null
        useMultiNetworkPolicy: false
      status:
        conditions:
        - lastTransitionTime: "2023-02-01T18:09:10Z"
          status: "False"
          type: ManagementStateDegraded
        - lastTransitionTime: "2023-02-20T14:18:45Z"
          message: 'Internal error while rendering operator configuration: invalid Additional
            Network Configuration: [Failed to Unmarshal RawCNIConfig: [123 10 9 34 99 110
            105 86 101 114 115 105 111 110 34 58 32 34 48 46 51 46 49 34 44 10 9 34 110
            97 109 101 34 58 32 34 116 101 115 116 45 110 97 100 34 44 10 9 34 112 108 117
            103 105 110 115 34 58 32 91 123 10 9 9 34 116 121 112 101 34 58 32 34 98 114
            105 100 103 101 34 44 10 9 9 34 98 114 105 100 103 101 34 58 32 34 98 114 49
            34 44 10 9 9 34 118 108 97 110 34 58 32 48 44 10 9 9 34 105 112 77 97 115 113
            34 58 32 116 114 117 101 44 10 9 9 34 105 112 97 109 34 58 32 123 10 9 9 9 34
            100 97 116 97 115 116 111 114 101 34 58 32 34 107 117 98 101 114 110 101 116
            101 115 34 44 10 9 9 9 34 107 117 98 101 114 110 101 116 101 115 34 58 32 123
            10 9 9 9 9 34 107 117 98 101 99 111 110 102 105 103 34 58 32 34 47 101 116 99
            47 107 117 98 101 114 110 101 116 101 115 47 99 110 105 47 110 101 116 46 100
            47 119 104 101 114 101 97 98 111 117 116 115 46 100 47 119 104 101 114 101 97
            98 111 117 116 115 46 107 117 98 101 99 111 110 102 105 103 34 10 9 9 9 125
            44 10 9 9 9 34 116 121 112 101 34 58 32 34 119 104 101 114 101 97 98 111 117
            116 115 34 44 10 32 32 32 32 32 32 32 32 32 32 32 32 34 105 112 82 97 110 103
            101 115 34 58 32 91 123 10 9 9 9 32 32 34 114 97 110 103 101 34 58 32 34 102
            99 48 48 58 49 50 51 58 58 47 54 52 34 44 10 32 32 9 9 9 32 32 34 114 97 110
            103 101 95 115 116 97 114 116 34 58 32 34 102 99 48 48 58 49 50 51 58 58 50
            48 34 44 10 9 9 9 32 32 34 114 97 110 103 101 95 101 110 100 34 58 32 34 102
            99 48 48 58 49 50 51 58 58 50 57 34 10 32 32 32 32 32 32 32 32 32 32 32 32 125
            44 123 10 9 9 9 32 32 34 114 97 110 103 101 34 58 32 34 49 57 50 46 49 54 56
            46 49 50 51 46 48 47 50 52 34 44 10 9 9 9 32 32 34 114 97 110 103 101 95 115
            116 97 114 116 34 58 32 34 49 57 50 46 49 54 56 46 49 50 51 46 50 48 34 44 10
            9 9 9 32 32 34 114 97 110 103 101 95 101 110 100 34 58 32 34 49 57 50 46 49
            54 56 46 49 50 51 46 50 57 34 44 10 32 32 32 32 32 32 32 32 32 32 32 32 125
            93 44 10 9 9 9 34 114 111 117 116 101 115 34 58 32 91 123 10 9 9 9 9 34 100
            115 116 34 58 32 34 102 99 48 48 58 49 50 52 58 58 47 54 52 34 44 10 9 9 9 9
            34 103 119 34 58 32 34 102 99 48 48 58 49 50 51 58 58 49 48 34 10 9 9 9 125
            44 123 10 9 9 9 9 34 100 115 116 34 58 32 34 50 54 48 48 58 53 50 58 55 58 49
            56 58 58 47 54 52 34 44 10 9 9 9 9 34 103 119 34 58 32 34 102 99 48 48 58 49
            50 51 58 58 49 48 34 10 9 9 9 125 44 123 10 9 9 9 9 34 100 115 116 34 58 32
            34 57 46 48 46 48 46 48 47 50 52 34 44 10 9 9 9 9 34 103 119 34 58 32 34 49
            57 50 46 49 54 56 46 49 50 51 46 49 34 10 32 32 32 32 32 32 32 32 32 32 32 32
            93 44 10 9 9 9 34 108 111 103 95 102 105 108 101 34 58 32 34 47 118 97 114 47
            108 111 103 47 119 104 101 114 101 97 98 111 117 116 115 46 108 111 103 34 44
            10 9 9 9 34 108 111 103 95 108 101 118 101 108 34 58 32 34 100 101 98 117 103
            34 10 9 9 125 10 9 125 93 10 125]]'
          reason: RenderError
          status: "True"
          type: Degraded
        - lastTransitionTime: "2023-02-01T18:09:10Z"
          status: "True"
          type: Upgradeable
        - lastTransitionTime: "2023-02-01T18:11:35Z"
          status: "False"
          type: Progressing
        - lastTransitionTime: "2023-02-01T18:10:37Z"
          status: "True"
          type: Available
        readyReplicas: 0
        version: 4.10.45
      

            akaris@redhat.com Andreas Karis
            akaris@redhat.com Andreas Karis
            Arti Sood Arti Sood
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: