You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting an error trying to connect. I'm using an ssh tunnel to expose port 50000 locally, if that helps.
Sails v0.11.0
DB2 LUW v9.7
info: Starting app...
error: A hook (`orm`) failed to load!
/Users/me/Projects/test/node_modules/sails-db2/index.js:224
if (connection.conn) connection.conn.close(function (err) {
^
TypeError: Cannot read property 'conn' of undefined
at closeConnection (/Users/me/Projects/test/node_modules/sails-db2/index.js:224:31)
at forOwn (/Users/me/Projects/test/node_modules/sails-db2/node_modules/lodash/dist/lodash.js:2106:15)
at Function.forEach (/Users/me/Projects/test/node_modules/sails-db2/node_modules/lodash/dist/lodash.js:3303:9)
at Object.module.exports.adapter.teardown (/Users/me/Projects/test/node_modules/sails-db2/index.js:232:20)
at /usr/local/lib/node_modules/sails/lib/hooks/orm/index.js:244:19
at /usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:122:13
at _each (/usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:46:13)
at Object.async.each (/usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:121:9)
at Sails.hook.teardown (/usr/local/lib/node_modules/sails/lib/hooks/orm/index.js:241:13)
at Sails.g (events.js:199:16)
at Sails.emit (events.js:104:17)
at Sails.emitter.emit (/usr/local/lib/node_modules/sails/lib/app/private/after.js:50:11)
at /usr/local/lib/node_modules/sails/lib/app/lower.js:60:11
at beforeShutdown (/usr/local/lib/node_modules/sails/lib/app/lower.js:35:12)
at Sails.lower (/usr/local/lib/node_modules/sails/lib/app/lower.js:39:3)
at Sails.bound (/usr/local/lib/node_modules/sails/node_modules/lodash/dist/lodash.js:729:21)
The text was updated successfully, but these errors were encountered:
I've run into this bug recently. Looking at the code, https://github.com/IbuildingsItaly/sails-db2/blob/master/index.js#L223-L232, when the teardown method is called without a name it iterates through all the available connections. The first argument to that closeConnection method becomes the entire connection object not the name. This is causing the bug referenced above.
I'm getting an error trying to connect. I'm using an ssh tunnel to expose port 50000 locally, if that helps.
Sails v0.11.0
DB2 LUW v9.7
The text was updated successfully, but these errors were encountered: