#community-help

Typesense Search Functionality Issue on CentOS Client Server

TLDR Shabber is facing an issue with Typesense search functionality on a CentOS client server. The curl request works, but not from JS. The issue remains unresolved, and Shabber will request the public IP of the server and enable port 8108.

Powered by Struct AI
May 16, 2023 (4 months ago)
Shabber
Photo of md5-5a2ce5f6a332437f74a5fd2f2c98052e
Shabber
11:34 AM
Hi ,
I need help.

installed typesense locally on ubuntu and implemented search functionality - works fine

installed typesense on centos client server , added same search functionality over server
getting error as attached in screen.

checked using shell with same queries , able to get results over there.

but issue while using in application
Image 1 for Hi ,
I need help.

installed typesense locally on ubuntu and implemented search functionality -  works fine

installed typesense on centos client  server , added same search functionality over server
getting error as attached in screen.

checked using shell with same queries , able to get results over there.

but issue while using in applicationImage 2 for Hi ,
I need help.

installed typesense locally on ubuntu and implemented search functionality -  works fine

installed typesense on centos client  server , added same search functionality over server
getting error as attached in screen.

checked using shell with same queries , able to get results over there.

but issue while using in application
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
01:05 PM
Does curl request work?
May 17, 2023 (4 months ago)
Shabber
Photo of md5-5a2ce5f6a332437f74a5fd2f2c98052e
Shabber
04:05 AM
yes curl request work when i use using terminal/Putty
04:08
Shabber
04:08 AM
i get response
Image 1 for i get response
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
04:56 AM
The request fails when you call from JS?
Shabber
Photo of md5-5a2ce5f6a332437f74a5fd2f2c98052e
Shabber
04:57 AM
yes
04:57
Shabber
04:57 AM
request fails when using js
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
04:59 AM
I see a https:// used. I don't think browsers support https via self signed certs on localhost. This is not related to Typesense.
Shabber
Photo of md5-5a2ce5f6a332437f74a5fd2f2c98052e
Shabber
04:59 AM
i was just trying out with https. that i might get any solution like
04:59
Shabber
04:59 AM
05:00
Shabber
05:00 AM
is it anything like , blocking port through application something ?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
05:06 AM
What does the "Response" tab in the browser screenshot above show?
05:08
Kishore Nallan
05:08 AM
Also by default Typesense enables cors. Check if you have changed any of the default configuration.
Shabber
Photo of md5-5a2ce5f6a332437f74a5fd2f2c98052e
Shabber
05:09 AM
ok will check and revert back
05:09
Shabber
05:09 AM
Thank you
05:17
Shabber
05:17 AM
installed a fresh copy of typesense
05:17
Shabber
05:17 AM
Image 1 for
05:17
Shabber
05:17 AM
this is what i get in response
05:18
Shabber
05:18 AM
Api ikey is valid
05:18
Shabber
05:18 AM
using same api key created collection
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
05:18 AM
How are you sending it?
05:18
Kishore Nallan
05:18 AM
Does it have some special characters so maybe not getting encoded properly. I need to see an actual JS code snippet that you are using.
Shabber
Photo of md5-5a2ce5f6a332437f74a5fd2f2c98052e
Shabber
05:18 AM
Image 1 for
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
05:19 AM
This is a front end JS application?
Shabber
Photo of md5-5a2ce5f6a332437f74a5fd2f2c98052e
Shabber
05:19 AM
yes
05:19
Shabber
05:19 AM
using typesense adapter search i am working
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
05:19 AM
Same api key works on curl?
Shabber
Photo of md5-5a2ce5f6a332437f74a5fd2f2c98052e
Shabber
05:19 AM
local system it is working fine
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
05:20 AM
Can you try again?
Shabber
Photo of md5-5a2ce5f6a332437f74a5fd2f2c98052e
Shabber
05:20 AM
yes same api key works on curl
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
05:20 AM
Are you using docker?
Shabber
Photo of md5-5a2ce5f6a332437f74a5fd2f2c98052e
Shabber
05:21 AM
no
05:21
Shabber
05:21 AM
i am not using docker
05:22
Shabber
05:22 AM
curl -O 

05:22
Shabber
05:22 AM
using this installed
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
05:22 AM
Ok I'll have to get someone else to look into why this isn't working . Jason would be able help when he is around later.
Shabber
Photo of md5-5a2ce5f6a332437f74a5fd2f2c98052e
Shabber
05:22 AM
ok
05:22
Shabber
05:22 AM
will be waiting
05:22
Shabber
05:22 AM
Thank you
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:49 PM
Shabber Could you open http://localhost:8108/health in the browser and share what you see?
May 18, 2023 (4 months ago)
Shabber
Photo of md5-5a2ce5f6a332437f74a5fd2f2c98052e
Shabber
04:40 AM
it is hosted in server
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
04:41 AM
Then why are you accessing it on local host? I don't follow.
Shabber
Photo of md5-5a2ce5f6a332437f74a5fd2f2c98052e
Shabber
04:41 AM
instead should i use ip ? in place of localhost
04:42
Shabber
04:42 AM
Image 1 for
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
04:42 AM
Yes, IP of the server
Shabber
Photo of md5-5a2ce5f6a332437f74a5fd2f2c98052e
Shabber
04:42 AM
ok will request public ip of server
04:42
Shabber
04:42 AM
and enable port 8108