probot / adapter-aws-lambda-serverless

An extension for running Probot on Lambda
ISC License
93 stars 36 forks source link

Receiving error response of "oops" #84

Closed blackgirlbytes closed 2 years ago

blackgirlbytes commented 2 years ago

I'm building a probot app that when a user stars a repo, they either get invited to the repo or an issue is opened depending on specific situations. The probot app was working great when I tested via smee, but now that I've put this up on aws lambda I've run into issues.

Initially, I had followed directions from this guide: https://bdougie.github.io/sls-probot-guide/

I realized that part of my issue was the directions are using a deprecated npm package called @probot/serverless-lambda.

I followed the directions found in this repository, and I'm using @probot/adapter-aws-lambda-serverless instead, but when I hit my lambda function, I receive an error that's not very descriptive. It just says "oops".

See screenshot: image

Here's my PR: https://github.com/maintainers/invite-automation/pull/33/files

https://github.com/maintainers/invite-automation: whole repo

For my GitHub app..I updated my url. Perhaps, I haven't done that part correctly?

gr2m commented 2 years ago

It looks like the object that is logged out is coming from here:

https://github.com/probot/adapter-aws-lambda-serverless/blob/8307a870c7a637c0ee2aee1a23b372936bb924d8/lambda-function.js#L29-L32

Can you somehow edit the code directly and log out the error object above line 29?

I think we should also be able add more information beyond just statusCode and error, but I'm not sure if there is a certain schema we have to follow when returning the object from the lambda function?

blackgirlbytes commented 2 years ago

I tried adding a console.log in the file in my code, but I'm not able to see any of the logs..so I made a temporary PR.

https://github.com/probot/adapter-aws-lambda-serverless/pull/85/files

image

GitHub
fix:temporarily debugging an error by blackgirlbytes · Pull Request #85 · probot/adapter-aws-lambda-serverless
An extension for running Probot on Lambda. Contribute to probot/adapter-aws-lambda-serverless development by creating an account on GitHub.
gr2m commented 2 years ago

ref https://github.com/probot/adapter-aws-lambda-serverless/pull/85

When you run sls invoke --function router, does that run your lambda function? The function assumes that it receives a GitHub Webhook request, with a JSON request body and the correct signature. I'm not sure if invoking it from the command line like that will work?

blackgirlbytes commented 2 years ago

oh 🤦‍♀️ That makes a lot of sense. I thought that sls invoke was running the lambda function was running everything in full. I tried it out with just a sls deploy and actually starring my repo. I didn't receive that error anymore. Thanks for your patience..So I'm good over here for now. Just user error and nothing to do with probot or octokit.

gr2m commented 2 years ago

if you don't mind, I wonder if the additional error context is helpful. When you run sls invoke --function router with the beta version we just released, what does the output look like now? Could you share it please?

blackgirlbytes commented 2 years ago

unfortunately ,when I ran sls invoke --function router after installing the beta version, it didn't print any information from my console.log(). I still saw the same message of {statusCode: 500, error: "oops"}

😞

gr2m commented 2 years ago

okay no worries, thanks for checking.

I guess we can close this issue now?