Request to Node 0 failed due to "ECONNABORTED time...
# community-help
g
Request to Node 0 failed due to "ECONNABORTED timeout of 120000ms exceeded" what is the issue
i changed to my company account i am getting this issue..i changed all the config
if i use my test account its working..
j
Could you share the code snippet that threw this error?
g
const searchParameters = { q: '*', query_by: 'ADDRESS_CITY', filter_by: 'COORDINATES:(' + latitude + ',' + longitude + ', ' + radious + ')', }; const results = await typesense.collections('sitesnew').documents().search(searchParameters); return results;
j
Could you also share how you instantiate the
typesense
object?
g
will use 'active-sites' allias name
const typesense = new Client({ nodes: [ { host: env('TYPESENSE_URL') as string, port: Number(env('TYPESENSE_PORT') as string), protocol: env('TYPESENSE_MODE') as string, } as NodeConfiguration, ], apiKey: env('TYPESENSE_APIKEY') as string, numRetries: 3, // A total of 4 tries (1 original try + 3 retries) connectionTimeoutSeconds: 120, // Set a longer timeout for large imports } as ConfigurationOptions);
j
Could you console.log just the configuration object inside the Client() constructor and share that output, masking just the API key
g
in console .log many places API key is there..
which part exactly want
j
I essentially want to see the output of this:
Copy code
nodes: [
    {
      host: env('TYPESENSE_URL') as string,
      port: Number(env('TYPESENSE_PORT') as string),
      protocol: env('TYPESENSE_MODE') as string,
    } as NodeConfiguration,
  ],
I suspect that env variables are not being set correctly, which is why it’s timing out
👀 1
So want to confirm this theory, by seeing the console.log output
g
"TYPESENSE_APIKEY": "*******", "TYPESENSE_URL": "t6lsx4ydznkc9wqvp-1.a1.typesense.net", "TYPESENSE_PORT": 443, "TYPESENSE_MODE": "https"
any idea?
j
That seems like your env file yeah? But I wonder if you do
env('TYPESENSE_URL')
it’s not picking up the value in the env file?
g
i checked its picking..
j
Other issues I can think of are that somehow there’s no internet connectivity for the runtime that’s running this code? May be it’s in a private network for eg?
g
[2022-10-25T183233.626Z] Executing 'Functions.search' (Reason='This function was programmatically called via the host APIs.', Id=1733c497-3cbd-471e-945f-43cec59a6e3d) [2022-10-25T183233.706Z] Client { [2022-10-25T183233.706Z] configuration: Configuration { [2022-10-25T183233.706Z] nodes: [ [Object] ], [2022-10-25T183233.706Z] nearestNode: null, [2022-10-25T183233.706Z] connectionTimeoutSeconds: 120, [2022-10-25T183233.706Z] healthcheckIntervalSeconds: 60, [2022-10-25T183233.706Z] numRetries: 3, [2022-10-25T183233.707Z] retryIntervalSeconds: 0.1, [2022-10-25T183233.707Z] apiKey: '*************', [2022-10-25T183233.707Z] sendApiKeyAsQueryParam: false, [2022-10-25T183233.707Z] cacheSearchResultsForSeconds: 0, [2022-10-25T183233.707Z] useServerSideSearchCache: false, [2022-10-25T183233.708Z] logger: { [2022-10-25T183233.708Z] name: [Getter], [2022-10-25T183233.708Z] levels: [Getter], [2022-10-25T183233.708Z] methodFactory: [Getter], [2022-10-25T183233.709Z] getLevel: [Getter], [2022-10-25T183233.709Z] setLevel: [Getter], [2022-10-25T183233.709Z] setDefaultLevel: [Getter], [2022-10-25T183233.709Z] resetLevel: [Getter], [2022-10-25T183233.710Z] enableAll: [Getter], [2022-10-25T183233.710Z] disableAll: [Getter], [2022-10-25T183233.710Z] trace: [Getter], [2022-10-25T183233.710Z] debug: [Getter], [2022-10-25T183233.710Z] info: [Getter], [2022-10-25T183233.710Z] warn: [Getter], [2022-10-25T183233.711Z] error: [Getter], [2022-10-25T183233.711Z] log: [Getter], [2022-10-25T183233.711Z] getLogger: [Getter], [2022-10-25T183233.712Z] noConflict: [Getter], [2022-10-25T183233.712Z] getLoggers: [Getter], [2022-10-25T183233.712Z] default: [Logger] [2022-10-25T183233.712Z] }, [2022-10-25T183233.712Z] logLevel: 'warn', [2022-10-25T183233.713Z] additionalHeaders: undefined [2022-10-25T183233.713Z] }, [2022-10-25T183233.713Z] apiCall: ApiCall { [2022-10-25T183233.713Z] configuration: Configuration { [2022-10-25T183233.713Z] nodes: [Array], [2022-10-25T183233.713Z] nearestNode: null, [2022-10-25T183233.714Z] connectionTimeoutSeconds: 120, [2022-10-25T183233.714Z] healthcheckIntervalSeconds: 60, [2022-10-25T183233.714Z] numRetries: 3, [2022-10-25T183233.714Z] retryIntervalSeconds: 0.1, [2022-10-25T183233.714Z] apiKey: '*************', [2022-10-25T183233.714Z] sendApiKeyAsQueryParam: false, [2022-10-25T183233.715Z] cacheSearchResultsForSeconds: 0, [2022-10-25T183233.715Z] useServerSideSearchCache: false, [2022-10-25T183233.715Z] logger: [Object], [2022-10-25T183233.715Z] logLevel: 'warn', [2022-10-25T183233.716Z] additionalHeaders: undefined [2022-10-25T183233.716Z] }, [2022-10-25T183233.716Z] apiKey: '*************', [2022-10-25T183233.716Z] nodes: [ [Object] ], [2022-10-25T183233.716Z] nearestNode: null, [2022-10-25T183233.716Z] connectionTimeoutSeconds: 120, [2022-10-25T183233.717Z] healthcheckIntervalSeconds: 60, [2022-10-25T183233.717Z] numRetriesPerRequest: 3, [2022-10-25T183233.717Z] retryIntervalSeconds: 0.1, [2022-10-25T183233.717Z] sendApiKeyAsQueryParam: false, [2022-10-25T183233.717Z] additionalUserHeaders: undefined, [2022-10-25T183233.717Z] logger: { [2022-10-25T183233.718Z] name: [Getter], [2022-10-25T183233.718Z] levels: [Getter], [2022-10-25T183233.718Z] methodFactory: [Getter], [2022-10-25T183233.718Z] getLevel: [Getter], [2022-10-25T183233.719Z] setLevel: [Getter], [2022-10-25T183233.719Z] setDefaultLevel: [Getter], [2022-10-25T183233.719Z] resetLevel: [Getter], [2022-10-25T183233.719Z] enableAll: [Getter], [2022-10-25T183233.719Z] disableAll: [Getter], [2022-10-25T183233.720Z] trace: [Getter], [2022-10-25T183233.720Z] debug: [Getter], [2022-10-25T183233.720Z] info: [Getter], [2022-10-25T183233.720Z] warn: [Getter], [2022-10-25T183233.721Z] error: [Getter], [2022-10-25T183233.721Z] log: [Getter], [2022-10-25T183233.721Z] getLogger: [Getter], [2022-10-25T183233.722Z] noConflict: [Getter], [2022-10-25T183233.722Z] getLoggers: [Getter], [2022-10-25T183233.722Z] default: [Logger] [2022-10-25T183233.722Z] }, [2022-10-25T183233.723Z] currentNodeIndex: -1 [2022-10-25T183233.723Z] }, [2022-10-25T183233.723Z] debug: Debug { [2022-10-25T183233.723Z] apiCall: ApiCall { [2022-10-25T183233.723Z] configuration: [Configuration], [2022-10-25T183233.723Z] apiKey: '*************', [2022-10-25T183233.723Z] nodes: [Array], [2022-10-25T183233.723Z] nearestNode: null, [2022-10-25T183233.724Z] connectionTimeoutSeconds: 120, [2022-10-25T183233.724Z] healthcheckIntervalSeconds: 60, [2022-10-25T183233.724Z] numRetriesPerRequest: 3, [2022-10-25T183233.724Z] retryIntervalSeconds: 0.1, [2022-10-25T183233.724Z] sendApiKeyAsQueryParam: false, [2022-10-25T183233.724Z] additionalUserHeaders: undefined, [2022-10-25T183233.724Z] logger: [Object], [2022-10-25T183233.724Z] currentNodeIndex: -1 [2022-10-25T183233.724Z] } [2022-10-25T183233.724Z] }, [2022-10-25T183233.724Z] metrics: Metrics { [2022-10-25T183233.724Z] apiCall: ApiCall { [2022-10-25T183233.724Z] configuration: [Configuration], [2022-10-25T183233.724Z] apiKey: '*************', [2022-10-25T183233.725Z] nodes: [Array], [2022-10-25T183233.725Z] nearestNode: null, [2022-10-25T183233.725Z] connectionTimeoutSeconds: 120, [2022-10-25T183233.725Z] healthcheckIntervalSeconds: 60, [2022-10-25T183233.725Z] numRetriesPerRequest: 3, [2022-10-25T183233.725Z] retryIntervalSeconds: 0.1, [2022-10-25T183233.726Z] sendApiKeyAsQueryParam: false, [2022-10-25T183233.726Z] additionalUserHeaders: undefined, [2022-10-25T183233.726Z] logger: [Object], [2022-10-25T183233.726Z] currentNodeIndex: -1 [2022-10-25T183233.726Z] } [2022-10-25T183233.726Z] }, [2022-10-25T183233.726Z] health: Health { [2022-10-25T183233.727Z] apiCall: ApiCall { [2022-10-25T183233.727Z] configuration: [Configuration], [2022-10-25T183233.727Z] apiKey: '*************', [2022-10-25T183233.727Z] nodes: [Array], [2022-10-25T183233.727Z] nearestNode: null, [2022-10-25T183233.727Z] connectionTimeoutSeconds: 120, [2022-10-25T183233.727Z] healthcheckIntervalSeconds: 60, [2022-10-25T183233.727Z] numRetriesPerRequest: 3, [2022-10-25T183233.727Z] retryIntervalSeconds: 0.1, [2022-10-25T183233.727Z] sendApiKeyAsQueryParam: false, [2022-10-25T183233.728Z] additionalUserHeaders: undefined, [2022-10-25T183233.728Z] logger: [Object],
[2022-10-25T183233.728Z] currentNodeIndex: -1 [2022-10-25T183233.728Z] } [2022-10-25T183233.728Z] }, [2022-10-25T183233.728Z] operations: Operations { [2022-10-25T183233.729Z] apiCall: ApiCall { [2022-10-25T183233.729Z] configuration: [Configuration], [2022-10-25T183233.729Z] apiKey: '*************', [2022-10-25T183233.729Z] nodes: [Array], [2022-10-25T183233.729Z] nearestNode: null, [2022-10-25T183233.729Z] connectionTimeoutSeconds: 120, [2022-10-25T183233.729Z] healthcheckIntervalSeconds: 60, [2022-10-25T183233.730Z] numRetriesPerRequest: 3, [2022-10-25T183233.730Z] retryIntervalSeconds: 0.1, [2022-10-25T183233.730Z] sendApiKeyAsQueryParam: false, [2022-10-25T183233.730Z] additionalUserHeaders: undefined, [2022-10-25T183233.730Z] logger: [Object], [2022-10-25T183233.730Z] currentNodeIndex: -1 [2022-10-25T183233.730Z] } [2022-10-25T183233.731Z] }, [2022-10-25T183233.731Z] multiSearch: MultiSearch { [2022-10-25T183233.731Z] apiCall: ApiCall { [2022-10-25T183233.731Z] configuration: [Configuration], [2022-10-25T183233.731Z] apiKey: '*************', [2022-10-25T183233.732Z] nodes: [Array], [2022-10-25T183233.732Z] nearestNode: null, [2022-10-25T183233.732Z] connectionTimeoutSeconds: 120, [2022-10-25T183233.733Z] healthcheckIntervalSeconds: 60, [2022-10-25T183233.733Z] numRetriesPerRequest: 3, [2022-10-25T183233.733Z] retryIntervalSeconds: 0.1, [2022-10-25T183233.734Z] sendApiKeyAsQueryParam: false, [2022-10-25T183233.734Z] additionalUserHeaders: undefined, [2022-10-25T183233.734Z] logger: [Object], [2022-10-25T183233.734Z] currentNodeIndex: -1 [2022-10-25T183233.734Z] }, [2022-10-25T183233.734Z] configuration: Configuration { [2022-10-25T183233.735Z] nodes: [Array], [2022-10-25T183233.735Z] nearestNode: null, [2022-10-25T183233.735Z] connectionTimeoutSeconds: 120, [2022-10-25T183233.735Z] healthcheckIntervalSeconds: 60, [2022-10-25T183233.735Z] numRetries: 3, [2022-10-25T183233.736Z] retryIntervalSeconds: 0.1, [2022-10-25T183233.736Z] apiKey: '*************', [2022-10-25T183233.736Z] sendApiKeyAsQueryParam: false, [2022-10-25T183233.736Z] cacheSearchResultsForSeconds: 0, [2022-10-25T183233.736Z] useServerSideSearchCache: false, [2022-10-25T183233.736Z] logger: [Object], [2022-10-25T183233.736Z] logLevel: 'warn', [2022-10-25T183233.737Z] additionalHeaders: undefined [2022-10-25T183233.737Z] }, [2022-10-25T183233.737Z] useTextContentType: false, [2022-10-25T183233.737Z] requestWithCache: RequestWithCache { responseCache: Map(0) {} } [2022-10-25T183233.738Z] }, [2022-10-25T183233.738Z] _collections: Collections { [2022-10-25T183233.738Z] apiCall: ApiCall { [2022-10-25T183233.738Z] configuration: [Configuration], [2022-10-25T183233.738Z] apiKey: '*************', [2022-10-25T183233.739Z] nodes: [Array], [2022-10-25T183233.739Z] nearestNode: null, [2022-10-25T183233.739Z] connectionTimeoutSeconds: 120, [2022-10-25T183233.739Z] Received FunctionInvocationRequest [2022-10-25T183233.739Z] healthcheckIntervalSeconds: 60, [2022-10-25T183233.740Z] numRetriesPerRequest: 3, [2022-10-25T183233.741Z] retryIntervalSeconds: 0.1, [2022-10-25T183233.741Z] sendApiKeyAsQueryParam: false, [2022-10-25T183233.741Z] additionalUserHeaders: undefined, [2022-10-25T183233.741Z] logger: [Object], [2022-10-25T183233.741Z] currentNodeIndex: -1 [2022-10-25T183233.741Z] } [2022-10-25T183233.741Z] }, [2022-10-25T183233.742Z] individualCollections: {}, [2022-10-25T183233.742Z] _aliases: Aliases { [2022-10-25T183233.742Z] apiCall: ApiCall { [2022-10-25T183233.742Z] configuration: [Configuration], [2022-10-25T183233.742Z] apiKey: '*************', [2022-10-25T183233.743Z] nodes: [Array], [2022-10-25T183233.743Z] nearestNode: null, [2022-10-25T183233.743Z] connectionTimeoutSeconds: 120, [2022-10-25T183233.743Z] healthcheckIntervalSeconds: 60, [2022-10-25T183233.743Z] numRetriesPerRequest: 3, [2022-10-25T183233.743Z] retryIntervalSeconds: 0.1, [2022-10-25T183233.744Z] sendApiKeyAsQueryParam: false, [2022-10-25T183233.744Z] additionalUserHeaders: undefined, [2022-10-25T183233.744Z] logger: [Object], [2022-10-25T183233.744Z] currentNodeIndex: -1 [2022-10-25T183233.745Z] } [2022-10-25T183233.745Z] }, [2022-10-25T183233.745Z] individualAliases: {}, [2022-10-25T183233.745Z] _keys: Keys { [2022-10-25T183233.745Z] apiCall: ApiCall { [2022-10-25T183233.746Z] configuration: [Configuration], [2022-10-25T183233.746Z] apiKey: '*************', [2022-10-25T183233.746Z] nodes: [Array], [2022-10-25T183233.746Z] nearestNode: null, [2022-10-25T183233.746Z] connectionTimeoutSeconds: 120, [2022-10-25T183233.746Z] healthcheckIntervalSeconds: 60, [2022-10-25T183233.746Z] numRetriesPerRequest: 3, [2022-10-25T183233.747Z] retryIntervalSeconds: 0.1, [2022-10-25T183233.747Z] sendApiKeyAsQueryParam: false, [2022-10-25T183233.747Z] additionalUserHeaders: undefined, [2022-10-25T183233.747Z] logger: [Object], [2022-10-25T183233.747Z] currentNodeIndex: -1 [2022-10-25T183233.748Z] } [2022-10-25T183233.748Z] }, [2022-10-25T183233.748Z] individualKeys: {} [2022-10-25T183233.748Z] }
j
Could you console.log
typesense.configuration
?
Or something like this:
console.log(JSON.stringify(typesense.configuration))
So it shows all values
1
g
[2022-10-25T184533.181Z] Executing 'Functions.search' (Reason='This function was programmatically called via the host APIs.', Id=8c8e2c1a-3583-4dc5-a042-6d4c230246bd) [2022-10-25T184533.280Z] Configuration { [2022-10-25T184533.280Z] nodes: [ [2022-10-25T184533.280Z] { [2022-10-25T184533.281Z] host: 't6lsx4ydznkc9wqvp-1.a1.typesense.net', [2022-10-25T184533.281Z] port: 443, [2022-10-25T184533.281Z] protocol: 'https', [2022-10-25T184533.281Z] path: '' [2022-10-25T184533.281Z] } [2022-10-25T184533.281Z] ], [2022-10-25T184533.281Z] nearestNode: null, [2022-10-25T184533.282Z] connectionTimeoutSeconds: 120, [2022-10-25T184533.282Z] healthcheckIntervalSeconds: 60, [2022-10-25T184533.282Z] numRetries: 3, [2022-10-25T184533.282Z] retryIntervalSeconds: 0.1, [2022-10-25T184533.283Z] apiKey: '******', [2022-10-25T184533.283Z] sendApiKeyAsQueryParam: false, [2022-10-25T184533.284Z] cacheSearchResultsForSeconds: 0, [2022-10-25T184533.284Z] useServerSideSearchCache: false, [2022-10-25T184533.284Z] logger: { [2022-10-25T184533.285Z] name: [Getter], [2022-10-25T184533.286Z] levels: [Getter], [2022-10-25T184533.286Z] methodFactory: [Getter], [2022-10-25T184533.287Z] getLevel: [Getter], [2022-10-25T184533.288Z] setLevel: [Getter], [2022-10-25T184533.288Z] setDefaultLevel: [Getter], [2022-10-25T184533.288Z] resetLevel: [Getter], [2022-10-25T184533.289Z] enableAll: [Getter], [2022-10-25T184533.289Z] disableAll: [Getter], [2022-10-25T184533.289Z] trace: [Getter], [2022-10-25T184533.290Z] debug: [Getter], [2022-10-25T184533.290Z] info: [Getter], [2022-10-25T184533.290Z] warn: [Getter], [2022-10-25T184533.291Z] error: [Getter], [2022-10-25T184533.291Z] log: [Getter], [2022-10-25T184533.291Z] getLogger: [Getter], [2022-10-25T184533.291Z] noConflict: [Getter], [2022-10-25T184533.292Z] getLoggers: [Getter], [2022-10-25T184533.292Z] default: <ref *1> Logger { [2022-10-25T184533.292Z] name: undefined, [2022-10-25T184533.293Z] levels: [Object], [2022-10-25T184533.293Z] methodFactory: [Function: defaultMethodFactory], [2022-10-25T184533.293Z] getLevel: [Function (anonymous)], [2022-10-25T184533.293Z] setLevel: [Function (anonymous)], [2022-10-25T184533.293Z] setDefaultLevel: [Function (anonymous)], [2022-10-25T184533.293Z] resetLevel: [Function (anonymous)], [2022-10-25T184533.294Z] enableAll: [Function (anonymous)], [2022-10-25T184533.294Z] disableAll: [Function (anonymous)], [2022-10-25T184533.295Z] trace: [Function: noop], [2022-10-25T184533.295Z] debug: [Function: noop], [2022-10-25T184533.295Z] info: [Function: noop], [2022-10-25T184533.295Z] warn: [Function: bound warn], [2022-10-25T184533.296Z] error: [Function: bound error], [2022-10-25T184533.296Z] log: [Function: noop], [2022-10-25T184533.296Z] getLogger: [Function: getLogger], [2022-10-25T184533.296Z] noConflict: [Function (anonymous)], [2022-10-25T184533.297Z] getLoggers: [Function: getLoggers], [2022-10-25T184533.297Z] default: [Circular *1] [2022-10-25T184533.297Z] } [2022-10-25T184533.298Z] }, [2022-10-25T184533.298Z] logLevel: 'warn', [2022-10-25T184533.298Z] additionalHeaders: undefined [2022-10-25T184533.298Z] } [2022-10-25T184533.321Z] Received FunctionInvocationRequest