elastic / elasticsearch-migration

This plugin will help you to check whether you can upgrade directly to the next major version of Elasticsearch, or whether you need to make changes to your data and cluster before doing so.
290 stars 32 forks source link

Various "hasOwnProperty" and "undefined" errors across different browsers. #39

Closed pulberg closed 8 years ago

pulberg commented 8 years ago

The errors occur in - Chrome 46.0.2490.80 (64-bit) on Mac OSX 10.11.1 (error - Cannot read property 'hasOwnProperty' of undefined) Firefox 41.0.2 on Mac OSX 10.11.1 (error - o is undefined) Safari 9.0.1 on Mac OSX 10.11.1 (error - undefined is not an object (evaluating 'o.hasOwnProperty'))

Console errors -

Chrome Failed to load resource: the server responded with a status of 403 (Forbidden) logger.js:42 Cannot read property 'hasOwnProperty' of undefined TypeError: Cannot read property 'hasOwnProperty' of undefined at Object.get_key (http://myurlhere:9200/_plugin/migration/js/registry.js:34:12) at http://myurlhere:9200/_plugin/migration/js/main.js:86:22 at forall (http://myurlhere:9200/_plugin/migration/js/main.js:6:17) at check_indices (http://myurlhere:9200/_plugin/migration/js/main.js:71:5) at n (http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:31:354) at e._settlePromiseFromHandler (http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:30:5642) at e._settlePromiseAt (http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:30:6911) at e._settlePromises (http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:30:8776) at r._drainQueue (http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:29:3690) at r._drainQueues (http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:29:3751) at MutationObserver.drainQueues (http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:29:1182) bluebird.min.js:29 Unhandled rejection TypeError: Cannot read property 'hasOwnProperty' of undefined at Object.get_key (http://myurlhere:9200/_plugin/migration/js/registry.js:34:12) at http://myurlhere:9200/_plugin/migration/js/main.js:86:22 at forall (http://myurlhere:9200/_plugin/migration/js/main.js:6:17) at check_indices (http://myurlhere:9200/_plugin/migration/js/main.js:71:5) at n (http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:31:354) at e._settlePromiseFromHandler (http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:30:5642) at e._settlePromiseAt (http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:30:6911) at e._settlePromises (http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:30:8776) at r._drainQueue (http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:29:3690) at r._drainQueues (http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:29:3751) at MutationObserver.drainQueues (http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:29:1182)

Firefox The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol. migration o is undefined get_key@http://myurlhere:9200/_plugin/migration/js/registry.js:34:1 check_indices/<@http://myurlhere:9200/_plugin/migration/js/main.js:86:15 forall@http://myurlhere:9200/_plugin/migration/js/main.js:6:17 check_indices@http://myurlhere:9200/_plugin/migration/js/main.js:71:1 n@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:31:352 [23]</e.exports/e.prototype._settlePromiseFromHandler@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:30:5637 [23]</e.exports/e.prototype._settlePromiseAt@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:30:6906 [23]</e.exports/e.prototype._settlePromises@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:30:8771 [2]</r.prototype._drainQueue@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:29:3688 [2]</r.prototype._drainQueues@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:29:3746 r/this.drainQueues@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:29:1180 logger.js:42:7 Unhandled rejection get_key@http://myurlhere:9200/_plugin/migration/js/registry.js:34:1 check_indices/<@http://myurlhere:9200/_plugin/migration/js/main.js:86:15 forall@http://myurlhere:9200/_plugin/migration/js/main.js:6:17 check_indices@http://myurlhere:9200/_plugin/migration/js/main.js:71:1 n@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:31:352 [23]</e.exports/e.prototype._settlePromiseFromHandler@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:30:5637 [23]</e.exports/e.prototype._settlePromiseAt@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:30:6906 [23]</e.exports/e.prototype._settlePromises@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:30:8771 [2]</r.prototype._drainQueue@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:29:3688 [2]</r.prototype._drainQueues@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:29:3746 r/this.drainQueues@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:29:1180

Safari [Error] Failed to load resource: the server responded with a status of 403 (Forbidden) (_segments, line 0) [Log] undefined is not an object (evaluating 'o.hasOwnProperty') – "get_key@http://myurlhere:9200/_plugin/migration/js/registry.js:34:12↵http://myurlhere:9200/_plugin/migration/js/main.js:86:29↵forall@http://myurlhere:9200/_plugin/migration/js/main.js:6:18↵check_indices@http://myurlhere:9200/_plugin/migration/js/main.js:71:11↵n@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:31:359↵_settlePromiseFromHandler@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:30:5646↵_settlePromiseAt@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:30:6936↵_settlePromises@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:30:8792↵_drainQueue@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:29:3705↵_drainQueues@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:29:3762↵drainQueues@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:29:1194" (logger.js, line 42) [Warning] Unhandled rejection get_key@http://myurlhere:9200/_plugin/migration/js/registry.js:34:12 (bluebird.min.js, line 29) http://myurlhere:9200/_plugin/migration/js/main.js:86:29 forall@http://myurlhere:9200/_plugin/migration/js/main.js:6:18 check_indices@http://myurlhere:9200/_plugin/migration/js/main.js:71:11 n@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:31:359 _settlePromiseFromHandler@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:30:5646 _settlePromiseAt@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:30:6936 _settlePromises@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:30:8792 _drainQueue@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:29:3705 _drainQueues@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:29:3762 drainQueues@http://myurlhere:9200/_plugin/migration/js/bluebird/bluebird.min.js:29:1194

pulberg commented 8 years ago

Also, it looks like the failing call -

http://myurlhere:9200/bp_*/_segments?expand_wildcards=open,closed

always ends with "expand_wildcards=open,closed" regardless of having "Ignore closed indices" checked or unchecked.

ppf2 commented 8 years ago

Not sure if you are running into the same issue. There is certainly a bug here I can reproduce.

In my test, I have 2 indices, 1 open and 1 closed, named logstash-2015.10.09 and logstash-2015.10.10 respectively. logstash-2015.10.10 is the closed one.

If I have logstash-* in the filter field in the plugin, it fails with the same error (Cannot read property 'hasOwnProperty' of undefined) even when ignore closed indices is checked. But if I have just * in the filter field, it works fine. So in the situation above, using * in the filter field is the workaround.

clintongormley commented 8 years ago

Closed by https://github.com/elastic/elasticsearch-migration/commit/156929b5ba9432e161362abdf62c448046867c76

Thanks for the details @ppf2