-
Notifications
You must be signed in to change notification settings - Fork 86
[Bug]: __netlify-handler function times out #1174
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
Comments
Hi. Can you share a reproduction repository? |
Hi - The repo is private, so I cannot share it. But, I can try to create a sample public repo if needed. |
If you can that would be great. If you can share your routes-manifest and prerender-manifest that would be great too |
I tried reproducing the error in a sample project but it gets deployed properly. The routes-manifest and prerender-manifest does not have much but I have shared them below. routes-manifest
prerender-manifest
|
To confirm, those are the manifests for the sample project that deployts correctly, or for the private site that fails to deploy? |
It is for the one that fails. |
I testet a couple of other things:
Now i'm stuck because the function log is empty apart from the timeout message. Is there a debug option or something I can turn on to dig deeper? |
Same problem here with cal.com open source project. You can test it with the fork that I've successfully deployed to Netlify (just added a .env to prevent build failing) here: https://github.com/Pin-Pon-dev/cal.com The official guide recommends Vercel and no issues are reported about this problem AFAIK (not tested myself). |
I have the same issue 😢 https://github.com/cosimochellini/aws-share-files On vercel has no problem On netlify goes on timeout |
Can anyone who has this issue please share the function logs for |
I also have the same issue 😞 with the latest version |
same as @phillippbertram No logs are shown on the https://app.netlify.com/sites/{{yoursite}}/functions/___netlify-odb-handler section (lattanabooks) in my case ps. obviously I run some lambda during this range of time 😢 |
@ascorbic update: |
Like everyone here, we have the same problem on a private codebase i can't share, with 4.3.0
Dev build, the request take 919.62ms :
And as @cosimochellini and @phillippbertram, no logs in every serveless function instead of the timed out message. |
It's a bit hard for me to see for sure, but it seems like the common factor for all of these is that each of them is making a request to an external API. I've not been able to reproduce any of the shared sites, because they all require API keys to run. Does this request take longer than 10 seconds? If so, then the issue is simply that by default Netlify Functions have a 10s timeout. This can be increased for paid accoutns. When running lcoally, how long does the request take? |
I'm not sure cal.com makes an API call when loading the connected user homepage. However, it makes DB calls for sure. You can try to deploy my working fork of cal.com https://github.com/Pin-Pon-dev/cal.com I've tested the same repository locally, using the same Supabase database, it's pretty fast and smooth. |
Hi @tuarrep It would be really useful if somebody could provide a self-contained reproduction that doesn't require me to create databases on an external service, or setup AWS credentials etc. |
Can everyone who is experiencing this problem please check if they're using Material Icons? In @mkubdev 's reproduction it turned out that it was taking 9 seconds to require a single icon from If you are using Material icons, please see the usage docs for how to efficiently load them. Otherwise you will be importing all 2000+ icons every time, with serious consequences for performance. |
@ascorbic yes, I've been using these icons! in the late afternoon, I try to import the icons in the correct way and I'll let you know! |
@ascorbic great news! I confirm that importing import AccessAlarmIcon from '@mui/icons-material/AccessAlarm'; instead of import { AccessAlarm, ThreeDRotation } from '@mui/icons-material'; It dramatically improves the performance of the API routes 🎉💃. It's a really strange behavior since the API does not require (in my codebase) any icons. PS, I have a strong suspicion that the same problem can occur with the So is waay better to do this import Button from '@mui/material/Button'; instead of import { Button } from '@mui/material'; |
That's great! The reason it happens is because Next loads _app and _document for every request, even API routes. You will probably get even better performance if you use Netlify Functions instead of Next API routes if possible, as they don't have any of the Next overhead, and will just run directly without loading any other runtime. |
This issue is resolved for me as well after changing the import. Thanks for the help. |
I can confirm too that removing |
I think cal.com doesn't use |
- Fixing an issue with mui/material-icons breaking Netlify's deploy opennextjs/opennextjs-netlify#1174 (comment) - Made some small changes to the image component, making the alt property more intuitive - Fixed some faulty notFound returns in our slug page - Hard locked the current Next version - Updated our Node version to 18
- Fixing an issue with mui/material-icons breaking Netlify's deploy opennextjs/opennextjs-netlify#1174 (comment) - Made some small changes to the image component, making the alt property more intuitive - Fixed some faulty notFound returns in our slug page - Hard locked the current Next version - Updated our Node version to 18
- Fixing an issue with mui/material-icons breaking Netlify's deploy opennextjs/opennextjs-netlify#1174 (comment) - Made some small changes to the image component, making the alt property more intuitive - Fixed some faulty notFound returns in our slug page - Hard locked the current Next version - Updated our Node version to 18
Can confirm, solution above worked for me on a hobby tier Vercel deploy that was giving 504 Gateway Timeout errors, even for requests sent to my After a full day of debugging, reading docs, and consulting ChatGPT, I can't believe this was it. |
- Fixing an issue with mui/material-icons breaking Netlify's deploy opennextjs/opennextjs-netlify#1174 (comment) - Made some small changes to the image component, making the alt property more intuitive - Fixed some faulty notFound returns in our slug page - Hard locked the current Next version - Updated our Node version to 18
I'm using shadcn UI and it is using react-icons under the hood. Does it solve for that as well? |
Hey people. If I use a mongoose lib shoul I change an import {Schema, model, models} from 'mongoose' with it's 871Kb ? |
Summary
After upgrading from version 3.9 to 4.2.1, the site builds properly but after when visiting the page, it times out and gets a 502 error from the __netlify-handler function. It gives back the following error -
{"errorMessage":"2022-01-28T15:53:17.566Z dcfe2e2a-53a5-44ef-a864-61fd6b598654 Task timed out after 10.01 seconds"}
The same version of the code was working fine with the version 3.9. The logs for
__netlify-handler
only show a timeout error and there is no other info which can be used for debugging.Steps to reproduce
.
A link to a reproduction repository
No response
Plugin version
4.2.1
More information about your build
netlify.toml
)What OS are you using?
No response
Your netlify.toml file
`netlify.toml`
Your public/_redirects file
`_redirects`
# Paste content of your `_redirects` file here
Your
next.config.js
file`next.config.js`
# Paste content of your `next.config.js` file here. Check there is no private info in there.
Builds logs (or link to your logs)
Build logs
Function logs
Function logs
.next JSON files
generated .next JSON files
The text was updated successfully, but these errors were encountered: