Typesense auto embedding connection failure
armsgora
PROOP

6 months ago

I'm trying to add an auto embedding field to my Typesense collection but it seems there is a networking issue between my server and the embedding server.

https://typesense.org/docs/29.0/api/vector-search.html#option-b-auto-embedding-generation-within-typesense

`I20250912 16:49:22.570407 386 collection.cpp:6186] Collection products is being prepared for alter…

I20250912 16:49:22.570572 386 embedder_manager.cpp:14] Validating and initializing remote model: openai/gemini-embedding-001

E20250912 16:49:22.571105 386 http_client.cpp:231] CURL failed. Code: 7, strerror: Couldn't connect to server, method: POST, url: http://10.250.12.117:8118/proxy

I20250912 16:49:22.571277 386 collection.cpp:6200] Alter failed validation: OpenAI API error: `

I tried it with both OpenAI and other providers embeddings. I have this working on another server fine fwiw (trying to migrate to Railway).

Solved$10 Bounty

4 Replies

armsgora
PROOP

6 months ago

I noticed the port was 8118 so I added a TCP proxy for it, but then it gives me a custom domain I'm not sure how to use (or if it would help)


armsgora
PROOP

6 months ago

I think the issue is calling get_instance on the http client in typesense is returning that url

and the reverse proxy is set up for port 8118 https://github.com/railwayapp-templates/typesense/blob/main/Caddyfile

so is it internally trying to connect to the reverse proxy and failing? or is it being forced to some sort of invalid proxy?


armsgora
PROOP

6 months ago

I noticed Typesense was routing external embedding calls to its own /proxy and being unable to connect to "itself".

I changed --api-address=0.0.0.0 in start_typesense.sh and it seems to have fixed it.

(I used AI to help me explain this, so take it with a grain of salt):

I think when we set --api-address=127.0.0.1, Typesense was:

  • Auto-detecting Railway's internal Docker network IP (10.250.12.106) for its raft peering system

  • Treating itself as part of a cluster even though you intended single-node operation

  • Trying to proxy embedding API calls through the "raft leader" at that internal IP

  • Failing because 10.250.12.106:8118 wasn't accessible within Railway's networking

So with 0.0.0.0 binding, Typesense's network auto-detection logic properly recognized it as a single-node setup and bypassed the raft leader proxy entirely.


6 months ago

^^Yup this is correct (apologies though I can't payout a bounty for an answer to your own question)


Status changed to Awaiting User Response Railway 6 months ago


Status changed to Open jake 6 months ago


Status changed to Open jake 6 months ago


Status changed to Solved noahd 6 months ago


Loading...