Github action errors on qovery helm update 401 unauthorized

Hi,

Running the below GHA:

name: "qovery - clone"

permissions:
  actions: write
  checks: write
  contents: write
  deployments: write
  id-token: write
  issues: write
  discussions: write
  packages: write
  pages: write
  pull-requests: write
  repository-projects: write
  security-events: write
  statuses: write

on:
  pull_request:
    # you must have types added as labeled is not counted as a default type for pull-request and
    # we know folks will forget to label it and need to do it after the pr is created
    types: [opened, synchronize, reopened, labeled]
    branches: [ master ]
  workflow_dispatch:
jobs:
  qovery-clone:
    # check Pull request has the idp label (If so create a environment)
    if: >-
        contains(github.event.pull_request.labels.*.name, 'idp')
    runs-on: ubuntu-latest
    steps:
      - name: check out
        uses: actions/checkout@v3

      # create a variable with the branch in lowercase (qovery cant handle uppercase)
      - name: Extract branch name
        shell: bash
        run: |
          branch=$(echo "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" | tr '[:upper:]' '[:lower:]')
          echo "branch=$branch" >> "$GITHUB_OUTPUT"
        id: extract_branch

      - name: Qovery Install
        run: |
          curl -s https://get.qovery.com | bash
        env:
          QOVERY_CLI_ACCESS_TOKEN: ${{ secrets.QOVERY }}

      # let this fail silently (continue-on-error) as after the first deploy this step will fail
      - name: Qovery Clone
        run: |
          # Execute the first command and capture its output
          output=$(qovery environment list --organization "Open Corporates" --project "Open Corporates" --json | jq -r '.[] | select(.name == "${{ steps.extract_branch.outputs.branch }}")')

          # Check if the output is empty
          if [ -z "$output" ]; then
            # The output is empty, so clone the environment
              qovery environment clone \
              --organization "Open Corporates" \
              --project "Open Corporates" \
              --environment "entity-store" \
              --new-environment-name ${{ steps.extract_branch.outputs.branch }}
          else
            echo "Environment found, no need to clone."
          fi
        env:
          QOVERY_CLI_ACCESS_TOKEN: ${{ secrets.QOVERY }}

      - name: Qovery Branch Update Terraform
        run: |
          qovery lifecycle update \
          --organization "Open Corporates" \
          --project "Open Corporates" \
          --environment ${{ steps.extract_branch.outputs.branch }} \
          --lifecycle "Entity Store - Terraform" \
          --branch $GITHUB_HEAD_REF \
        env:
          QOVERY_CLI_ACCESS_TOKEN: ${{ secrets.QOVERY }}

      - name: Qovery Branch Update Helm
        run: |
          qovery helm update \
          --organization "Open Corporates" \
          --project "Open Corporates" \
          --environment ${{ steps.extract_branch.outputs.branch }} \
          --helm "Entity Store - Helm" \
          --chart_git_commit_branch $GITHUB_HEAD_REF
        env:
          QOVERY_CLI_ACCESS_TOKEN: ${{ secrets.QOVERY }}

      - name: Qovery Deploy
        run: |
          qovery environment deploy \
          --organization "Open Corporates" \
          --project "Open Corporates" \
          --environment ${{ steps.extract_branch.outputs.branch }} \
          --watch
        env:
          QOVERY_CLI_ACCESS_TOKEN: ${{ secrets.QOVERY }}

      - uses: actions/github-script@v6
        with:
          script: |
            github.rest.issues.createComment({
            issue_number: context.issue.number,
            owner: context.repo.owner,
            repo: context.repo.repo,
            body: `# Qovery Environment

              # Deployment
              Environment deployed go to ingress: [${{ steps.extract_branch.outputs.branch }}-entity-store-api.opencorporates.dev](https://${{ steps.extract_branch.outputs.branch }}-entity-store-api.opencorporates.dev)`
            })

This used to run successfully, But now im getting errors on the helm update (NOTE looking at the console, it has indeed updated the branch)

1s
Run curl -s https://get.qovery.com | bash
##################################
#                                #
#       QOVERY CLI INSTALL       #
#                                #
##################################

[+] Downloading Qovery CLI archive...
[+] Uncompressing qovery binary in /usr/local/bin directory (sudo permissions are required)

Qovery CLI is installed, you can now use 'qovery' command line
1s
Run # Execute the first command and capture its output
Environment is cloned!
1s
Run qovery lifecycle update \
Lifecycle Entity Store - Terraform updated!
0s
Run qovery helm update \
Error: status code: 401 Unauthorized ; body: 
Error: 401 Unauthorized
Error: Process completed with exit code 1.

bit random!

i update the install step to do it manually so i can fix it to a specific version (i know this worked on 84 so wondered if it was because of 85.

      - name: Qovery Install
        run: |
          # curl -s https://get.qovery.com | bash
          curl -LO https://github.com/Qovery/qovery-cli/releases/download/v0.85.0/qovery-cli_0.85.0_linux_amd64.tar.gz
          tar xzf qovery-cli_0.85.0_linux_amd64.tar.gz
          chmod +x qovery
          sudo mv qovery /usr/local/bin/

          qovery version

the job is now running without error!?!?!?

just created a new branch and thats not working, not sure if its working after mutliple runs?

Hello,

I am going to take a look at it

I haven’t managed to reproduce on my side,
Would you mind sharing a console.qovery.com URL on a env where you have this issue.

At least the helm repository, where you encounter this issue, would help.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.