medic / upgrade-service-kubernetes

Upgrade service for k8s
0 stars 0 forks source link

Error during upgrade TypeError: this.upgradeMessage is not iterable #9

Closed Hareet closed 2 years ago

Hareet commented 2 years ago

When using gamma-4.dev.medicmobile.org deployed on namespace k8s-cht-deployment in our medic-hosted kubernetes cluster, and triggering an upgrade, the upgrade service errs with:

Error during upgrade TypeError: this.upgradeMessage is not iterable
    at K8sManager.filterInvalidUpgradePairs (/usr/src/app/src/lib/k8s-manager.ts:60:48)
    at new K8sManager (/usr/src/app/src/lib/k8s-manager.ts:23:45)
    at new UpgradeService (/usr/src/app/src/lib/upgrade-service.ts:14:23)
    at /usr/src/app/src/main/index.ts:28:32
    at Generator.next (<anonymous>)
    at /usr/src/app/src/main/index.ts:27:71
    at new Promise (<anonymous>)
    at __awaiter (/usr/src/app/src/main/index.ts:23:12)
    at /usr/src/app/src/main/index.ts:22:51
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)

Here's the logging from upgrade service when receiving the request:

Listening on port 5008
Post request received
{
  containers: [
    {
      container_name: 'cht-api',
      image_tag: '720541322708.dkr.ecr.eu-west-2.amazonaws.com/medic/cht-api:4.0.0-7703-offline-user-replace'
    },
    {
      container_name: 'cht-sentinel',
      image_tag: '720541322708.dkr.ecr.eu-west-2.amazonaws.com/medic/cht-sentinel:4.0.0-7703-offline-user-replace'
    },
    {
      container_name: 'cht-couchdb',
      image_tag: '720541322708.dkr.ecr.eu-west-2.amazonaws.com/medic/cht-couchdb:4.0.0-7703-offline-user-replace'
    },
    {
      container_name: 'cht-haproxy',
      image_tag: '720541322708.dkr.ecr.eu-west-2.amazonaws.com/medic/cht-haproxy:4.0.0-7703-offline-user-replace'
    },
    {
      container_name: 'cht-haproxy-healthcheck',
      image_tag: '720541322708.dkr.ecr.eu-west-2.amazonaws.com/medic/cht-haproxy-healthcheck:4.0.0-7703-offline-user-replace'
    },
    {
      container_name: 'cht-nginx',
      image_tag: '720541322708.dkr.ecr.eu-west-2.amazonaws.com/medic/cht-nginx:4.0.0-7703-offline-user-replace'
    }
  ],
  docker_compose: {
    'cht-core.yml': "version: '3.9'\n" +
    <snipped listing of compose variables>
henokgetachew commented 2 years ago

The version deployed on docker hub was an older version. New version of the upgrade service deployed. I think this should solve the issue. I have redeployed the upgrade service to the k8s deployment too. Can you test again?

henokgetachew commented 2 years ago

Confirmed this works. Closing as taken care of.