Cannot update/create monitor over api after opendistro upgrade to opensearch

Hello everyone,

I’m trying to upgrade my opendistro to opensearch. The process itself occurred fine, but, when I tryied to update/create a new monitor through the api, I got the error:

mapper [destination.last_update_time] cannot be changed from type [long] to [date]

On cluster logs, these 3 lines appears to me:

[2021-10-22T20:10:24,613][WARN ][o.o.s.c.SecurityFlsDlsIndexSearcherWrapper] [node-1] search action for .opendistro-alerting-alerts is not allowed for a non adminDN user
[2021-10-22T20:10:24,617][WARN ][o.o.s.c.SecurityFlsDlsIndexSearcherWrapper] [node-1] search action for .opendistro-alerting-config is not allowed for a non adminDN user
[2021-10-22T20:10:24,653][ERROR][o.o.a.u.AlertingException] [node-1] Alerting error: java.lang.IllegalArgumentException: mapper [destination.last_update_time] cannot be changed from type [long] to [date]

Can anyone help me with this case?

Thanks

Hey @brunogui0812,

It’s possible that somehow the .opendistro-alerting-config index was created with dynamic mappings.

If you check the mappings and it doesn’t look like this, that could be the case.

To fix this, you can try to recreate the index manually with the right mappings. If you have little to nothing in there at the moment (Monitors, Destinations, etc.) you can just add back your Monitors and Destinations manually with the API.

If not, I would suggest backing up the index in either case and then trying to reindex back into the .opendistro-alerting-config when you recreate it.

Here is an example of using the reindex API:

POST _reindex
{
  "source": {
    "index": "my-backup"
  },
  "dest": {
    "index": ".recreated-opendistro-alerting-config"
  }
}
1 Like

Thanks for the answer @qreshi .

I will try to delete and re-add monitors and destinations