newrelic / deployment-marker-action

Github Action for recording a Deployment Marker in New Relic
https://github.com/marketplace/actions/new-relic-application-deployment-marker
Apache License 2.0
58 stars 23 forks source link

action failing with 'Cannot query field "customAttributes" on type "ChangeTrackingDeployment"' error #51

Closed benburkert closed 8 months ago

benburkert commented 8 months ago

I'm using newrelic/deployment-marker-action@v2.4.0 and earlier today action runs started failing with the message Error: level=fatal msg="Cannot query field \"customAttributes\" on type \"ChangeTrackingDeployment\".". Here is the log for the step:

2023-10-30T18:52:16.4224730Z ##[group]Run newrelic/deployment-marker-action@v2.4.0
2023-10-30T18:52:16.4225273Z with:
2023-10-30T18:52:16.4225685Z   apiKey: ***
2023-10-30T18:52:16.4226082Z   commit: 907328f41047766fe14794f81f92b19304b1427d
2023-10-30T18:52:16.4226594Z   deploymentType: BLUE_GREEN
2023-10-30T18:52:16.4227026Z   description: Github Actions Deploy
2023-10-30T18:52:16.4227504Z   groupId: Github Actions Deploy: main
2023-10-30T18:52:16.4228093Z   guid: ***
2023-10-30T18:52:16.4228398Z   user: benburkert
2023-10-30T18:52:16.4228729Z   version: main
2023-10-30T18:52:16.4229056Z   region: US
2023-10-30T18:52:16.4229357Z env:
2023-10-30T18:52:16.4229836Z   NEW_RELIC_GUID: ***
2023-10-30T18:52:16.4230202Z ##[endgroup]
2023-10-30T18:52:16.4530785Z ##[command]/usr/bin/docker run --name b835f03f612be9e5438aacffd18e69ecdf55_d1258d --label 47b835 --workdir /github/workspace --rm -e "NEW_RELIC_GUID" -e "INPUT_APIKEY" -e "INPUT_COMMIT" -e "INPUT_DEPLOYMENTTYPE" -e "INPUT_DESCRIPTION" -e "INPUT_GROUPID" -e "INPUT_GUID" -e "INPUT_USER" -e "INPUT_VERSION" -e "INPUT_REGION" -e "INPUT_CHANGELOG" -e "INPUT_DEEPLINK" -e "NEW_RELIC_API_KEY" -e "NEW_RELIC_DEPLOYMENT_ENTITY_GUID" -e "NEW_RELIC_REGION" -e "NEW_RELIC_DEPLOYMENT_USER" -e "NEW_RELIC_DEPLOYMENT_VERSION" -e "NEW_RELIC_DEPLOYMENT_CHANGE_LOG" -e "NEW_RELIC_DEPLOYMENT_COMMIT" -e "NEW_RELIC_DEPLOYMENT_DESCRIPTION" -e "NEW_RELIC_DEPLOYMENT_DEEPLINK" -e "NEW_RELIC_DEPLOYMENT_TYPE" -e "NEW_RELIC_DEPLOYMENT_GROUP_ID" -e "NEW_RELIC_SERVICE_NAME" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_RESULTS_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/anchor/anchor":"/github/workspace" 47b835:f03f612be9e5438aacffd18e69ecdf55
2023-10-30T18:52:18.1942844Z level=fatal msg="Cannot query field \"customAttributes\" on type \"ChangeTrackingDeployment\"."
2023-10-30T18:52:18.2064726Z ##[error] level=fatal msg="Cannot query field \"customAttributes\" on type \"ChangeTrackingDeployment\"."

And here is what my action yml config looks like:

      - name: "Deploys: anchord New Relic deploy marker"
        env:
          NEW_RELIC_GUID: ${{ secrets.NEW_RELIC_BE_ANCHORD_PRD_GUID }}
        if: env.NEW_RELIC_GUID != ''
        uses: newrelic/deployment-marker-action@v2.4.0
        with:
          apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
          commit: ${{ github.sha }}
          deploymentType: "BLUE_GREEN"
          description: "Github Actions Deploy"
          groupId: "Github Actions Deploy: ${{ github.ref_name }}"
          guid: ${{ env.NEW_RELIC_GUID }}
          user: ${{ github.actor }}
          version: ${{ github.ref_name }}

The config hasn't changed recently and, as far as I know, the credentials are still valid.

dmrwebdev commented 8 months ago

Can confirm, we just ran into the same issue earlier.

fbuzila-g2 commented 8 months ago

I can confirm, we have the same issue too

tcarac commented 8 months ago

I don't see any recent commits to the action that might explain this so this is most likely a breaking change in the API ?

barryhagan commented 8 months ago

The action is setup to float to the latest version of the newrelic/cli container and that is now on v0.74 of the cli.

Unfortunately the latest cli version is expecting a property from their graphql api (NerdGraph), which isn't live yet. Either they need to deploy the updated graphql api or roll back the cli to not ask for the missing property.

Not much you can do about this since they deployed a change in their client before the server, and allow the action to float to latest client.

jackie-linz commented 8 months ago

yeah, this PR was merged in 4 hours ago, causing this issue 🤦

https://github.com/newrelic/newrelic-cli/pull/1526

barryhagan commented 8 months ago

PR opened to fix this by pinning the cli. I'd argue it should always be pinned and handled like the dependency it is.

mbazhlekova commented 8 months ago

Sorry about that everyone. A version of the CLI went out today with an API that is not yet GA. I merged @barryhagan's PR to pin the CLI to the previous version hopefully unblocking you all.

benburkert commented 8 months ago

@mbazhlekova i think this will still be an issue until there is a new release of this repo. And for anyone who has pinned to the current point release, wont it require a new release of the cli docker container?

barryhagan commented 8 months ago

@benburkert - yeah, it is still an issue if you are using the versioned action like this:

  uses: newrelic/deployment-marker-action@v2.4.0

There needs to be a new release/tag to get an action version that is pinned to the working cli. You should be able to workaround this immediately by specifying the main branch until there is a tagged release after my PR. (a temporary fix, not recommended long term):

  uses: newrelic/deployment-marker-action@main

Alternatively, just reference the commit hash directly:

  uses: newrelic/deployment-marker-action@cd8b5c28275fac9b05f66df6f025090072612bb8
mbazhlekova commented 8 months ago

Actually we're going to release a new version of the CLI without the commit that's causing the problem to get around having to update the deployment marker version.

barryhagan commented 8 months ago

You should still release a v2.5.0 of this with the pinned CLI version. I appreciate that the CLI rollback will fix the 2.4.0 version that everyone is using for now, but that doesn't address the floating dependency problem.

Every single time someone runs this action, they are taking the latest release of the CLI container at that moment. As we found today, that is not always a good thing.

This is a stable solution that I will use until you tag a new release: image

mbazhlekova commented 8 months ago

@barryhagan v2.5.0 is out with your change to pin the version