BUG - Errors when updating an application with the CLI

I have an environment that contains an application that’s connected to GitHub. I’d like to use the CLI to update the branch it’s pointed at, but I get errors when doing that. Here’s what I’m doing:

QOVERY_CLI_ACCESS_TOKEN=XXX qovery application update --organization="Grayce" --project="grayce" --environment="[PR] - build: working on updating the build process for qovery" --application="Frontend" --auto-deploy=true --branch="demolio"

When I run this I get:

Error: 400 Bad Request

If I run it with verbose mode on, it ends up with an error like this:

2024/06/18 11:26:54
HTTP/2.0 400 Bad Request
Connection: close
Content-Type: application/problem+json
Date: Tue, 18 Jun 2024 15:26:54 GMT
Strict-Transport-Security: max-age=15724800; includeSubDomains

{"type":"about:blank","title":"Bad Request","status":400,"detail":"You don't have any provider configured for GITHUB","instance":"/api/application/52d4d791-80ba-4d9d-8a6c-2dabe917b62d","message":"You don't have any provider configured for GITHUB"}

I do have a git repository configured in the UI, and GitHub connections are working just fine in general. Am I doing something wrong in how I’m calling the CLI?

I’ve confirmed that this works fine using the API directly. The problem seems to be that the CLI is not passing the git token ID. When I call the edit application endpoint in the API, I’m sending this as the git repository block of the JSON in the request:

  "git_repository":{
    "branch":"demolio",
    "root_path":"/packages/frontend",
    "url":"https://github.com/withgrayce/grayce.git",
    "git_token_id":"XXXXXXX-0d5e-48ba-ac0e-40eabe01a0b3"
  },

When I look at the verbose output from the CLI, it’s only sending this:

"git_repository": {
  "branch":"demolio",
  "root_path":"/packages/frontend",
  "url":"https://github.com/withgrayce/grayce.git"
}

I got the git token id from querying the API for the application. I’m trying to do this from a GitHub Actions workflow, so I guess I could figure out how to use the API directly there, but it’s going to be pretty yucky. I don’t see any available arguments for the CLI that would make it behave the way I need it to.

I’ll take a look at the CLI code and see about submitting a PR to fix this but it’d be great to get a little help on this.

All right, I created a PR for the CLI here. It’s a simple change. I suppose it could break something for situations different from mine, but all it’s doing is passing back the token id that it got from the query about the application, so it seems pretty safe to me…

1 Like

Someone from our engineering team will look into it - but I want to thank you @aubrey :pray: it’s really much appreciated

1 Like

Hey @aubrey !

Thanks a lot for your contribution here, much appreciated :slight_smile:

I am having a look at your PR and will merge / release it once all good !

Cheers

2 Likes

Thanks for your contribution @aubrey, fix have been merged and released in v0.94.14.

Let me know if it fixes your issue !

2 Likes

@bchastanier yep, I’m all set, thanks!

2 Likes

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