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

Receiving error response of "oops" #84

Closed
blackgirlbytes opened this issue Dec 1, 2021 · 7 comments
Closed

Receiving error response of "oops" #84

blackgirlbytes opened this issue Dec 1, 2021 · 7 comments

Comments

@blackgirlbytes
Copy link

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
Copy link
Contributor

gr2m commented Dec 1, 2021

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

return {
statusCode: error.status || 500,
error: "ooops",
};

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
Copy link
Author

blackgirlbytes commented Dec 1, 2021

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
An extension for running Probot on Lambda. Contribute to probot/adapter-aws-lambda-serverless development by creating an account on GitHub.

@gr2m
Copy link
Contributor

gr2m commented Dec 1, 2021

ref #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
Copy link
Author

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
Copy link
Contributor

gr2m commented Dec 2, 2021

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
Copy link
Author

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
Copy link
Contributor

gr2m commented Dec 2, 2021

okay no worries, thanks for checking.

I guess we can close this issue now?

@gr2m gr2m closed this as completed Dec 2, 2021
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

2 participants