"Cannot write to a field alias [...]" on reindex

Hi,

I'm trying to migrate an Elasticsearch index from 6.8 to 7.10 using the _reindex route API.

Unfortunately during the index migration I get the error Cannot write to a field alias [gl2_message_id].

The mapping, copied from source index to destination index, is the following:

"properties": {
  "gl2_message_id": {
    "type": "alias",
    "path": "id"
  },
  "id": {
    "type": "keyword"
  },
  [...]

FYI, these index and data have been generated by Graylog

For what I understand, the _reindex process tries to write to gl2_message_id which is forbidden as it is an alias.

What I don't understand is how is it possible that in the source index a concrete value exists in gl2_message_id.

So I tried to recreate this situation to understand it. But I failed to reproduce it:

  • First try on a new index, I create a document { "field1": true, "field1Alias": true }.
    Then I update mapping and declare the field field1Alias as { "type": "alias", "path": "field1" }.

    It fails (as it should) because field1Alias exists yet.

  • Second try on a new index, I create a document { "field1": true }.
    Then I update mapping and declare the field field1Alias as { "type": "alias", "path": "field1" }.
    Finally I try to index a document { "field1Alias": true }.

    It fails (as it should) because field1Alias is an alias and can't received concrete data.

I have 2 questions:

  1. How is it possible that I get data returned from field gl2_message_id during _reindex while it's an alias?
  2. How can I reindex these data?

I tried a lot of things, read the documentations multiple time but I'm stuck right now and I asking myself if there is a bug which allowed to put data to gl2_message_id or a bug in _reindex.

Thanks,
Adrien

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.