Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHT deploy script error: upgrade-service image referenced incorrectly #9077

Open
1yuv opened this issue Apr 30, 2024 · 5 comments
Open

CHT deploy script error: upgrade-service image referenced incorrectly #9077

1yuv opened this issue Apr 30, 2024 · 5 comments
Labels
Type: Bug Fix something that isn't working as intended

Comments

@1yuv
Copy link
Member

1yuv commented Apr 30, 2024

Deploying with latest (master) cht-script results in incorrectly tagged pod and the service image is incorrect.

Steps to replicate:

  1. Check out current master

  2. Create values.yaml with this document reference

  3. Apply this with ./cht-deploy script from cht-core/scripts/deploy.

  4. When it completes applying, you get sucessful deployment.

  5. Check the status of pods. upgrade-service is failed at InvalidImageName.

    ➜  deploy git:(master) ✗ k -n yuvraj-dev get po                                       
    NAME                                       READY   STATUS             RESTARTS   AGE
    cht-api-5f99b5684f-5kl44                   1/1     Running            0          9m11s
    cht-couchdb-ffd46779-hlq72                 1/1     Running            0          9m11s
    cht-haproxy-8f66cb488-5vzkx                1/1     Running            0          9m11s
    cht-haproxy-healthcheck-7fbc585b9c-bznrx   1/1     Running            0          9m11s
    cht-sentinel-56f958f5b4-62htm              1/1     Running            0          9m11s
    upgrade-service-8c894c85c-7jbvl            0/1     InvalidImageName   0          9m11s
    
  6. When you inspect the pod, you get detailed error:

     state:
       waiting:
         message: 'Failed to apply default image tag "medicmobile/upgrade-service:medicmobile/upgrade-service:0.32":
           couldn''t parse image reference "medicmobile/upgrade-service:medicmobile/upgrade-service:0.32":
           invalid reference format'
         reason: InvalidImageName
    
  7. The reason for this is image is being referenced incorectly.

    spec:
      containers:
      - env:
        - name: CHT_NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
        - name: CHT_DEPLOYMENT_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.labels['cht.service']
        - name: UPGRADE_SERVICE_PORT
          value: "5008"
        image: medicmobile/upgrade-service:medicmobile/upgrade-service:0.32
        imagePullPolicy: IfNotPresent
        name: upgrade-service
@1yuv 1yuv added the Type: Bug Fix something that isn't working as intended label Apr 30, 2024
@1yuv
Copy link
Member Author

1yuv commented Apr 30, 2024

This could possibly be a bug in medic/helm-charts.

The correct image tag for this deployment's container definition should be:

image: medicmobile/upgrade-service:medicmobile/upgrade-service:0.32

I was able to run upgrade-service after I edited deployment and pointed to correct image tag.

@henokgetachew
Copy link
Contributor

This PR fixes it. It will be released today.

@dianabarsan
Copy link
Member

@1yuv Can you please verify that this has been resolved?

@1yuv
Copy link
Member Author

1yuv commented May 1, 2024

This is not fixed yet. I ran helm repo update and applied the changes just as specified here, and the issue is same.

NAME                                       READY   STATUS             RESTARTS   AGE
cht-api-5f99b5684f-4vwx4                   1/1     Running            0          11s
cht-couchdb-ffd46779-9n4z6                 1/1     Running            0          11s
cht-haproxy-8f66cb488-c6nt8                1/1     Running            0          11s
cht-haproxy-healthcheck-7fbc585b9c-p2869   1/1     Running            0          10s
cht-sentinel-56f958f5b4-9b7ts              1/1     Running            0          10s
upgrade-service-8c894c85c-4d4w8            0/1     InvalidImageName   0          11s

@latin-panda
Copy link
Contributor

I had to start an instance to check the CHT release quickly and experienced this exact issue today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Fix something that isn't working as intended
Projects
None yet
Development

No branches or pull requests

4 participants