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

Error state if knex can't reach db server #606

Closed
knownasilya opened this issue Dec 23, 2014 · 2 comments
Closed

Error state if knex can't reach db server #606

knownasilya opened this issue Dec 23, 2014 · 2 comments

Comments

@knownasilya
Copy link
Contributor

GET /dashboard/ 500 10.982 ms - 569
Error: connect ENETUNREACH
    at errnoException (net.js:904:11)
    at connect (net.js:766:19)
    at net.js:845:9
[TypeError: Cannot read property '__cid' of undefined]
TypeError: Cannot read property '__cid' of undefined
    at Runner_PG.<anonymous> (/Users/knownasilya/workspace/myproject/node_modules/knex/lib/runner.js:117:30)
    at tryCatch1 (/Users/knownasilya/workspace/myproject/node_modules/knex/node_modules/bluebird/js/main/util.js:63:19)
    at Runner_PG.Promise$_method [as query] (/Users/knownasilya/workspace/myproject/node_modules/knex/node_modules/bluebird/js/main/promise.js:267:25)
    at Runner_PG.<anonymous> (/Users/knownasilya/workspace/myproject/node_modules/knex/lib/runner.js:44:19)
    at tryCatch1 (/Users/knownasilya/workspace/myproject/node_modules/knex/node_modules/bluebird/js/main/util.js:63:19)
    at Promise$_callHandler [as _callHandler] (/Users/knownasilya/workspace/myproject/node_modules/knex/node_modules/bluebird/js/main/promise.js:695:13)
    at Promise$_settlePromiseFromHandler [as _settlePromiseFromHandler] (/Users/knownasilya/workspace/myproject/node_modules/knex/node_modules/bluebird/js/main/promise.js:711:18)
    at Promise$_settlePromiseAt [as _settlePromiseAt] (/Users/knownasilya/workspace/myproject/node_modules/knex/node_modules/bluebird/js/main/promise.js:868:14)
    at Promise$_settlePromises [as _settlePromises] (/Users/knownasilya/workspace/myproject/node_modules/knex/node_modules/bluebird/js/main/promise.js:1006:14)
    at Async$_consumeFunctionBuffer [as _consumeFunctionBuffer] (/Users/knownasilya/workspace/myproject/node_modules/knex/node_modules/bluebird/js/main/async.js:74:12)


GET /dashboard/ 500 32.005 ms - -

/Users/knownasilya/workspace/myproject/node_modules/knex/lib/pool.js:45
      connection.end();
                 ^
TypeError: Cannot call method 'end' of undefined
    at Object.destroy [as destroyHandler] (/Users/knownasilya/workspace/myproject/node_modules/knex/lib/pool.js:45:18)
    at Object.Pool.destroy (/Users/knownasilya/workspace/myproject/node_modules/knex/node_modules/generic-pool-redux/pool.js:238:12)
    at Object.Pool.removeIdle (/Users/knownasilya/workspace/myproject/node_modules/knex/node_modules/generic-pool-redux/pool.js:261:14)
    at null.<anonymous> (/Users/knownasilya/workspace/myproject/node_modules/knex/node_modules/generic-pool-redux/pool.js:279:27)

Three errors:

  • connect ENETUNREACH
  • Cannot read property '__cid' of undefined
  • Cannot call method 'end' of undefined

Seems like the connection should be checked if it was ever instantiated before destroying, plus the check for the query object being there. Better error messages are needed here.

@bendrucker
Copy link
Member

Same idea as #545. It should be possible with certain errors to say "the pool just failed to get a connection and the error suggests it will never succeed."

@bendrucker
Copy link
Member

Sorry, #595

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