Mapping conflict with error field in Elasticsearch

In production, we are seeing type mismatch in the Elasticsearch structured logging fields:

image

It's currently a string in integrations_json and application_json:

https://log.gprd.gitlab.net/goto/9899ef94906f43dfc6599306e45d41b9

It's a string here:

  1. https://gitlab.com/gitlab-org/gitlab/blob/1993feb5e100c04f33c876ba1b9b7a9083227d8a/app/models/integrations/jira.rb#L531
  2. https://gitlab.com/gitlab-org/gitlab/blob/33e1a9f9f06795f5b8b44c947851d0ccac1189b0/ee/app/services/ci/sync_reports_to_approval_rules_service.rb#L19

image

However, https://cloudlogging.app.goo.gl/gjBetrpnS1EiMEWEA shows that we are attempt to use error.message in a few places:

  1. In the integrations_json, JIRA reports Unauthorized
  2. Project housekeeping failed: https://gitlab.com/gitlab-org/gitlab/blob/e900a5887574a51261058edf0cadeb18c3c31ced/app/services/projects/after_import_service.rb#L29

Maybe we should standardize on error.message.