Skip to content

Elasticsearch Indexer failed with error code 413 (Request Entity Too Large)

One customer reported that they started seeing errors on their sidekiq workers after upgrading to 12.8, bulk request 2236: error: elastic: Error 413 (Request Entity Too Large)

@nick.thomas suggested lowering the values of two related configurations, which fixed their issue.

The default configuration for these two parameters are https://gitlab.com/gitlab-org/gitlab/-/blob/v12.8.7-ee/ee/app/models/ee/application_setting.rb#L101-102. The default bulk concurrency is 10. The bulk size parameter default value in RoR is 10.megabytes and it's actually equal to 10* 2^10 * 2^10 (while is refereed as mebibyte at other places). On the other hand, the Elasticsearch http.max_content_length defaults to 100mb. So, there could be mismatch between Megabyte vs Mebibyte.

This MR provides more information about how these two parameters are plumbed into the underlying indexer. gitlab-elasticsearch-indexer!56 (merged)

CC: @wchandler @jrreid @phikai

Edited by Changzheng Liu