Hi, we’re using the NodeJS bindings for typesense,...
# community-help
t
Hi, we’re using the NodeJS bindings for typesense, and we’re possibly seeing some timeout issues from the Axios library? We’re getting this message intermittently from our server:
Copy code
Request #1666300760400: Request to Node 0 failed due to “ECONNABORTED timeout of 2000ms exceeded”

Request #1666300760400: Sleeping for 0.1s and then retrying request...

Request #1666300760512: Request to Node 0 failed due to “ECONNABORTED timeout of 2000ms exceeded”

Request #1666300760512: Sleeping for 0.1s and then retrying request...

Request #1666300760400: Request to Node 0 failed due to “ECONNABORTED timeout of 2000ms exceeded”

Request #1666300760400: Sleeping for 0.1s and then retrying request...

Debug: handler, error
Error: timeout of 2000ms exceeded
at createError (/opt/xyz/node_modules/typesense/node_modules/axios/lib/core/createError.js:16:15)
at RedirectableRequest.handleRequestTimeout (/opt/xyz/node_modules/typesense/node_modules/axios/lib/adapters/http.js:369:16)
at RedirectableRequest.emit (node:events:513:28)
at Timeout.<anonymous> (/opt/xyz/node_modules/follow-redirects/index.js:169:12)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)
Debug: internal, error
Error: timeout of 2000ms exceeded
at createError (/opt/xyz/node_modules/typesense/node_modules/axios/lib/core/createError.js:16:15)
at RedirectableRequest.handleRequestTimeout (/opt/xyz/node_modules/typesense/node_modules/axios/lib/adapters/http.js:369:16)
at RedirectableRequest.emit (node:events:513:28)
at Timeout.<anonymous> (/opt/xyz/node_modules/follow-redirects/index.js:169:12)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)
Request #1666300760512: Request to Node 0 failed due to “ECONNABORTED timeout of 2000ms exceeded”
```
j
t
@Jason Bosco - If your default is 5, why is it timing out at 2 seconds?
Is there an environment variable it might be reading from? We don’t pass any timeout options into our constructor
j
Do you use axios directly in your project? If so, I wonder if you have global axios timeout configured which is taking precedence
t
not directly, but perhaps a module (or a module of a module, etc)
it looks like we use assembly ai for some transcription related tasks, and they also consume axios?
j
May be they’ve configured a global axios timeout?
t
Scanning their source code, they do not appear to.
It’s a pretty small codebase, 200 lines in total: https://github.com/PhillipChaffee/assemblyai-node-sdk/blob/master/src/assembly-client.ts I see 3 invocations of the string timeout, none of which remotely resemble the global timeout stuff
Those are the only two packages that ping via
npm ls
. I’m pretty stumped by what the source of this could be.
j
This is where we set the axios timeout: https://github.com/typesense/typesense-js/blob/2d20f926dc6e38d802fe8d9c703c0040f5710b9a/src/Typesense/ApiCall.ts#L128 Nothing fancy in there… The axios timeout param is documented here: https://axios-http.com/docs/instance
So not sure where it’s picking up 2s from - that’s not the default in axios or in typesense-js