From f685bdca9b695f6a5f91fe8d7f77b4147de99d16 Mon Sep 17 00:00:00 2001 From: Kostas Krikellas <131142368+kkrik-es@users.noreply.github.com> Date: Tue, 19 Sep 2023 12:46:45 +0300 Subject: [PATCH] [TEST] `illegal_argument_exception` when downsampling all indexes in serverless (#99630) Downsampling wildcard and _all indexes raises different errors in stateful (security disabled) vs serverless (security enabled): Stateful: ``` [{type=index_not_found_exception, reason=no such index [test*], index_uuid=_na_, index=test*, stack_trace=[test*] org.elasticsearch.index.IndexNotFoundException: no such index [test*]\n\tat org.elasticsearch.xpack.downsample.TransportDownsampleAction.masterOperation(TransportDownsampleAction.java:205) ``` Serverless: ``` [{type=illegal_argument_exception, reason=the action indices:admin/xpack/downsample does not support wildcards; the provided index expression(s) [test*] are not allowed, stack_trace=org.elasticsearch.ElasticsearchException$1: the action indices:admin/xpack/downsample does not support wildcards; the provided index expression(s) [test*] are not allowed ``` --- .../resources/rest-api-spec/test/downsample/10_basic.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/x-pack/plugin/downsample/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/downsample/10_basic.yml b/x-pack/plugin/downsample/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/downsample/10_basic.yml index f4dd187b82445..70f66f38d39b9 100644 --- a/x-pack/plugin/downsample/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/downsample/10_basic.yml +++ b/x-pack/plugin/downsample/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/downsample/10_basic.yml @@ -444,8 +444,10 @@ setup: body: index.blocks.write: true + # The following two tests may return different exceptions, depending on whether security is enabled (serverless) + # or not (stateful). - do: - catch: /index_not_found_exception/ + catch: /index_not_found_exception|illegal_argument_exception/ indices.downsample: index: test* target_index: test-downsample @@ -455,7 +457,7 @@ setup: } - do: - catch: /index_not_found_exception/ + catch: /index_not_found_exception|illegal_argument_exception/ indices.downsample: index: _all target_index: test-downsample