Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uncaughtException: Cannot read properties of null (reading 'query') #317

Open
nqb9 opened this issue Dec 18, 2023 · 3 comments
Open

uncaughtException: Cannot read properties of null (reading 'query') #317

nqb9 opened this issue Dec 18, 2023 · 3 comments

Comments

@nqb9
Copy link

nqb9 commented Dec 18, 2023

Hello, unfortunately I got an uncaught exception in my application. I was using a pool to query SQL Server database multiple times, also with pause and cancel query, and got the problem:
image

It is on the line 646 in lib/pool.js

The description.connection is null and look like it is set to null only in this place:
image

My msnodesqlv8 version: 4.1.1

Looking forward to your response. Thank you.

@nqb9
Copy link
Author

nqb9 commented Dec 18, 2023

The whole error log is:
TypeError: Cannot read properties of null (reading 'query') at heartbeat (C:\IMS-PROJECTS\QA\QService\node_modules\msnodesqlv8\lib\pool.js:646:42) at Timeout._onTimeout (C:\IMS-PROJECTS\QA\QService\node_modules\msnodesqlv8\lib\pool.js:593:15) at listOnTimeout (node:internal/timers:561:11) at processTimers (node:internal/timers:502:7) { "error": {}, "stack": "TypeError: Cannot read properties of null (reading 'query')\n at heartbeat (C:\\IMS-PROJECTS\\QA\\QService\\node_modules\\msnodesqlv8\\lib\\pool.js:646:42)\n at Timeout._onTimeout (C:\\IMS-PROJECTS\\QA\\QService\\node_modules\\msnodesqlv8\\lib\\pool.js:593:15)\n at listOnTimeout (node:internal/timers:561:11)\n at processTimers (node:internal/timers:502:7)", "exception": true, "date": "Mon Dec 18 2023 14:52:18 GMT+0700 (Indochina Time)", "process": { "pid": 2740, "uid": null, "gid": null, "cwd": "C:\\IMS-PROJECTS\\QA\\QService", "execPath": "C:\\Program Files\\nodejs\\node.exe", "version": "v16.19.0", "argv": [ "C:\\Program Files\\nodejs\\node.exe", "C:\\IMS-PROJECTS\\QA\\QService\\dist\\server\\src\\index.js", "--logLevel", "debug" ], "memoryUsage": { "rss": 431636480, "heapTotal": 349945856, "heapUsed": 346579832, "external": 20484001, "arrayBuffers": 18993878 } }, "os": { "loadavg": [ 0, 0, 0 ], "uptime": 369710 }, "trace": [ { "column": 42, "file": "C:\\IMS-PROJECTS\\QA\\QService\\node_modules\\msnodesqlv8\\lib\\pool.js", "function": "heartbeat", "line": 646, "method": null, "native": false }, { "column": 15, "file": "C:\\IMS-PROJECTS\\QA\\QService\\node_modules\\msnodesqlv8\\lib\\pool.js", "function": "Timeout._onTimeout", "line": 593, "method": "_onTimeout", "native": false }, { "column": 11, "file": "node:internal/timers", "function": "listOnTimeout", "line": 561, "method": null, "native": false }, { "column": 7, "file": "node:internal/timers", "function": "processTimers", "line": 502, "method": null, "native": false } ] }

@TimelordUK
Copy link
Owner

im not sure when I can look at this, i current;y have little time available

it would seem we somehow are closing the connection as part of considering it idle but leaving the description with its connection marked null.

do we still see the problem if we set
inactivityTimeoutSecs

to be very high so connections in pool are always held open?

@nqb9
Copy link
Author

nqb9 commented Dec 29, 2023

Thank you very much for the response and happy holidays!

I tried with inactivityTimeoutSecs = 60 (from the src it seems 60 is the max value allowed), but unfortunately I still got problem after some queries.

The problem is not the exact same as above, but still the description.connection is null, which leads to the error

log
"stack":"TypeError: Cannot read properties of null (reading 'query')\n at getTheQuery (D:\\IMS\\Repos\\QService\\node_modules\\msnodesqlv8\\lib\\pool.js:321:28)\n at item (D:\\IMS\\Repos\\QService\\node_modules\\msnodesqlv8\\lib\\pool.js:338:19)\n at D:\\IMS\\Repos\\QService\\node_modules\\msnodesqlv8\\lib\\pool.js:389:15","message":"Cannot read properties of null (reading 'query')"

src from log
image
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants