mallocator / Elasticsearch-Exporter

A small script to export data from one Elasticsearch cluster into another.
Apache License 2.0
593 stars 112 forks source link

Caught Exception in main process: Type Error: Cannot read property 'settings' of undefined #79

Closed BlackRabbitt closed 9 months ago

BlackRabbitt commented 10 years ago

The error log says:

Elasticsearch Exporter - Version 1.4.0 Reading source statistics from ElasticSearch Reading mapping from ElasticSearch Caught exception in Main process: TypeError: Cannot read property 'settings' of undefined TypeError: Cannot read property 'settings' of undefined at IncomingMessage. (/Elasticsearch-Exporter-master/drivers/es.js:338:59) at IncomingMessage.emit (events.js:117:20) at _stream_readable.js:943:16 at process._tickCallback (node.js:419:13) Number of calls: 1 Fetched Entries: 0 documents Processed Entries: 0 documents Source DB Size: 1049958 documents

Is this error occured because of Source DB Size. Is the size too large?

Thank you.

mallocator commented 10 years ago

What are you command line arguments? What version of ES are running this on?

The size of source DB shouldn't make a difference, it rather seems that a source index didn't respond with a mapping. I assume this error is consistent?

Can you tell me what response you get when you run a _mapping call?

BlackRabbitt commented 10 years ago

sudo node exporter.js -a 10.0.x.x -p 9200 -i A_3025 -b localhost -p 9200 -j A_3025 is the command line argument I used. And I am using ES version 1.3.2.

The command worked well with another local cluster, But when I tried it with the production cluster I got such issue.

Response is positive from _mapping call. And I am sure, the mapping is correct too.

mallocator commented 10 years ago

Not sure what the error here is, but ES responds without a mapping. Maybe try with a lower case index name?

thm1118 commented 9 years ago

i had same exception . eexport -a localhost -i heluo-weinxin-zhengwu -b 192.168.10.71 ,index name is lowercase. is because of complex setting? the index's setting

{
   "heluo-weixin-zhengwu": {
      "settings": {
         "index": {
            "creation_date": "1417361872706",
            "analysis": {
               "filter": {
                  "my_synonym_filter": {
                     "type": "synonym",
                     "synonyms_path": "ik/custom/synonyms.dic"
                  }
               },
               "analyzer": {
                  "default_search": {
                     "filter": [
                        "my_synonym_filter",
                        "lowercase",
                        "stop"
                     ],
                     "tokenizer": "ik"
                  },
                  "default_index": {
                     "tokenizer": "ik"
                  }
               }
            },
            "number_of_shards": "1",
            "uuid": "qCeRINF1QcSIZB8xxsMGbw",
            "version": {
               "created": "1040099"
            },
            "number_of_replicas": "0"
         }
      }
   }
}
mallocator commented 9 years ago

Does your ES cluster accept the setting if you set it manually? Are there any more details in the ElasticSearch log?

thm1118 commented 9 years ago

i try again, it work now .:)

mallocator commented 9 years ago

Without any changes? That's weird.

josegonzalez commented 9 years ago

I can replicate this by using an alias for the sourceIndex. When switching to the actual index name, all works fine.

mallocator commented 9 years ago

Good to know, thanks @josegonzalez I'll be sure to consider that with the 2.0 implementation.

josegonzalez commented 9 years ago

Yeah, my current hack to is to find the index being aliased - fun with bash! - and then retrieve that one.

mallocator commented 9 months ago

Yes, a little late, but I've moved on to other projects. Unfortunately, I can't point you to any other repo that forked and continued the work here, so you'll have to look for another solution, although I believe AI will soon make all of these little tools obsolete.

Most functionality was broken when ES moved to v6, and I don't even know what version we're on today, so it's no surprise it's broken. If there's huge demand I may come back to this as I was working on a more generic implementation with drivers for different DBs, a web GUI, and other little improvements. For now, consider this project abandoned 😢. One person can only do so much.