0
votes

The mongoconnector has worked previously, but now it is not. Here is part of the very long trace of the error:

...
   return f(*args, **kwargs)
  File "/home/ubuntu/anaconda/lib/python2.7/site-packages/mongo_connector/doc_managers/elastic2_doc_manager.py", line 203, in bulk_upsert
    for ok, resp in responses:
  File "/home/ubuntu/anaconda/lib/python2.7/site-packages/elasticsearch/helpers/__init__.py", line 160, in streaming_bulk
    for result in _process_bulk_chunk(client, bulk_actions, raise_on_exception, raise_on_error, **kwargs):
  File "/home/ubuntu/anaconda/lib/python2.7/site-packages/elasticsearch/helpers/__init__.py", line 132, in _process_bulk_chunk
    raise BulkIndexError('%i document(s) failed to index.' % len(errors), errors)
BulkIndexError: (u'86 document(s) failed to index.', [{u'index': {u'status': 400, u'_type': u'wikis', u'_id': u'574f3f9253a18f8397ecc13a', u'error': {u'caused_by': {u'reason': u'Cannot parse "+1960-00-00T00:00:00Z": Value 0 for monthOfYear must be in the range [1,12]', u'type': u'illegal_field_value_exception'}, u'reason': u'failed to parse [claims.P1082.qualifiers.P585.datavalue.value.time]', u'type': u'mapper_parsing_exception'}, u'_index': u'test1'}}, 
...
2016-06-01 21:32:55,806 [ERROR] mongo_connector.oplog_manager:557 - OplogThread: Failed during dump collection cannot recover! Collection(Database(MongoClient('localhost', 27017), u'local'), u'oplog.rs')
2016-06-01 21:32:56,618 [ERROR] mongo_connector.connector:302 - MongoConnector: OplogThread <OplogThread(Thread-6, started 139915396376320)> unexpectedly stopped! Shutting down

Starting MongoDB just outside:

$ mongod --dbpath data --replSet "rs0" #create replica set on port 27017

$ mongo #initiate replica set

Inside the mongo repl, I type:

rs.initiate({"_id" : "rs0","version" : 1,"members" : [{"_id" : 0,"host" : "localhost:27017"}]})

Elasticsearch is already started on port 9200.

Altogether now

$ mongo-connector -m localhost:27017 -t localhost:9200 -d elastic2_doc_manager

...then I get the error.

1

1 Answers

0
votes

The underlying error looks like

{u'reason': u'Cannot parse "+1960-00-00T00:00:00Z": Value 0 for monthOfYear must be in the range [1,12]', u'type': u'illegal_field_value_exception'}

That simply means that one of your documents in MongoDB has an invalid date +1960-00-00T00:00:00Z with an invalid month (00) and day (00).

You need to find that record and fix it, after that the replication will work, provided you don't have another record with the same problem.