-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Getting configuration error when importing data through a parent module #77
Comments
Hey @stevelacy, |
I did a complete reinstall and did not see this issue again, thanks |
I got the same error when trying to build an api based on the importStream as below
The importPipeline (streams) run well on standalone. |
hi @thucnc could you please post the code (or link to) The error message I can see in https://github.com/pelias/dbclient/blob/master/src/client.js that we use the singleton pattern to ensure that only one client connection is created. We use the method Is it possible that you are closing the client connection and then trying to reuse the client? |
@missinglink My importPipeline code is as below:
And actually, I workaround this issue by commenting out 3 lines of code in index.js of dbclient
However, at this point, I got another error, reporting here #17 |
as I suspected, the client connection is being closed after the first pipeline is ended in https://github.com/pelias/dbclient/blob/master/src/BatchManager.js#L121 and since it's a singleton, subsequent calls to I guess we never intended the client to be used like this, although it seems like a fair thing to do. one possible solution you could try is to edit https://github.com/pelias/dbclient/blob/master/src/client.js module.exports = function(){
return new elasticsearch.Client( settings.export().esclient || {} );
}; this will remove the singleton functionality and return a new client on every call to [edit] or even easier is to comment out this line: https://github.com/pelias/dbclient/blob/master/src/BatchManager.js#L121 let me know if that resolves your issue and I'll discuss with @orangejulius about getting it merged. |
I'm going to re-open this issue as a feature request to allow the |
Hey @stevelacy, both this issue and #17 are solved with your suggestion:
So, please apply this change on the next release. Really appreciate. |
The singleton pattern has fallen out of favor lately, as it reduces the flexibility of a module, and sometimes makes it harder to unit test. Fixes #77
The singleton pattern has fallen out of favor lately, as it reduces the flexibility of a module, and sometimes makes it harder to unit test. More details on the singleton pattern: https://stackoverflow.com/questions/12755539/why-is-singleton-considered-an-anti-pattern This change removes dbclient's use of the singleton pattern, which should help folk who are using the module in ways we didn't anticipate. Fixes #77
The singleton pattern has fallen out of favor lately, as it reduces the flexibility of a module, and sometimes makes it harder to unit test. More details on the singleton pattern: https://stackoverflow.com/questions/12755539/why-is-singleton-considered-an-anti-pattern This change removes dbclient's use of the singleton pattern, which should help folk who are using the module in ways we didn't anticipate. Fixes #77
I'm setting up to import the geonames data into my elasticsearch cluster, and am hitting this error when running
npm start
:Related issue: elastic/elasticsearch-js#33
I am also getting this error with the other main data importer sources, thus I opened the issue here.
Is this a configuration mistake on my end, or does the
dbclient
elastic connection need to be modified?node 6.12
npm 3.10.10
The text was updated successfully, but these errors were encountered: