mongodb - mongo-connector error on ubuntu 14.14 -
the mongoconnector has worked previously, not. here part of long trace of 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 ok, resp in responses: file "/home/ubuntu/anaconda/lib/python2.7/site-packages/elasticsearch/helpers/__init__.py", line 160, in streaming_bulk 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 index.' % len(errors), errors) bulkindexerror: (u'86 document(s) failed 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 monthofyear must in range [1,12]', u'type': u'illegal_field_value_exception'}, u'reason': u'failed 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 outside:
$ mongod --dbpath data --replset "rs0" #create replica set on port 27017
$ mongo #initiate replica set
inside mongo repl, type:
rs.initiate({"_id" : "rs0","version" : 1,"members" : [{"_id" : 0,"host" : "localhost:27017"}]})
elasticsearch started on port 9200.
altogether now
$ mongo-connector -m localhost:27017 -t localhost:9200 -d elastic2_doc_manager
...then error.
the underlying error looks like
{u'reason': u'cannot parse "+1960-00-00t00:00:00z": value 0 monthofyear must in range [1,12]', u'type': u'illegal_field_value_exception'}
that means 1 of documents in mongodb has invalid date +1960-00-00t00:00:00z
invalid month (00
) , day (00
).
you need find record , fix it, after replication work, provided don't have record same problem.