Skip to content

ERROR Failed to create client to verify connection (Invalid or missing build flavor [oss]) #677

@minkyu725

Description

@minkyu725

Hello, I'm trying to use kafka-connect-elasticsearch as sink connector.

My Elasticsearch cluster uses oss-7.10.2 version, and when I run the connector, I got the error message below and fail.
ERROR Failed to create client to verify connection (Invalid or missing build flavor [oss])

I managed to run connector, but I had to downgrade kafka-connect-elasticsearch version.

kafka-connect-elasticsearch Versions RestHighLevlClient Versions Result
>= 13.0.0 >= 7.17.1 FAIL
<= 11.2.1 <= 7.9.3 SUCCESS

As I search the stacktrace, it seems that kafka-connect-elasticsearch uses RestHighLevelClient.info() for validation.
And since RestHighLevelClient 7.14 version, there appended version validation codes.

https://github.com/elastic/elasticsearch/blob/7.14/client/rest-high-level/src/main/java/org/elasticsearch/client/RestHighLevelClient.java#L2191

        if (major < 6) {
            return Optional.of("Elasticsearch version 6 or more is required");
        }

        if (major == 6 || (major == 7 && minor < 14)) {
            if ("You Know, for Search".equalsIgnoreCase(mainResponse.getTagline()) == false) {
                return Optional.of("Invalid or missing tagline [" + mainResponse.getTagline() + "]");
            }

            if (major == 7) {
                // >= 7.0 and < 7.14
                String responseFlavor = mainResponse.getVersion().getBuildFlavor();
                if ("default".equals(responseFlavor) == false) { // I think this is the point where validation error occurs.
                    // Flavor is unknown when running tests, and non-mocked responses will return an unknown flavor
                    if (Build.CURRENT.flavor() != Build.Flavor.UNKNOWN || "unknown".equals(responseFlavor) == false) {
                        return Optional.of("Invalid or missing build flavor [" + responseFlavor + "]");
                    }
                }
            }

            return Optional.empty();
        }

Can someone tell me is my guess right?
And if I want to use Elasticsearch oss build flavored version, should I use kafka-connect-elasticsearch versions under 13.0.0?
(If there is any property to make it compatible with oss build flavor, please let me know)

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions