Server IP Address and Port Issues with Typesense
TLDR Alex encountered problems with Typesense server configuration when setting IP and port using --api-address and --api-port, facing additional problems with CORS and version inequities. Kishore Nallan addressed each point, ultimately finding a bug with the command line parser affecting subsequent commands. The advised workaround was to use --enable-cors=true
.
1
Apr 08, 2022 (21 months ago)
Alex
09:39 AMwhen I start typesense specifying an IP / PORT like so:
--api-address 159.203.31.163 \
--api-port=80
but then I get this:
typesense TCP 10.20.0.5:8107 (LISTEN)
typesense TCP 159.203.31.163:80 (LISTEN)
and in the TS log I can see the 10.x IP being used, while there is nothing listening on that IP on port 80:
CURL failed. URL: http://10.20.0.5:80/health, Code: 7, strerror: Couldn't connect to server
Kishore Nallan
09:41 AMAlex
09:42 AMKishore Nallan
09:42 AMKishore Nallan
09:42 AMKishore Nallan
09:43 AMAlex
09:44 AMKishore Nallan
09:45 AMAlex
09:45 AMKishore Nallan
09:46 AMAlex
09:46 AMAlex
09:47 AM--api-address 159.203.31.163 \
--api-port=80 \
--log-dir=/home/alex/tsdata/log
Kishore Nallan
09:47 AMAlex
09:47 AMAlex
11:29 AMKishore Nallan
11:35 AMAlex
11:37 AMKishore Nallan
11:38 AMKishore Nallan
11:38 AMAlex
11:58 AMAlex
12:07 PMperformRequest @ ApiCall.ts:203
ApiCall.ts:205 Request #1649419591544: Sleeping for 0.1s and then retrying request...
performRequest @ ApiCall.ts:205
localhost/multi_search?x-typesense-api-key=xyz:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
ApiCall.ts:203 Request #1649419591544: Request to Node 0 failed due to "undefined Network Error"
performRequest @ ApiCall.ts:203
ApiCall.ts:205 Request #1649419591544: Sleeping for 0.1s and then retrying request...
performRequest @ ApiCall.ts:205
localhost/multi_search?x-typesense-api-key=xyz:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
Alex
12:08 PMKishore Nallan
12:25 PMApr 09, 2022 (21 months ago)
Kishore Nallan
01:29 AMIf you just remove the api-address config, Typesense will listen on all interfaces or can also explicitly use:
--api-address=0.0.0.0
Kishore Nallan
02:08 AMAlex
05:42 AMKishore Nallan
05:46 AMAlex
06:52 AMAlex
06:53 AMAlex
06:53 AM--api-address=0.0.0.0 \
--api-port=80 \
--log-dir=/home/alex/tsdata/log
Kishore Nallan
07:16 AMAlex
07:18 AMAlex
11:04 AMKishore Nallan
12:10 PMI've been AFK so haven't been able to investigate yet, sorry. Will keep you posted.
Alex
02:46 PMApr 10, 2022 (21 months ago)
Kishore Nallan
03:08 AM--enable-cors=true
which the argument parsing library that Typesense uses does not support. In trying to fix that, ended up introducing a bug where any flag sent after the enable-cors option becomes interpreted as a value of the enable-cors flag, so when your command is:--enable-cors --api-address=0.0.0.0
it set the enable-cors value as "
--api-address=0.0.0.0
" :face_palm:Until I fix this parsing issue in a future build, please use
--enable-cors=true
so it's explicit.1
Typesense
Indexed 3015 threads (79% resolved)
Similar Threads
Typesense Error in Unit Testing for Python
Mehdi was encountering errors while running unit tests for Typesense functionalities in Python. Through discussion with Kishore Nallan, they recognized resource constraints might be causing the issue during JSONL file import. As suggested by Kishore Nallan, adding a short sleep after the import resolved the problem.
Troubleshooting Typesense Docsearch Scraper Setup Issue
Vinicius experienced issues setting up typesense-docsearch-scraper locally. Jason identified a misconfiguration with the Typesense server after checking the .env file, and recommended using ngrok or port forwarding for development purposes. Vinicius successfully resolved the issue with port forwarding.
Resolving CORS-related Issues with Typesense Server
Edson experienced typesense-related CORS issues, which Jason solved by advising to add the `--enable-cors` flag during the startup of the typesense server. The difference in how typesense instantsearch adapter works was also clarified.
Connection Refused Issue with Typesense and Nginx Reverse Proxy
Karthik experiences a connection refused problem with Typesense and Nginx reverse proxy. Jason helps troubleshoot, but the issue remains unresolved.
Configuring Docker-hosted Typesense with Let's Encrypt SSL Certificates
Ian asked for help with setting up SSL certificates in a Docker-hosted Typesense. Jason provided suggestions but the issue remains unresolved due to port conflict.