question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Increased frequency of webhook handling errrors for pull_request.opened events after dependency upgrades

See original GitHub issue

Bug Report

Current Behavior Ever since upgrading probot from v9.11.2 to 9.11.7 and a bunch of @octokit packages (notably, a major upgrade of @octokit/endpoint from 5.5.1 to 6.0.3), I’ve noticed a significant increase on webhook handling errors that seem to be originating from pull_request.opened events.

 18:18:25.344Z ERROR event: Not Found (id=bafb5800-cc47-11ea-8c8e-959b67c42d2e)
  HttpError: Not Found
      at /app/node_modules/@octokit/request/dist-node/index.js:66:23
      at processTicksAndRejections (internal/process/task_queues.js:97:5)
      at async Job.doExecute (/app/node_modules/bottleneck/light.js:405:18)
   --
   event: {
     "event": "pull_request.opened",
     "id": "bafb5800-cc47-11ea-8c8e-959b67c42d2e",
     "installation": [installation ID]
     "repository": [org/repo-name]
   }
 18:18:25.345Z ERROR probot: Not Found
   HttpError: Not Found
       at /app/node_modules/@octokit/request/dist-node/index.js:66:23
       at runMicrotasks (<anonymous>)
       at processTicksAndRejections (internal/process/task_queues.js:97:5)
       at async Job.doExecute (/app/node_modules/bottleneck/light.js:405:18)
18:18:25.346Z  INFO http: POST / 500 - 108.98 ms (id=03a667d0-0e1f-9513-afa8-d10c76b949fd)

However, these failures seem to be intermittent and I can’t seem to reliably reproduce them. When I resend these webhooks, they typically do go through successfully.

Environment

  • Probot version(s): [v9.11.7]
  • Node/npm version: [Node v12.13.0/npm 6.12.0]
  • OS: [OSX 10.14.6]

Additional context/Screenshots If it helps for investigation, here are some IDs of webhooks that failed to deliver: bafb5800-cc47-11ea-8c8e-959b67c42d2e 09dbd880-ccae-11ea-84ed-9044171588e2 a2715900-ccac-11ea-9c8b-e5f2be242192

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
gr2mcommented, Jul 28, 2020

Can you try to replace above code with

const { data: commits } = await octokit.pulls.listCommits({
  owner,
  repo,
  pull_number,
  request: { retries: 1 }
});

This will retry the request once if it fails, for any status code. This comes from the retry Octokit plugin, which Probot uses

0reactions
stale[bot]commented, Oct 12, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webhooks - GitLab Docs
The webhook listens for specific events and GitLab sends a POST request with data ... Instead, implement a queue to handle webhooks after...
Read more >
Best practices for using webhooks | Stripe Documentation
Handle duplicate events. Webhook endpoints might occasionally receive the same event more than once. We advise you to guard against duplicated event receipts...
Read more >
Webhook events and payloads - GitHub Docs
This event occurs when there is activity relating to commit comments. For more information about commit comments, see "Commenting on a pull request....
Read more >
Troubleshoot webhooks | Bitbucket Cloud - Atlassian Support
When you perform an action to trigger a webhook and it doesn't work, you can use the Request log and Request detail pages...
Read more >
Dynamic Admission Control | Kubernetes
Mutating admission webhooks are invoked first, and can modify objects sent to the API server to enforce custom defaults. After all object ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found