GitHub Probot : ERROR probot : signature does not match event payload and secret
Asked Answered
E

1

7

I am trying to build a GitHub app using Probot Framework.

Here's the content of file index.js:

module.exports = (robot) => {
  robot.log('Yay, the app was loaded!');
  robot.on('*', async context => {
    robot.log('Some event occured!');
  });
}

However, when I am run this app, after installing it in a repository, I received this error:

03:38:34.831Z ERROR probot: signature does not match event payload and secret
  Error: signature does not match event payload and secret
      at verifyAndReceive (/mnt/e/GSoC/test/test/node_modules/@octokit/webhooks/middleware/verify-and-receive.js:9:19)
      at IncomingMessage.request.on (/mnt/e/GSoC/test/test/node_modules/@octokit/webhooks/middleware/middleware.js:53:5)
      at emitNone (events.js:106:13)
      at IncomingMessage.emit (events.js:208:7)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:138:11)
      at process._tickDomainCallback (internal/process/next_tick.js:218:9)

What is the problem behind this error? How can I fix this problem?

Eliga answered 29/3, 2018 at 4:3 Comment(1)
Did you fix this? I have the same issue in production (on vercel edge) and it works locally. I generated new secrets and replaced every single environment variable like 3 times, but it didn't help.Bandurria
E
9

It says, signature does not match event payload and secret.

The possible reason behind this is that the WEBHOOK_SECRET in .env file of the repository doesn't match with Webhook secret (optional) in https://github.com/settings/apps/your-app-name.

Correctly configuring webhook secret will fix this error.

enter image description here

Eliga answered 29/3, 2018 at 4:3 Comment(1)
In my case the WEBHOOK_SECRET env variable on Vercel, and the secret on GitHub is exactly the same but it still throws that error. Any idea?Meyers

© 2022 - 2024 — McMap. All rights reserved.