-
Notifications
You must be signed in to change notification settings - Fork 18
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
error: cannot read property 'on' of undefined #88
Comments
I had same error but quite often when I deploy : in my case this problem crashed nodered for uncaught exception [info] [MSSQL-CN:Virtual] Error connecting to server : XXXXXXXX, database : YYYYYYYY, port : ZZZZ, user : KKKKKKKKK I use nodered 3.1.0 on windows 2012 R2 server x64 |
Going deeper to the problem, I discover that in my case the problem was originitade in this line node-red-contrib-mssql-plus/src/mssql.js Line 440 in 64f78f4
In this link there is the function that is called (if I am not wrong) https://github.com/tediousjs/node-mssql/blob/ac350e44c143adc9fbb04b9cddca221746308dd4/lib/base/connection-pool.js#L606 In my case arguments[0] === 'string' |
I have added a pull request (tediousjs/node-mssql#1592) to fix this problem |
Context: I am using version 0.4.4
I got this error:
"Cannot read property 'on' of undefined"
and restarting the flow has solved it.
But over time (maybe months or even years) it is reproduced again.
I would like to know if it has happened to anyone else and if it is solved in later versions or how I can solve it.
Thank you very much in advance.
I attach a fragment of the log:
2023-12-05 04:54:18.616: TypeError: Cannot read property 'on' of undefined
2023-12-05 04:54:18.616: at parent.acquire (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\tedious\request.js:420:20)
2023-12-05 04:54:18.616: at acquirePromise.then.connection (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\base\connection-pool.js:99:41)
2023-12-05 04:54:18.616: at process._tickCallback (internal/process/next_tick.js:68:7)
2023-12-05 04:54:18.616: TypeError: Cannot read property 'on' of undefined
2023-12-05 04:54:18.616: at parent.acquire (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\tedious\request.js:420:20)
2023-12-05 04:54:18.616: at acquirePromise.then.connection (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\base\connection-pool.js:99:41)
2023-12-05 04:54:18.616: at process._tickCallback (internal/process/next_tick.js:68:7)
2023-12-05 04:54:18.616: (node:4536) UnhandledPromiseRejectionWarning: ConnectionError: Connection is closing
2023-12-05 04:54:18.632: at ConnectionPool._acquire (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\base\connection-pool.js:110:36)
2023-12-05 04:54:18.632: at ConnectionPool.acquire (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\base\connection-pool.js:94:56)
2023-12-05 04:54:18.632: at Immediate._query.err (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\tedious\request.js:401:19)
2023-12-05 04:54:18.632: at runCallback (timers.js:705:18)
2023-12-05 04:54:18.632: at tryOnImmediate (timers.js:676:5)
2023-12-05 04:54:18.632: at processImmediate (timers.js:658:5)
2023-12-05 04:54:18.632: (node:4536) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 43780)
2023-12-05 04:54:18.632: (node:4536) UnhandledPromiseRejectionWarning: ConnectionError: Connection is closing
2023-12-05 04:54:18.632: at ConnectionPool._acquire (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\base\connection-pool.js:110:36)
2023-12-05 04:54:18.632: at ConnectionPool.acquire (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\base\connection-pool.js:94:56)
2023-12-05 04:54:18.632: at Immediate._query.err (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\tedious\request.js:401:19)
2023-12-05 04:54:18.632: at runCallback (timers.js:705:18)
2023-12-05 04:54:18.632: at tryOnImmediate (timers.js:676:5)
2023-12-05 04:54:18.632: at processImmediate (timers.js:658:5)
2023-12-05 04:54:18.632: (node:4536) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 43781)
2023-12-05 04:54:18.897: Error: aborted
2023-12-05 04:54:18.897: at PendingOperation.abort (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\tarn\lib\PendingOperation.js:23:21)
2023-12-05 04:54:18.897: at Promise.all.pendingAcquires.map.acquire (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\tarn\lib\Pool.js:138:25)
2023-12-05 04:54:18.897: at Array.map ()
2023-12-05 04:54:18.897: at utils_1.reflect.Promise.all.then.then (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\tarn\lib\Pool.js:137:53)
2023-12-05 04:54:18.897: at process._tickCallback (internal/process/next_tick.js:68:7)
2023-12-05 04:54:18.897: Error: aborted
2023-12-05 04:54:18.897: at PendingOperation.abort (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\tarn\lib\PendingOperation.js:23:21)
2023-12-05 04:54:18.897: at Promise.all.pendingAcquires.map.acquire (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\tarn\lib\Pool.js:138:25)
2023-12-05 04:54:18.897: at Array.map ()
2023-12-05 04:54:18.897: at utils_1.reflect.Promise.all.then.then (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\tarn\lib\Pool.js:137:53)
2023-12-05 04:54:18.897: at process._tickCallback (internal/process/next_tick.js:68:7)
2023-12-05 04:54:18.929: (node:4536) UnhandledPromiseRejectionWarning: ConnectionError: Cannot close a pool while it is connecting
2023-12-05 04:54:18.929: at ConnectionPool._close (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\base\connection-pool.js:301:30)
2023-12-05 04:54:18.929: at shared.Promise (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\base\connection-pool.js:284:12)
2023-12-05 04:54:18.929: at new Promise ()
2023-12-05 04:54:18.929: at ConnectionPool.close (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\base\connection-pool.js:283:12)
2023-12-05 04:54:18.929: at connection.node.connectionCleanup (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\node-red-contrib-mssql-plus\src\mssql.js:178:61)
2023-12-05 04:54:18.929: at ConnectionPool.node.connectionPool.on.err (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\node-red-contrib-mssql-plus\src\mssql.js:193:18)
2023-12-05 04:54:18.929: at ConnectionPool.emit (events.js:189:13)
2023-12-05 04:54:18.929: at shared.Promise.resolve.catch.err (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\base\connection-pool.js:95:12)
2023-12-05 04:54:18.929: at process._tickCallback (internal/process/next_tick.js:68:7)
2023-12-05 04:54:18.929: (node:4536) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 43786)
2023-12-05 04:54:18.929: (node:4536) UnhandledPromiseRejectionWarning: ConnectionError: Cannot close a pool while it is connecting
2023-12-05 04:54:18.929: at ConnectionPool._close (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\base\connection-pool.js:301:30)
2023-12-05 04:54:18.929: at shared.Promise (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\base\connection-pool.js:284:12)
2023-12-05 04:54:18.929: at new Promise ()
2023-12-05 04:54:18.929: at ConnectionPool.close (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\base\connection-pool.js:283:12)
2023-12-05 04:54:18.929: at connection.node.connectionCleanup (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\node-red-contrib-mssql-plus\src\mssql.js:178:61)
2023-12-05 04:54:18.929: at ConnectionPool.node.connectionPool.on.err (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\node-red-contrib-mssql-plus\src\mssql.js:193:18)
2023-12-05 04:54:18.929: at ConnectionPool.emit (events.js:189:13)
2023-12-05 04:54:18.929: at shared.Promise.resolve.catch.err (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\base\connection-pool.js:95:12)
2023-12-05 04:54:18.929: at process._tickCallback (internal/process/next_tick.js:68:7)
2023-12-05 04:54:18.929: (node:4536) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 43787)
2023-12-05 04:54:18.944: { ConnectionError: Connection is closed.
2023-12-05 04:54:18.944: at Request._query (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\base\request.js:462:37)
2023-12-05 04:54:18.944: at Request.query (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\tedious\request.js:346:11)
2023-12-05 04:54:18.944: at shared.Promise (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\base\request.js:428:12)
2023-12-05 04:54:18.944: at new Promise ()
2023-12-05 04:54:18.944: at Request.query (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\base\request.js:427:12)
2023-12-05 04:54:18.944: at node.pool.then. (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\node-red-contrib-mssql-plus\src\mssql.js:218:36) code: 'ECONNCLOSED', name: 'ConnectionError' }
2023-12-05 04:54:18.944: TypeError: Cannot read property 'on' of undefined
2023-12-05 04:54:18.944: at parent.acquire (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\tedious\request.js:420:20)
2023-12-05 04:54:18.944: at acquirePromise.then.connection (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\base\connection-pool.js:99:41)
2023-12-05 04:54:18.944: (node:4536) UnhandledPromiseRejectionWarning: ConnectionError: Connection not yet open.
2023-12-05 04:54:18.944: at ConnectionPool._acquire (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\base\connection-pool.js:108:36)
2023-12-05 04:54:18.944: at ConnectionPool.acquire (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\base\connection-pool.js:94:56)
2023-12-05 04:54:18.944: at Immediate._query.err (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\tedious\request.js:401:19)
2023-12-05 04:54:18.960: at runCallback (timers.js:705:18)
2023-12-05 04:54:18.960: at tryOnImmediate (timers.js:676:5)
2023-12-05 04:54:18.960: at processImmediate (timers.js:658:5)
2023-12-05 04:54:18.960: (node:4536) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 43788)
2023-12-05 04:57:42.661: { ConnectionError: Failed to connect to localhost:1433 in 15000ms
2023-12-05 04:57:42.661: at Connection.tedious.once.err (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\mssql\lib\tedious\connection-pool.js:68:17)
2023-12-05 04:57:42.661: at Object.onceWrapper (events.js:277:13)
2023-12-05 04:57:42.661: at Connection.emit (events.js:189:13)
2023-12-05 04:57:42.661: at Connection.connectTimeout (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\tedious\lib\connection.js:1195:10)
2023-12-05 04:57:42.661: at Timeout.connectTimer.setTimeout [as _onTimeout] (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\tedious\lib\connection.js:1157:12)
2023-12-05 04:57:42.661: at ontimeout (timers.js:436:11)
2023-12-05 04:57:42.661: at tryOnTimeout (timers.js:300:5)
2023-12-05 04:57:42.661: at listOnTimeout (timers.js:263:5)
2023-12-05 04:57:42.661: at Timer.processTimers (timers.js:223:10)
2023-12-05 04:57:42.661: code: 'ETIMEOUT',
2023-12-05 04:57:42.661: originalError:
2023-12-05 04:57:42.661: { ConnectionError: Failed to connect to localhost:1433 in 15000ms
2023-12-05 04:57:42.661: at ConnectionError (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\tedious\lib\errors.js:13:12)
2023-12-05 04:57:42.661: at Connection.connectTimeout (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\tedious\lib\connection.js:1195:54)
2023-12-05 04:57:42.661: at Timeout.connectTimer.setTimeout [as _onTimeout] (C:\Program Files (x86)\Node-Red-Services\NR_Dash-KPI\node_modules\tedious\lib\connection.js:1157:12)
2023-12-05 04:57:42.661: at ontimeout (timers.js:436:11)
2023-12-05 04:57:42.661: at tryOnTimeout (timers.js:300:5)
2023-12-05 04:57:42.661: at listOnTimeout (timers.js:263:5)
2023-12-05 04:57:42.661: at Timer.processTimers (timers.js:223:10)
2023-12-05 04:57:42.661: message: 'Failed to connect to localhost:1433 in 15000ms',
2023-12-05 04:57:42.661: code: 'ETIMEOUT' },
2023-12-05 04:57:42.661: name: 'ConnectionError' }
The text was updated successfully, but these errors were encountered: