Flowpack.ElasticSearch.ContentRepositoryAdaptor icon indicating copy to clipboard operation
Flowpack.ElasticSearch.ContentRepositoryAdaptor copied to clipboard

Bulk publishing leads to ElasticSearch Exception "action_request_validation_exception" for empty payload

Open mariofischer opened this issue 1 year ago • 0 comments

Problem: Publishing changes might lead to the following ElasticSearch Exception:

  [type] => action_request_validation_exception
  [reason] => Validation Failed: 1: no requests added;

This happens if the payload is empty (we don't why this is). In this case the check in Flowpack\ElasticSearch\ContentRepositoryAdaptor\Indexer\NodeIndexer is not sufficient:

            if (!isset($payload[$hash])) {
                continue;
            }

This can be circumvented by adding empty:

            if (!isset($payload[$hash]) || empty($payload[$hash])) {
                continue;
            }

mariofischer avatar Jul 25 '23 14:07 mariofischer