diff --git a/esrally/client/factory.py b/esrally/client/factory.py index 3061aedc6..0dc3e19fc 100644 --- a/esrally/client/factory.py +++ b/esrally/client/factory.py @@ -367,8 +367,16 @@ def cluster_distribution_version(hosts, client_options, client_factory=EsClientF if versions.is_serverless(version_build_flavor): # overwrite static serverless version number version_number = "serverless" - authentication_info = es.perform_request(method="GET", path="/_security/_authenticate") - serverless_operator = authentication_info.body.get("operator", False) + + # determine operator status if security enabled, otherwise assume operator privileges + # pylint: disable=import-outside-toplevel + from elasticsearch.exceptions import ApiError + + try: + authentication_info = es.perform_request(method="GET", path="/_security/_authenticate") + serverless_operator = authentication_info.body.get("operator", False) + except ApiError: + serverless_operator = False if not versions.is_serverless(version_build_flavor) or serverless_operator is True: # if available, unconditionally wait for the REST layer - if it's not up, we'll intentionally raise the original error