Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
minkyu725 opened this issue Feb 22, 2023 · 2 comments

Comments

@minkyu725
Copy link

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!

@SteveHNH
Copy link

I realize this comment is super old, but I just ran into this problem and you save me a ridiculous amount of time. I was able to get connect running with 11.2.7. Thanks for putting this out there.

@aonamrata
Copy link

I know, this is pretty old and still no replies on how to get it working with latest connector.. I am upgrading for security fixes from 11.1 so 11.2 is not a great option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants