#Timeout issue Convex API via Middleware.

25 messages · Page 1 of 1 (latest)

steel delta
#

Hi, I am trying to call convex api from a node.js middleware. Everything seems to work fine when I am running it locally but once deployed to Railway. There is a timeout issue with the api.
The server tries to connect with convex but it fails.

Any Idea?

kind condor
#

That ENETUNREACH ending with - Local (:::0) looks sus, any hardcoded addresses anywhere in your code?

steel delta
#

Nope, Nothing as such, for this one I passed a hardcoded convex url (for testing) but everything is from env other than that there is fastify websocket connection where this call gets invoked

kind condor
#

Is this self hosted?

steel delta
#

Nope

kind condor
#

Can you share the code with the api call

steel delta
#

Yeahh sure

#

this is where I am actually calling I have created a function for query that I am sharing with this

#

I hard coded the url currently to test but it's not hardcoded in general

kind condor
#

When you say running it locally works, are you running against a local or cloud deployment?

steel delta
#

Against a local, how you usually test your api, "npm run dev" then with the local host url you hit in my case using postman with this host http://localhost:3001/try-convex with some args, this works fine and returns the data but I have it deployed somewhere and it's a different domain that is accessing convex but I am assuming the APIs are public and that should not cause an issue.

kind condor
#

Can you try running convex dev on your machine against a cloud dev instance

#

If it happens there we can cut railway/production out of the issue and just debug in dev

steel delta
#

Ummm, this is not a convex project, it's a separate node application altogether with some logic for websockets.

kind condor
#

That's fine, I imagine you can run that node application locally. Run it locally against a Convex cloud dev deployment. If the issue reproduces, you can debug it locally.

steel delta
#

Okay, I am clueless now! I should just convex dev in the node-apps and this should work fine?

#

Oh Gotcha, on a side server i locally run convex then hit this url. I've tried that, the request doesn't reach to my local at all

kind condor
#

So you know how you can run the Convex dev server either locally or in a cloud deployment?

steel delta
#

npx convex dev --local --once

#

this right? I haven't tried it

kind condor
#

So when you're running convex dev locally, are you using that local flag or just npx convex dev

steel delta
#

nope not yet, I haven't ran it locally

kind condor
#

Everything seems to work fine when I am running it locally
What did this mean?

#

Are you running your node app locally against your production convex deployment?