R
Railway12mo ago
raleng

Typesense service not reachable

I am using the typesense template (https://railway.app/template/DXBDVS), but I'm struggling to connect to the service. E.g. I only get timeouts for https://RAILWAY_PUBLIC_URL/health. Looking at the logs, the app seems to start ok, and Railway itself seems to be able to call the /health endpoint when it does deployments? Not really sure what the issue might be, whether it's my fault, Railway's, or typesense's. Project id: 68d08275-c56e-4204-ab46-04737e0cf4dc
14 Replies
Percy
Percy12mo ago
Project ID: 68d08275-c56e-4204-ab46-04737e0cf4dc
Brody
Brody12mo ago
looking into it
Brody
Brody12mo ago
im not seeng any issues? tell me more about how youre calling the url?
No description
raleng
ralengOP12mo ago
Thanks @Brody , the company VPN was at fault it seems and blocked the curl requests. The manual request work fine now, though the client from their npm package still times out. But that's not a Railway question I guess.
Brody
Brody12mo ago
well curl or node isnt gonna matter, if its blocked it will be blocked in both
raleng
ralengOP12mo ago
For sure. But turning the VPN off solved the manual timeouts, but not the node ones. So something else is going on as well.
Brody
Brody12mo ago
are you using some npm package?
raleng
ralengOP12mo ago
npm
typesense
Javascript Library for Typesense. Latest version: 1.7.2, last published: 2 months ago. Start using typesense in your project by running npm i typesense. There are 53 other projects in the npm registry using typesense.
raleng
ralengOP12mo ago
I think I found the issue.
Brody
Brody12mo ago
show me your Typesense.Client() ? youd need to set port to 443
raleng
ralengOP12mo ago
I was initializing the client with a node using "host" and "port". But I saw in the types for the client, that there is a "url" option. Just using that and using the Railway public URL works.
Brody
Brody12mo ago
host and port work fine, you just need to specify the correct host, port, and protocol
let client = new Typesense.Client({
'nodes': [{
'host': '<RAILWAY_DOMAIN>',
'port': '443',
'protocol': 'https'
}],
'apiKey': '<API_KEY>',
'connectionTimeoutSeconds': 2
})
let client = new Typesense.Client({
'nodes': [{
'host': '<RAILWAY_DOMAIN>',
'port': '443',
'protocol': 'https'
}],
'apiKey': '<API_KEY>',
'connectionTimeoutSeconds': 2
})
raleng
ralengOP12mo ago
Ah, you are right. I was confusing the internal port for typesense with the https one. Fixing that and everything works. Thanks a bunch!
Brody
Brody12mo ago
no problem!
Want results from more Discord servers?
Add your server