The problem is that invalid cluster names return an empty result without any error message.
./gradlew run -Dlicense.key=x-pack/license-tools/src/test/resources/public.key -Dtests.es.xpack.license.self_generated.type=trial -Dtests.es.xpack.security.enabled=true
$ curl -u elastic:password -H "Content-Type: application/json" "127.0.0.1:9200/_cluster/settings" -XPUT -d '
{ "persistent": {
"cluster": {
"remote" : {
"cluster_one": {
"seeds": ["127.0.0.1:9443"]
}
}
}
}}
'
$ curl -u elastic:password -H "Content-Type: application/json" "127.0.0.1:9200/_query?format=txt" -d '
{
"query": "from cluster_one:\"remote:index\""
}'
<no-fields>
---------------
$ curl -u elastic:password -H "Content-Type: application/json" "127.0.0.1:9200/_query?format=txt" -d '
{
"query": "from cluster_one:remote:index"
}'
{"error":{"root_cause":[{"type":"parsing_exception","reason":"line 1:24: mismatched input ':' expecting {<EOF>, '|', ',', 'metadata'}"}],"type":"parsing_exception","reason":"line 1:24: mismatched input ':' expecting {<EOF>, '|', ',', 'metadata'}","caused_by":{"type":"input_mismatch_exception","reason":null}},"status":400}%
$ curl -u elastic:password -H "Content-Type: application/json" "127.0.0.1:9200/_query?format=txt" -d '
{
"query": "from \"cluster_one:remote:index\""
}'
<no-fields>
---------------
This came up in #120355 (comment), when @idegtiarenko wanted to improve the grammar for CCQ.
The problem is that invalid cluster names return an empty result without any error message.
Reproducers against a local cluster: