#community-help

Dealing with Timeout Issues with Typesense in Algolia Plugin

TLDR Prime encounters timeout while making a typesense request inside a custom algolia autocomplete plugin. Though recommended solutions were tried, the issue wasn't fully resolved.

Powered by Struct AI
Sep 25, 2023 (2 months ago)
Prime
Photo of md5-696e44f65b98e5b1e2bbbc3d8d7d403d
Prime
08:26 AM
If I'm making a typesense request inside a custom algolia autocomplete plugin, I get timeout every time.
Image 1 for If I'm making a typesense request inside a custom algolia autocomplete plugin, I get timeout every time.Image 2 for If I'm making a typesense request inside a custom algolia autocomplete plugin, I get timeout every time.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
01:12 PM
Could you right click on the failing network request in the network tab, copy as curl and paste it here, minus the api key
Prime
Photo of md5-696e44f65b98e5b1e2bbbc3d8d7d403d
Prime
02:02 PM
Jack Yes, tried, I increased the timeout to 10 secs, and still timeout
02:04
Prime
02:04 PM
Jason curl "http://search.hernadi-antikvarium.hu:8108/collections/books/documents/search?q=&query_by=authors&sort_by=_text_match:desc&prioritize_exact_match=true&per_page=5&group_by=DID" ^
-H "Accept: application/json, text/plain, /" ^
-H "Referer: http://localhost:1234/" ^
-H "X-TYPESENSE-API-KEY: MY_API_KEY" ^
-H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36" ^
--compressed
02:08
Prime
02:08 PM
If I make this request with postman (exactly same headers, useragent, everything the same) it works. Somewhy only as algolia plugin fails. If I make the same request from the main file where I have the autocomplete (App.tsx) then it works just fine, network tab showing 40ms response time.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:50 PM
Can you clone this project and see if you can replicate the issue in it: https://github.com/typesense/typesense-autocomplete-demo
Prime
Photo of md5-696e44f65b98e5b1e2bbbc3d8d7d403d
Prime
03:54 PM
Jason I can't, because I don't know how can I make an autocomplete plugin without the react framework im using
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:57 PM
Could you give me a standalone project based on react autocomplete that uses Typesense running in a docker container that replicates the issue?
Prime
Photo of md5-696e44f65b98e5b1e2bbbc3d8d7d403d
Prime
04:22 PM
Yes, I can try to give u a replica of it
05:52
Prime
05:52 PM
Jason Somewhy if I do the same things, in a new folder, just with the endpoint provided in the typesense-autocomplete-demo, it works without issue.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
06:09 PM
It almost sounds like the ENV variables are not set correctly in your app?
Prime
Photo of md5-696e44f65b98e5b1e2bbbc3d8d7d403d
Prime
06:12 PM
I don't have env variables. the weird thing tho, if I set the timeout to 500 then it works just fine
Sep 26, 2023 (2 months ago)
Prime
Photo of md5-696e44f65b98e5b1e2bbbc3d8d7d403d
Prime
07:02 AM
Jason
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
12:17 PM
I’m not sure what else could be wrong… especially if everything works on a different page in your app.

Typesense

Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI

Indexed 3015 threads (79% resolved)

Join Our Community

Similar Threads

Debugging "ECONNABORTED Timeout" Issue in Typesense Configuration

GM encountered an "ECONNABORTED timeout" error using their company account with their typesense configuration. Jason is assisting in troubleshooting, suspecting that environment variables might not be set correctly.

2

26
14mo

Mobile Autocomplete Issue in Web Development

Prime is experiencing a problem with the autocomplete feature on mobile view. He reached out to both Kishore Nallan and Jason for assistance. Multiple solutions were suggested such as refraining from triggering requests to Typesense for empty queries, but the issue persists.

1

33
1mo

Network Errors and Duplicate Requests in Typesense

Ethan and Rushil were experiencing more than 300 network errors and duplicate requests from Typesense. After rigorous troubleshooting, Jason identified the issue as an Instantsearch-induced multiple re-rendering and implemented a fix. Multiple requests reduced, but networking errors persisted, suggested to be due to client-side internet connectivity.

6

68
4mo

TypesenseInstantsearchAdapter and Algolia Query

Jordan had issues with utilizing Algolia's helper method after creating the TypesenseInstantsearchAdapter. Jason clarified that this adapter is unnecessary with Autocomplete.js. The correct approach is to use the typesense-js library directly.

1

7
22mo

Troubleshooting Write Timeouts in Typesense with Large CSVs

Agustin had issues with Typesense getting write timeouts while loading large CSV files. Kishore Nallan suggested chunking data or converting to JSONL before loading. Through troubleshooting, they identified a possible network problem at AWS and found a workaround.

2

59
32mo