Client modifies configuration object such that it cannot be used again
See original GitHub issueWhen passing a config object to new elasticsearch.Client(), the Client modifies the passed in config object in such a way that it cannot be used to create a second client.
Example:
var elasticsearch = require('elasticsearch');
var config = {
log : "warning"
};
console.dir(config);
var es1 = new elasticsearch.Client(config);
console.dir(config);
var es2 = new elasticsearch.Client(config);
> node es-config-bug.js
{ log: 'warning' }
{ log:
{ _events:
{ closing: [Object],
error: [Function: bound],
warning: [Function: bound] } },
host: 'http://localhost:9200',
hosts: 'http://localhost:9200',
maxSockets: 10,
maxKeepAliveRequests: 0,
maxKeepAliveTime: 300000 }
/Users/jvonnieda/Desktop/test/node_modules/elasticsearch/src/lib/log.js:44
throw new TypeError('Invalid logging output config. Expected either a lo
^
TypeError: Invalid logging output config. Expected either a log level, array of log levels, a logger config object, or an array of logger config objects.
at new Log (/Users/jvonnieda/Desktop/test/node_modules/elasticsearch/src/lib/log.js:44:13)
at new Transport (/Users/jvonnieda/Desktop/test/node_modules/elasticsearch/src/lib/transport.js:17:27)
at Object.EsApiClient (/Users/jvonnieda/Desktop/test/node_modules/elasticsearch/src/lib/client.js:49:22)
at new Client (/Users/jvonnieda/Desktop/test/node_modules/elasticsearch/src/lib/client.js:60:10)
at Object.<anonymous> (/Users/jvonnieda/Desktop/test/es-config-bug.js:10:11)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
Issue Analytics
- State:
- Created 10 years ago
- Reactions:1
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Setting crawler configuration options - AWS Glue
Learn about how to configure what a crawler does when it encounters schema changes and partition changes in your data store.
Read more >Handle configuration changes - Android Developers
Retain an object during a configuration change ViewModel objects are preserved across configuration changes so they are the perfect place to ...
Read more >Manage clients - Configuration Manager - Microsoft Learn
Learn how to manage clients in Configuration Manager.
Read more >RFC 6241: Network Configuration Protocol (NETCONF)
NETCONF allows a client to discover the set of protocol extensions ... o state data: The additional data on a system that is...
Read more >Firepower Management Center Configuration Guide, Version ...
You cannot delete an object that is in use by an active policy. ... an active policy references your object, deploy configuration changes; ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
IMHO, the library itself should duplicate the object passed when initializing to avoid the hassle of doing so to the implementer.
@gabegorelick you got it. I added a warning to the top of the configuration section. http://www.elasticsearch.org/guide/en/elasticsearch/client/javascript-api/current/configuration.html