#community-help

Resolving "Error: socket hang up" in NodeJS Running on Typesense Cloud

TLDR Sruli experienced socket hang ups running NodeJS on Typesense Cloud. Jason guided to fix the issue by verifying was incorrectly using http instead of https, which resolved the issue.

Powered by Struct AI
14
9mo
Solved
Join the chat
Dec 28, 2022 (9 months ago)
Sruli
Photo of md5-8c57c435e01337c18bf32b8f7749cabf
Sruli
04:07 PM
Running on nodejs, getting an error
Error: socket hang up

does this have to do with an API key issue?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:09 PM
No, API Key issues will throw a concrete error
04:09
Jason
04:09 PM
This is most likely due to a client-side timeout issue
04:09
Jason
04:09 PM
You want to increase the client-side timeout to a really high value when importing documents, since indexing is syncronous in Typesense
Sruli
Photo of md5-8c57c435e01337c18bf32b8f7749cabf
Sruli
04:19 PM
It’s just a test, I’m not importing a lot of documents, just querying
04:20
Sruli
04:20 PM
It should be empty, I just want to see it return 0…
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:20 PM
Hmm, how are you running Typesense?
Sruli
Photo of md5-8c57c435e01337c18bf32b8f7749cabf
Sruli
04:20 PM
Cloud
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:20 PM
Could you DM me your cluster ID?
04:26
Jason
04:26 PM
Metrics look good on your cluster. Could you share the full code snippet that throws the error?
Sruli
Photo of md5-8c57c435e01337c18bf32b8f7749cabf
Sruli
04:28 PM
I just looked over the connection options and noticed I put http instead of https when I switched from local to cloud
04:28
Sruli
04:28 PM
Now it’s working, thanks!!
04:28
Sruli
04:28 PM
Very very cool and easy to use software!
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:28 PM
Awesome! 🙌