Skip to content

Fix ES illegal_argument_exception

Dmitry Gruzd requested to merge 218576-fix-argument-exception into master

What does this MR do?

Elasticsearch fails with illegal_argument_exception because of the default highlight.max_analyzed_offset setting which is set to 1000000c bytes by default.

gitlab-elasticsearch-indexer on the other hand has a limit set to 1048576 bytes. This difference creates the problem for files with the size from 1000000c to 1048576 bytes. data/team.yml is one of those files.

This MR changes highlight.max_analyzed_offset to 1048576 for our index to make it consistently 1 MiB.

Additionally we should run this command on staging and production to apply this fix without index recreation

curl -XPUT 'https://CLUSTER_DOMAIN/gitlab-production/_settings' -H 'Content-Type: application/json' -d '{
 "index": {
  "highlight.max_analyzed_offset": 1048576
 }
}'

#218576 (closed)

How to repeat the problem

I used this repo locally and on staging to recreate the problem, for example, searching inside of this repo for structural results in 500

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Tasks

  • Update the config on staging
  • Update the config on prod

Closes #218576 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports