netlify/remix-compute

The `remix-adapter` times out when deployed to netlify and connects to Mongodb

Closed this issue · 1 comments

Bug details

I am using the netlify remix adapter. When I am running my app locally the loaders run and return within a few milliseconds when I connect to mongodb.

When I deploy to netlify, every loader that is connecting to mongodb gives me the message "Task timed out after 10.2 seconds".

I put console logs in the request and it actually finishes within milliseconds, but it hangs out until it times out to return.

It looks like it was fixed for next-runtime here, I'm wondering if its the same issue with callbackWaitsForEmptyEventLoop being set to true

To Reproduce

  1. create a remix app using npx create-remix@latest --template netlify/remix-template
  2. create a route with a loader
  3. within the loader connect to a mongo database
  4. deploy to netlify

Expected behavior

The expectation is that the remix-adapter will work like it does in local development, that is, when a loader is being used, and it connects to mongodb, the request will not take the entire timeout duration of 10seconds when it only took a few milliseconds to actually execute

Screenshots

Screenshot 2024-02-22 at 8 34 52 AM

Desktop

  • OS: Darwin
  • Browser: chrome

Additional Context

https://answers.netlify.com/t/netlify-function-runs-into-timeout-being-idle-for-10-seconds-between-last-log-statement-and-sending-response/35607/8

@skellertor We're sorry you didn't get a prompt response here. I hope you were able to resolve your issue. Since this issue is quite stale, I'm going to close it, but please feel free to open a new issue with repro steps if you're still having issues, or (even better) seek help at https://answers.netlify.com/. Thanks.