CircleCI-Public / slack-orb

Create custom Slack notifications for CircleCI job statuses
https://circleci.com/developer/orbs/orb/circleci/slack
MIT License
214 stars 206 forks source link

Failing to Send Notifications with vague `invalid_block` error #423

Open calebstewart opened 1 year ago

calebstewart commented 1 year ago

Orb version:

4.10.1

What happened:

Our CircleCI job is failing (well, the notification is failing; the job succeeds. see #418) with the error invalid_blocks. There is no other information given. The output from the job is:

Posting Status
BASH_ENV file: /tmp/.bash_env-64a8995526596f189294e247-0-build
Exists. Sourcing into ENV
Checking For JQ + CURL
Sending to Slack Channel: ***********
Slack API returned an error message:
"invalid_blocks"

The job looks like this:

      - slack/notify:
          event: pass
          custom: |
            {
              "blocks": [
                {
                  "type": "section",
                  "text": {
                    "type": "mrkdwn",
                    "text": "*Deployment succeeded for `$CIRCLE_TAG`!*"
                  }
                },
                {
                  "type": "section",
                  "text": {
                    "type": "mrkdwn",
                    "text": "Release Notes:\n```\n$RELEASE_NOTES```\n"
                  }
                },
                {
                  "type": "section",
                  "text": {
                    "type": "mrkdwn",
                    "text": "<[url-to-github-repo]/blob/$CIRCLE_TAG/CHANGELOG.md|Full Changelog>"
                  }
                },
                {
                  "type": "section",
                  "text": {
                    "type": "mrkdwn",
                    "text": "_pssst <!subteam^[team-id]> <!subteam^[team-id]>_"
                  }
                }
              ]
            }

Expected behavior:

The notification should be posted properly to the slack channel. The blocks above are valid when I open the block builder, and render properly.

Additional Information:

This was working up until about a week and a half to two weeks ago, and the job has not been modified since.

mayank0202 commented 8 months ago

Please use circleci/slack@4.12.6 and everything will be resolved

marboledacci commented 3 weeks ago

@calebstewart In case this is still happening could you please provide more details. The executor and shell config you are using.