Hi there! I am trying to setup a connection betwee...
# replication-troubleshooting
t
Hi there! I am trying to setup a connection between MongoDB Atlas and ElasticSearch, but no matter what I try, I am getting the following errors in the Airbyte log:
Copy code
error type: mapper_parsing_exception
 reason: failed to parse field [_id] of type [_id] in document with id '015dd0d8-9f33-4ab1-966a-148163d35144'. Preview of field's value: 'zaLEs1gr6t'
	at io.airbyte.integrations.destination.elasticsearch.ElasticsearchAirbyteMessageConsumerFactory.lambda$recordWriterFunction
It occurs even in the simplest cases where only a few fields are present in the source documents.
It appears that there is a some incosistency in mapping MongoDB "_id" field to the Elastic "_id".
According to the documentation Elastic's "_id" cannot be configured in mappings. https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-id-field.html
I would greatly appreciate any help on this here
p
I have the same error. I think the problem is that
_id
is not a field in elasticsearch, it's the id of the document. A similar error is shown when trying to index a document like this:
Copy code
POST /shops/_doc
{
  "_id": "myid",
}
Copy code
{
  "error": {
    "root_cause": [
      {
        "type": "mapper_parsing_exception",
        "reason": "Field [_id] is a metadata field and cannot be added inside a document. Use the index API request parameters."
      }
    ],
    "type": "mapper_parsing_exception",
    "reason": "failed to parse field [_id] of type [_id] in document with id 'Q_4r14YB6S2dWM7xpyuE'. Preview of field's value: 'myid'",
    "caused_by": {
      "type": "mapper_parsing_exception",
      "reason": "Field [_id] is a metadata field and cannot be added inside a document. Use the index API request parameters."
    }
  },
  "status": 400
}
indexing _id can be turned off:
but then you don't have the mongodb id in elasticsearch. I tried creating a rename field pipeline in elasticsearch to rename
_id
to
mongo_id
, but no luck getting that to work yet.
I suppose in mongodb you can always copy
_id
to a new field, but that won't be very convenient.
t
There would be no problem if AirBye allowed mapping the source field to a field with a different name at the destination.
AirByte team can consider it as a feature request
Thank you @Petko Minkov for looking into this.
Interestingly, my AirByte version doesn't even allow me to exclude individual fields from syncing. Is it a feature of the latest version or something ?
p
I use the hosted cloud version. It's under connections -> replication ->
Activate the streams you want to sync
👍 1