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

Webhook payload decoding broken in latest release (v13.0.1) #1955

Closed
vedantmgoyal9 opened this issue Jan 26, 2024 · 12 comments
Closed

Webhook payload decoding broken in latest release (v13.0.1) #1955

vedantmgoyal9 opened this issue Jan 26, 2024 · 12 comments

Comments

@vedantmgoyal9
Copy link

Webhook deliveries started failing as soon as I upgraded to Probot v13.0.1.

image

@vedantmgoyal9 vedantmgoyal9 changed the title Webhook secret decoding broken in latest release (v13.0.1) Webhook payload decoding broken in latest release (v13.0.1) Jan 26, 2024
@wolfy1339
Copy link
Collaborator

can you share more details on your environment?

What is the HTTP response returned from Probot?

@wolfy1339
Copy link
Collaborator

Unfortunately I cannot reproduce this issue.
How are you passing through your webhook secret?

@wolfy1339
Copy link
Collaborator

Are you able to attach a debugger to the process and trace down the issue?

@Uzlopak
Copy link
Collaborator

Uzlopak commented Jan 26, 2024

What version of probot did you use before?

Not that this is due to octokit/webhooks.js#917 octokit/webhooks.js#916 octokit/webhooks.js#915

@Uzlopak
Copy link
Collaborator

Uzlopak commented Jan 31, 2024

Did you ensure that your webhook secret is correctly set?

It can be that your bot was before using a broken @octokit/webhooks package and it did not throw despite having an invalid secret configured.

So please ensure this.
Other than that, we can not reproduce it, solely based on the code you provided as it is actually a configuration issue.

@Uzlopak
Copy link
Collaborator

Uzlopak commented Jan 31, 2024

Please provide a minimal viable code example.

@Uzlopak
Copy link
Collaborator

Uzlopak commented Jan 31, 2024

Did you upgrade the example repo and deploy on vercel and could you reproduce the issue?

@Uzlopak
Copy link
Collaborator

Uzlopak commented Jan 31, 2024

I will put this repo on our todo list for upgrading to probot 13.
Do you deploy on vercel?

@Uzlopak
Copy link
Collaborator

Uzlopak commented Jan 31, 2024

Do you deploy your project on vercel?

@Uzlopak
Copy link
Collaborator

Uzlopak commented Jan 31, 2024

OK, investigated the issue.

The issue arises from the fact, that vercel preparses the body. So verify can not verify the body, as it is not a string.

You can get it to work for now, by setting NODEJS_HELPERS as Environment variable in vercel and as value you set it to 0.

See https://vercel.com/docs/functions/serverless-functions/runtimes/node-js#disabling-helpers-for-node.js

Then probot would work with vercel.

Learn how to use the Node.js runtime to compile Node.js Serverless Functions on Vercel.

@Uzlopak
Copy link
Collaborator

Uzlopak commented Jan 31, 2024

Proposed a PR to fix this issue octokit/webhooks.js#962 (comment)

@AaronDewes
Copy link
Member

#1964 may provide a better way of supporting Vercel & other platforms going forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants