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
AWS Lambda timed out #1754
Comments
This problem only appears when using |
I fixed that problem by |
Thanks for reporting @UWellFail! It would be really awesome, if you could have a minimal reproduction repo, so that we can reproduce this! |
@timsuchanek
|
I was unable to reproduce this with the instance that I have deployed: https://v47qk2xs35.execute-api.us-east-1.amazonaws.com/dev/ Also, try this again with the latest version |
@pantharshit00 https://www.dropbox.com/s/rd4gj26xovrlozr/Screen%20Recording%202020-03-06%20at%2019.05.23.mov?dl=0 |
Thanks for the video. Indeed I can also reproduce this after I followed the video. |
Another thing you can probably do is to set
for the Lambda handler instead of disconnecting the Prisma client and in the beginning of the handler check if Prisma/whatever the name of your Prisma client instance is already exists, as a warm Lambda runtime container would be able to reuse a previous instance, if the Prisma client instance is created outside of the Lambda handler function. |
Internal Note: First investigation by @timsuchanek at https://prisma-company.slack.com/archives/CUXLS0Z6K/p1584459490008300 |
I reproduced the timeout with https://github.com/UWellFail/prisma2--1754 I solved the timeout by modifying https://github.com/UWellFail/prisma2--1754/blob/master/src/index.js with exports.server = (event, context, cb) => {
+ // Set to false to send the response right away when the callback executes, instead of waiting for the Node.js event loop to be empty.
+ context.callbackWaitsForEmptyEventLoop = false;
return lambda.createHandler({
cors: {
origin: '*',
},
})(event, context, cb);
}; Can you please try that @UWellFail and confirm it solves your problem? |
@Jolg42 I try this solution, its solves my problem |
This should be in the docs 😄 |
Currently, I use
prisma2@2.0.0-preview022
,nexus@0.12.0-rc.13
,nexus-prisma@0.10.0
I deploy the app (with nexus-prisma crud) with Serverless to AWS Lambda and I have some problems.
After executing some query at the deployed endpoint, I couldn't open the
graphql playground
in the browser because lambda function now is timed out, but all the time while the page tries to open I can make requests to the endpoint with Graphql Playground app and these queries execute fine. After lambda timed out I can reload the page with graphql playground and that will work fine.This is AWS X-Ray for lambda:
In logs only this:
The text was updated successfully, but these errors were encountered: