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

Handle Slack errors #196

Open
scriptin opened this issue Mar 23, 2021 · 2 comments
Open

Handle Slack errors #196

scriptin opened this issue Mar 23, 2021 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@scriptin
Copy link

scriptin commented Mar 23, 2021

Hello,

One of our jobs has this as the last step:

    - uses: act10ns/slack@v1
      with:
        status: ${{ job.status }}
        channel: '#build-notifications'
      if: always()

In one build, this step failed with a following error:

Error: A request error occurred: read ECONNRESET
Error: Error: A request error occurred: read ECONNRESET
    at Object.requestErrorWithOriginal (/home/runner/work/_actions/act10ns/slack/v1/dist/index.js:2694:33)
    at IncomingWebhook.send (/home/runner/work/_actions/act10ns/slack/v1/dist/index.js:2584:32)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

As a result:

  • Our deployment has actually finished okay
  • This job failed
  • We haven't received a notification about either of those

I do understand that this particular error is caused by the Slack API, but the outcome is so confusing that I decided to create this issue anyway. Looking at your code, there is no error handling around IncomingWebhook.send call. I don't know if that would help, but maybe you know a way to prevent this from happening.

The best thing which comes to my mind is some basic retry strategy, which is only triggered whenever network errors like this one occur (ignoring the normal Slack errors). Something like promise-retry may be helpful.

@satterly satterly added the bug Something isn't working label Apr 14, 2021
@satterly
Copy link
Contributor

satterly commented Nov 7, 2021

Thanks for raising the issue. Contributions welcome.

@satterly satterly added the help wanted Extra attention is needed label Nov 7, 2021
@satterly
Copy link
Contributor

Example retry logic can be found here ... https://github.com/elastic/kibana/pull/41160/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants