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

Action fails silently when the API call fails #63

Open
4 of 10 tasks
kitchoi opened this issue Feb 22, 2022 · 3 comments
Open
4 of 10 tasks

Action fails silently when the API call fails #63

kitchoi opened this issue Feb 22, 2022 · 3 comments
Labels
bug Something isn't working enhancement New feature or request
Milestone

Comments

@kitchoi
Copy link

kitchoi commented Feb 22, 2022

Description

There may have been a network issue which causes an API call to fail. However, the workflow did not fail.
The workflow was using Slack Bot Token and a Channel ID while posting a payload.

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • example code related
  • testing related
  • discussion

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

Reproducible in:

package version: 1.16.0

node version:

OS version(s): Ubuntu 20

Steps to reproduce:

  1. With a step looking like this
  users: slackapi/slack-github-action@v1.16.0
  with:
    channel-id: XXXXX
    payload: {
    "text": "Some text",
    "blocks": [
      {
        "type": "section",
        "text": {
          "type": "mrkdwn",
          "text": "*Some text*"
        }
      }
    ]
  }
  env:
    SLACK_BOT_TOKEN: ***
  1. Not sure how you could simulate Slack API going down... I am guessing you want this line to raise an exception:
    await web.chat.postMessage({ channel: channelId, text: message, ...(payload || {}) });

It is worth noting that the said step runs fine many times, so I am pretty sure that the payload and parameters are set correctly.

Expected result:

The step causes the workflow to error

Actual result:

The workflow passes.

Attachments:

Error logged:


(node:2465) UnhandledPromiseRejectionWarning: Error: An API error occurred: fatal_error
    at Object.platformErrorFromResult (/home/runner/work/_actions/slackapi/slack-github-action/v1.16.0/dist/index.js:5082:33)
    at WebClient.apiCall (/home/runner/work/_actions/slackapi/slack-github-action/v1.16.0/dist/index.js:4685:28)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:2465) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2465) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
@seratch seratch added bug Something isn't working enhancement New feature or request labels Feb 22, 2022
@seratch seratch added this to the 1.19 milestone Feb 22, 2022
@seratch
Copy link
Member

seratch commented Feb 22, 2022

Hi @kitchoi, thanks for taking the time to report this issue. At that timing, the Slack server-side had an incident: https://status.slack.com/2022-02-22 If this GitHub action does not result in failure in the scenario, the error handling should be improved in future versions.

@kitchoi
Copy link
Author

kitchoi commented Feb 22, 2022

Thank you @seratch for your prompt response.

In case this helps, I was able to reproduce a similar silent failure by deliberately supplying a channel ID that does not exist:

(node:1680) UnhandledPromiseRejectionWarning: Error: An API error occurred: channel_not_found
    at Object.platformErrorFromResult (/home/runner/work/_actions/slackapi/slack-github-action/v1.16.0/dist/index.js:5082:[33](https://github.com/organization/repo/runs/5295133106?check_suite_focus=true#step:7:33))
    at WebClient.apiCall (/home/runner/work/_actions/slackapi/slack-github-action/v1.16.0/dist/index.js:4685:28)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:1680) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1680) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@seratch
Copy link
Member

seratch commented Feb 22, 2022

Thanks. Yes, I managed to reproduce the issue on my end.

@seratch seratch modified the milestones: 1.19, 1.20 May 4, 2022
@seratch seratch modified the milestones: 1.20, 1.x Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants