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

Jake task 'cleanup' fails trying to execute missing mongodb.client.close() function #742

Open
myichild opened this issue Dec 23, 2017 · 0 comments

Comments

@myichild
Copy link

Jake tasks fail with:
jake aborted.
TypeError: this.client.close is not a function
at Adapter.utils.mixin.disconnect (/home/john/node-apps/callmehelp/node_modules/model/lib/adapters/mongo/index.js:219:17)
at doIt (/home/john/node-apps/callmehelp/node_modules/geddy/gen/jakelib/env.jake:59:23)

This error triggered in the jake 'cleanup' task in the env.jake file.

I can confirm that this.client.close is not a function and is not available on the adapter.client object.

This only seems to be a problem when running tasks but makes running jasmine tests in geddy context impossible. Also, I need to run a cron jon with jeddy jake cron and this never completes.

I have traced the issue back to the methods available on the adapter.client (see below). When successfully logged in a _db property is available, but no .close() function is available as expected in the code at line 219 of the model/lib/adapters/mongo/index.js.
I am unsure where the problem lies. It looks like it could be a mongodb issue (unlikely because all the api docs show a .close() method. Could it be being dropped somewhere up the chain?

Here are the properties reported from this.client:

self.client.properties domain,_events,_eventsCount,_maxListeners,connect,_db

And those provided by _db via the connection request:
self.client._db properties domain,_events,_eventsCount,_maxListeners,s,serverConfig,bufferMaxEntries,databaseName

The system is running these versions on ubuntu 16.04:
"geddy": "^13.0.8",
"mongodb": "^2.2.33",
with mongodb server at 3.6.1-rc1

I have tried various ways to work around the mising close() function, the tests complete but the task is left hanging for some reason and never return properly.

I'm proceeding with development to meet a Jan deadline without using Jasmine and I have a crude workaround to the cron task problem but would really like to use Jake for this.

Any help, advice or pointers warmly welcomed.

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

1 participant