Uploaded image for project: 'Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces) '
  1. Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces)
  2. CRW-3277

"TypeError: Cannot read properties of undefined (reading 'apiVersion')" when deploy DS using dsc with '--che-operator-cr-patch-yaml' property

    XMLWordPrintable

Details

    • False
    • None
    • False
    • Hide

      1. Login to OCP 4.10.
      2. Create "staging-catalog-source" using next command:

      cat <<EOF | oc create -n openshift-marketplace -f -  
      apiVersion: operators.coreos.com/v1alpha1
      kind: CatalogSource
      metadata:
        name: staging-catalog-source
        namespace: openshift-marketplace
      spec:
        sourceType: grpc
        image: brew.registry.redhat.io/rh-osbs/iib-pub-pending:v4.10
        displayName: Staging OSBS Catalog Source
        publisher: grpc
      EOF
      

      Setup mirroring to registry.stage.redhat.io.

      3. Download dsc client https://github.com/redhat-developer/devspaces-chectl/releases/download/3.1.0-CI-dsc-assets/devspaces-3.1.0-dsc-linux-x64.tar.gz
      4. Deploy dsc to OCP 4.10 using command:

      Unable to find source-code formatter for language: title dsc. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      dsc server:deploy --che-operator-cr-patch-yaml=custom-resource-patch.yaml --package-manifest-name=devspaces --catalog-source-name=staging-catalog-source --olm-channel=stable --catalog-source-namespace=openshift-marketplace --listr-renderer=verbose
      

      where custom-resource-patch.yaml content:

      apiVersion: org.eclipse.che/v2
      spec:
        components:
          devWorkspace:
            runningLimit: '10000'
      

      Expected result: DS has been deployed.

      Actual wrong result: Installation had failed:

       › Installer type is set to: 'olm'
       [07:39:50] Verify Kubernetes API [started]
       › Current Kubernetes context: 'admin-devspaces/api-ocp410-crw-qe-com:6443/admin'
       [07:39:51] Verify Kubernetes API...[OK] [title changed]
       [07:39:51] Verify Kubernetes API...[OK] [OpenShift] [title changed]
       [07:39:51] Verify Kubernetes API...[OK] [OpenShift] [completed]
       [07:39:51] 👀  Looking for an already existing Red Hat OpenShift Dev Spaces instance [started]
       [07:39:51] Verify if Red Hat OpenShift Dev Spaces is deployed into namespace "openshift-devspaces" [started]
       [07:39:51] Verify if Red Hat OpenShift Dev Spaces is deployed into namespace "openshift-devspaces"...[Not Found] [title changed]
       [07:39:51] Verify if Red Hat OpenShift Dev Spaces is deployed into namespace "openshift-devspaces"...[Not Found] [completed]
       [07:39:51] 👀  Looking for an already existing Red Hat OpenShift Dev Spaces instance [completed]
       [07:39:51] ✈️  Openshift preflight checklist [started]
       [07:39:51] Verify if oc is installed [started]
       [07:39:51] Verify if oc is installed...[OK] [title changed]
       [07:39:51] Verify if oc is installed...[OK] [completed]
       [07:39:51] Verify if openshift is running [started]
       [07:39:51] Verify if openshift is running...[OK] [title changed]
       [07:39:51] Verify if openshift is running...[OK] [completed]
       [07:39:51] Check OpenShift version [started]
       [07:39:51] Check OpenShift version: [4.x] [title changed]
       [07:39:51] Check OpenShift version: [4.x] [completed]
       [07:39:51] Check Kubernetes version [started]
       [07:39:51] Check Kubernetes version: [Unknown] [title changed]
       [07:39:51] Check Kubernetes version: [Unknown] [completed]
       [07:39:51] ✈️  Openshift preflight checklist [completed]
       [07:39:51] Following Red Hat OpenShift Dev Spaces logs [started]
       [07:39:51] Start following logs [started]
       [07:39:51] Start following logs...[OK] [title changed]
       [07:39:51] Start following logs...[OK] [completed]
       [07:39:51] Following Red Hat OpenShift Dev Spaces logs [completed]
       [07:39:51] Create Namespace openshift-devspaces [started]
       [07:39:51] Create Namespace openshift-devspaces...[Exists] [title changed]
       [07:39:51] Create Namespace openshift-devspaces...[Exists] [completed]
       [07:39:51] 🏃‍  Running Olm installation Red Hat OpenShift Dev Spaces [started]
       [07:39:51] Check if OLM is pre-installed on the platform [started]
       [07:39:51] Check if OLM is pre-installed on the platform...[OK] [title changed]
       [07:39:51] Check if OLM is pre-installed on the platform...[OK] [completed]
       [07:39:51] Configure context information [started]
       [07:39:51] Configure context information...[OK] [title changed]
       [07:39:51] Configure context information...[OK] [completed]
       [07:39:51] Create operator subscription [started]
       [07:39:51] Create operator subscription...[OK] [title changed]
       [07:39:51] Create operator subscription...[OK] [completed]
       [07:39:51] Wait while subscription is ready [started]
       [07:39:52] Wait while subscription is ready...[OK] [title changed]
       [07:39:52] Wait while subscription is ready...[OK] [completed]
       [07:39:52] Wait operator install plan [started]
       [07:40:15] Wait operator install plan...[OK] [title changed]
       [07:40:15] Wait operator install plan...[OK] [completed]
       [07:40:15] Check cluster service version resource [started]
       [07:40:16] Check cluster service version resource...[OK] [title changed]
       [07:40:16] Check cluster service version resource...[OK] [completed]
       [07:40:16] Prepare Red Hat OpenShift Dev Spaces cluster CR [started]
       [07:40:16] Prepare Red Hat OpenShift Dev Spaces cluster CR...[OK] [title changed]
       [07:40:16] Prepare Red Hat OpenShift Dev Spaces cluster CR...[OK] [completed]
       [07:40:16] Create CheCluster Custom Resource [started]
       [07:40:16] Create CheCluster Custom Resource [failed]
       [07:40:16] → Cannot read properties of undefined (reading 'apiVersion')
       [07:40:16] 🏃‍  Running Olm installation Red Hat OpenShift Dev Spaces [failed]
       [07:40:16] → Cannot read properties of undefined (reading 'apiVersion')
           Error: Command server:deploy failed. Error log: 
           /home/hudson/.cache/dsc/error.log.
      
      Show
      1. Login to OCP 4.10. 2. Create "staging-catalog-source" using next command: cat <<EOF | oc create -n openshift-marketplace -f - apiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata: name: staging-catalog-source namespace: openshift-marketplace spec: sourceType: grpc image: brew.registry.redhat.io/rh-osbs/iib-pub-pending:v4.10 displayName: Staging OSBS Catalog Source publisher: grpc EOF Setup mirroring to registry.stage.redhat.io. 3. Download dsc client https://github.com/redhat-developer/devspaces-chectl/releases/download/3.1.0-CI-dsc-assets/devspaces-3.1.0-dsc-linux-x64.tar.gz 4. Deploy dsc to OCP 4.10 using command: Unable to find source-code formatter for language: title dsc. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml dsc server:deploy --che- operator -cr-patch-yaml=custom-resource-patch.yaml -- package -manifest-name=devspaces --catalog-source-name=staging-catalog-source --olm-channel=stable --catalog-source-namespace=openshift-marketplace --listr-renderer=verbose where custom-resource-patch.yaml content: apiVersion: org.eclipse.che/v2 spec: components: devWorkspace: runningLimit: '10000' Expected result : DS has been deployed. Actual wrong result : Installation had failed: › Installer type is set to: 'olm' [07:39:50] Verify Kubernetes API [started] › Current Kubernetes context: 'admin-devspaces/api-ocp410-crw-qe-com:6443/admin' [07:39:51] Verify Kubernetes API...[OK] [title changed] [07:39:51] Verify Kubernetes API...[OK] [OpenShift] [title changed] [07:39:51] Verify Kubernetes API...[OK] [OpenShift] [completed] [07:39:51] 👀 Looking for an already existing Red Hat OpenShift Dev Spaces instance [started] [07:39:51] Verify if Red Hat OpenShift Dev Spaces is deployed into namespace "openshift-devspaces" [started] [07:39:51] Verify if Red Hat OpenShift Dev Spaces is deployed into namespace "openshift-devspaces" ...[Not Found] [title changed] [07:39:51] Verify if Red Hat OpenShift Dev Spaces is deployed into namespace "openshift-devspaces" ...[Not Found] [completed] [07:39:51] 👀 Looking for an already existing Red Hat OpenShift Dev Spaces instance [completed] [07:39:51] ✈️ Openshift preflight checklist [started] [07:39:51] Verify if oc is installed [started] [07:39:51] Verify if oc is installed...[OK] [title changed] [07:39:51] Verify if oc is installed...[OK] [completed] [07:39:51] Verify if openshift is running [started] [07:39:51] Verify if openshift is running...[OK] [title changed] [07:39:51] Verify if openshift is running...[OK] [completed] [07:39:51] Check OpenShift version [started] [07:39:51] Check OpenShift version: [4.x] [title changed] [07:39:51] Check OpenShift version: [4.x] [completed] [07:39:51] Check Kubernetes version [started] [07:39:51] Check Kubernetes version: [Unknown] [title changed] [07:39:51] Check Kubernetes version: [Unknown] [completed] [07:39:51] ✈️ Openshift preflight checklist [completed] [07:39:51] Following Red Hat OpenShift Dev Spaces logs [started] [07:39:51] Start following logs [started] [07:39:51] Start following logs...[OK] [title changed] [07:39:51] Start following logs...[OK] [completed] [07:39:51] Following Red Hat OpenShift Dev Spaces logs [completed] [07:39:51] Create Namespace openshift-devspaces [started] [07:39:51] Create Namespace openshift-devspaces...[Exists] [title changed] [07:39:51] Create Namespace openshift-devspaces...[Exists] [completed] [07:39:51] 🏃‍ Running Olm installation Red Hat OpenShift Dev Spaces [started] [07:39:51] Check if OLM is pre-installed on the platform [started] [07:39:51] Check if OLM is pre-installed on the platform...[OK] [title changed] [07:39:51] Check if OLM is pre-installed on the platform...[OK] [completed] [07:39:51] Configure context information [started] [07:39:51] Configure context information...[OK] [title changed] [07:39:51] Configure context information...[OK] [completed] [07:39:51] Create operator subscription [started] [07:39:51] Create operator subscription...[OK] [title changed] [07:39:51] Create operator subscription...[OK] [completed] [07:39:51] Wait while subscription is ready [started] [07:39:52] Wait while subscription is ready...[OK] [title changed] [07:39:52] Wait while subscription is ready...[OK] [completed] [07:39:52] Wait operator install plan [started] [07:40:15] Wait operator install plan...[OK] [title changed] [07:40:15] Wait operator install plan...[OK] [completed] [07:40:15] Check cluster service version resource [started] [07:40:16] Check cluster service version resource...[OK] [title changed] [07:40:16] Check cluster service version resource...[OK] [completed] [07:40:16] Prepare Red Hat OpenShift Dev Spaces cluster CR [started] [07:40:16] Prepare Red Hat OpenShift Dev Spaces cluster CR...[OK] [title changed] [07:40:16] Prepare Red Hat OpenShift Dev Spaces cluster CR...[OK] [completed] [07:40:16] Create CheCluster Custom Resource [started] [07:40:16] Create CheCluster Custom Resource [failed] [07:40:16] → Cannot read properties of undefined (reading 'apiVersion' ) [07:40:16] 🏃‍ Running Olm installation Red Hat OpenShift Dev Spaces [failed] [07:40:16] → Cannot read properties of undefined (reading 'apiVersion' ) Error: Command server:deploy failed. Error log: /home/hudson/.cache/dsc/error.log.

    Description

      There was "TypeError: Cannot read properties of undefined (reading 'apiVersion')" error when install DS 3.1.0.RC-08-15 using dcs client with with '--che-operator-cr-patch-yaml' property.

      Test environment:

      • dsc/3.1.0-CI-1c49-redhat.b81c4d7 linux-x64 node-v16.13.2
      • index image: brew.registry.redhat.io/rh-osbs/iib-pub-pending:v4.10

      https://main-jenkins-csb-crwqe.apps.ocp-c1.prod.psi.redhat.com/job/Testing/job/e2e/job/basic/job/install-ds/753/

      https://main-jenkins-csb-crwqe.apps.ocp-c1.prod.psi.redhat.com/job/Testing/job/e2e/job/basic/job/install-ds/753/artifact/logs-and-configs/dsc/error.log/*view*/

      dsc error.log
      2022-08-20T11:40:16.387Z Error: Command server:deploy failed. Error log: /home/hudson/.cache/dsc/error.log.
      2022-08-20T11:40:16.387Z     at newError (/mnt/hudson_workspace/workspace/Testing/e2e/basic/install-ds/dsc/lib/util.js:199:19)
      2022-08-20T11:40:16.387Z     at Object.wrapCommandError (/mnt/hudson_workspace/workspace/Testing/e2e/basic/install-ds/dsc/lib/util.js:195:12)
      2022-08-20T11:40:16.387Z     at Deploy.<anonymous> (/mnt/hudson_workspace/workspace/Testing/e2e/basic/install-ds/dsc/lib/commands/server/deploy.js:173:35)
      2022-08-20T11:40:16.387Z     at Generator.throw (<anonymous>)
      2022-08-20T11:40:16.387Z     at rejected (/mnt/hudson_workspace/workspace/Testing/e2e/basic/install-ds/dsc/node_modules/tslib/tslib.js:115:69)
      2022-08-20T11:40:16.387Z Cause: TypeError: Cannot read properties of undefined (reading 'apiVersion')
      2022-08-20T11:40:16.387Z     at Object.isCheClusterAPIV1 (/mnt/hudson_workspace/workspace/Testing/e2e/basic/install-ds/dsc/lib/util.js:402:23)
      2022-08-20T11:40:16.387Z     at KubeHelper.<anonymous> (/mnt/hudson_workspace/workspace/Testing/e2e/basic/install-ds/dsc/lib/api/kube.js:1085:46)
      2022-08-20T11:40:16.387Z     at Generator.next (<anonymous>)
      2022-08-20T11:40:16.387Z     at /mnt/hudson_workspace/workspace/Testing/e2e/basic/install-ds/dsc/node_modules/tslib/tslib.js:117:75
      2022-08-20T11:40:16.387Z     at new Promise (<anonymous>)
      2022-08-20T11:40:16.387Z     at Object.__awaiter (/mnt/hudson_workspace/workspace/Testing/e2e/basic/install-ds/dsc/node_modules/tslib/tslib.js:113:16)
      2022-08-20T11:40:16.387Z     at KubeHelper.createCheCluster (/mnt/hudson_workspace/workspace/Testing/e2e/basic/install-ds/dsc/lib/api/kube.js:1084:24)
      2022-08-20T11:40:16.387Z     at Object.<anonymous> (/mnt/hudson_workspace/workspace/Testing/e2e/basic/install-ds/dsc/lib/tasks/installers/common-tasks.js:72:43)
      2022-08-20T11:40:16.387Z     at Generator.next (<anonymous>)
      2022-08-20T11:40:16.387Z     at fulfilled (/mnt/hudson_workspace/workspace/Testing/e2e/basic/install-ds/dsc/node_modules/tslib/tslib.js:114:62)
      

      Attachments

        Activity

          People

            abazko Anatolii Bazko
            dnochevn Dmytro Nochevnov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: