myndzi / pool2

38 stars 8 forks source link

Seeing the pool randomly being destroyed after timeout #12

Open tgriesser opened 9 years ago

tgriesser commented 9 years ago

Not sure what's causing it and haven't had time to completely reproduce it, but the pool seems to be randomly being destroyed after a connect ETIMEDOUT - only seeing this recently so suspect it's something with the latest patch version.

I'll see about being able to reproduce it, but any ideas there?

olalonde commented 8 years ago

If you are having this issue with knex, knex v0.12.0 replaced pool2 with node-pool, see https://github.com/tgriesser/knex/issues/1591#issuecomment-246857570

ghost commented 5 years ago

Knex:warning - Pool2 - Error: Pool was destroyed Knex:warning - Pool2 - Error: Pool was destroyed Knex:Error Pool2 - Error: connect ECONNREFUSED 127.0.0.1:5432

Error: Pool was destroyed at Pool._destroyPool (F:\Work\Node\Dragon\work\insightsnow\insightsnow\node_modules\pool2\lib\pool.js:569:20) at Pool. (F:\Work\Node\Dragon\work\insightsnow\insightsnow\node_modules\pool2\lib\pool.js:483:18) at Pool. (F:\Work\Node\Dragon\work\insightsnow\insightsnow\node_modules\pool2\lib\pool.js:526:17) at tryCatcher (F:\Work\Node\Dragon\work\insightsnow\insightsnow\node_modules\bluebird\js\main\util.js:26:23) at Promise.errorAdapter (F:\Work\Node\Dragon\work\insightsnow\insightsnow\node_modules\bluebird\js\main\nodeify.js:36:34) at Promise._settlePromiseAt (F:\Work\Node\Dragon\work\insightsnow\insightsnow\node_modules\bluebird\js\main\promise.js:582:21) at Promise._settlePromises (F:\Work\Node\Dragon\work\insightsnow\insightsnow\node_modules\bluebird\js\main\promise.js:700:14) at Async._drainQueue (F:\Work\Node\Dragon\work\insightsnow\insightsnow\node_modules\bluebird\js\main\async.js:123:16) at Async._drainQueues (F:\Work\Node\Dragon\work\insightsnow\insightsnow\node_modules\bluebird\js\main\async.js:133:10) at Immediate.Async.drainQueues [as _onImmediate] (F:\Work\Node\Dragon\work\insightsnow\insightsnow\node_modules\bluebird\js\main\async.js:15:14) at processImmediate (timers.js:632:19) Unhandled rejection Error: Pool was destroyed at Pool._destroyPool (F:\Work\Node\Dragon\work\insightsnow\insightsnow\node_modules\pool2\lib\pool.js:569:20) at Pool. (F:\Work\Node\Dragon\work\insightsnow\insightsnow\node_modules\pool2\lib\pool.js:483:18)3:18) 6:17) at Pool. (F:\Work\Node\Dragon\work\insightsnow\insightsnow\node_modules\pool2\lib\pool.js:526:23)6:17) \nodeify.js:36:34) at tryCatcher (F:\Work\Node\Dragon\work\insightsnow\insightsnow\node_modules\bluebird\js\main\util.js:2main\promise.js:582:21)6:23) ain\promise.js:700:14) at Promise.errorAdapter (F:\Work\Node\Dragon\work\insightsnow\insightsnow\node_modules\bluebird\js\mainync.js:123:16)\nodeify.js:36:34) sync.js:133:10) at Promise._settlePromiseAt (F:\Work\Node\Dragon\work\insightsnow\insightsnow\node_modules\bluebird\js_modules\bluebird\js\main\async.js:15:14)main\promise.js:582:21) at Promise._settlePromises (F:\Work\Node\Dragon\work\insightsnow\insightsnow\node_modules\bluebird\js\main\promise.js:700:14) at Async._drainQueue (F:\Work\Node\Dragon\work\insightsnow\insightsnow\node_modules\bluebird\js\main\async.js:123:16) at Async._drainQueues (F:\Work\Node\Dragon\work\insightsnow\insightsnow\node_modules\bluebird\js\main\async.js:133:10) at Immediate.Async.drainQueues [as _onImmediate] (F:\Work\Node\Dragon\work\insightsnow\insightsnow\node_modules\bluebird\js\main\async.js:15:14) at processImmediate (timers.js:632:19) Knex:Error Pool2 - Error: connect ECONNREFUSED 127.0.0.1:5432

ghost commented 5 years ago

what can I do? I can't find this error. I have see all of article but there is nothing..

myndzi commented 5 years ago

This seems to be key: Knex:Error Pool2 - Error: connect ECONNREFUSED 127.0.0.1:5432

You are either connecting to the wrong host/port, or your database is not running

ghost commented 5 years ago

The database is postgreSQL working on heroqu. I really can't imagine about this.

myndzi commented 5 years ago

Connection refused just means that the database driver (pg) could not establish a connection. I can't tell you what the host and port are, you'll have to determine that yourself... I haven't used Heroku, but if the servers are shared the port is probably different. Check whatever UI you get for setting the stuff up to see where it's located.