By using AWS re:Post, you agree to the Terms of Use
/MSK Connect on t3.small fails due to not-retryable SaslAuthenticationException - worker configuration will not help - can AWS remove the connection limit?/

MSK Connect on t3.small fails due to not-retryable SaslAuthenticationException - worker configuration will not help - can AWS remove the connection limit?



we are encountering the same issues as e.g. regarding the SaslAuthenticationException while using MSK Connect with a kafka.t3.small instance.

Setting to e.g. 10000 ms will not resolve the issue, since the exception that is being thrown (SaslAuthenticationException) is not retryable (see and ultimately leads to a new creation of a client, not a reconnect.

When would the reconnect take place? As I went through the implementation, what I see is:

  1. that startConnect() in ConnectDistributed is calling the constructor of Worker
  2. the constructor of Worker calls ConnectUtils.lookupKafkaClusterId(config)
  3. that method calls Admin.create(config.originals()) - which opens up a new connection
  4. if you follow the calls from there, you will see that you end up not retrying upon obtaining SaslAuthenticationException (

Even if the retry would work, several AdminClients are created, which all connect to the MSK cluster. Since this is not a reconnect, settings cannot work for remediation. There is no mechanism in the Kafka code that would globally allow restricting these connections to happen only every x seconds. Unless I oversee something, MSK Connect should only work by chance with t3.small instances.

This forces us to either:

  • not use IAM and go for SASL/SCRAM
  • use a kafka.m5.large instance and go from about 32 USD/Month to 151 USD/Month per instance - meaning 90 USD vs 450 USD in our case

The limitation on the t3.small instance really limits what we want to achieve. The workaround presented here is not working and thus forces us to buy the larger instance. We have no need for a large instance and we don't want to have additional costs for simply using IAM for MSK Connect.

**Can AWS remove the limit on the t3.small instance or present a different workaround? That would be great :) **

I cannot open a support case for this, since we don't have the required subscription and I believe that this could be of general interest.

See parts of our logs using AWS MSK Connect:

[Worker-05ea3408948fa0a4c] [2022-01-01 22:41:53,059] INFO Creating Kafka admin client (org.apache.kafka.connect.util.ConnectUtils:49)
[Worker-05ea3408948fa0a4c] [2022-01-01 22:41:53,061] INFO AdminClientConfig values:
[Worker-05ea3408948fa0a4c] = 10000
[Worker-05ea3408948fa0a4c] = 10000
[Worker-05ea3408948fa0a4c] = 30000
[Worker-05ea3408948fa0a4c] 	retries = 2147483647
[Worker-05ea3408948fa0a4c] = 10000
[Worker-05ea3408948fa0a4c] [2022-01-01 22:41:54,269] ERROR Stopping due to error (org.apache.kafka.connect.cli.ConnectDistributed:86)
[Worker-05ea3408948fa0a4c] org.apache.kafka.connect.errors.ConnectException: Failed to connect to and describe Kafka cluster. Check worker's broker connection and security properties.
[Worker-05ea3408948fa0a4c] 	at org.apache.kafka.connect.util.ConnectUtils.lookupKafkaClusterId(
[Worker-05ea3408948fa0a4c] 	at org.apache.kafka.connect.util.ConnectUtils.lookupKafkaClusterId(
[Worker-05ea3408948fa0a4c] 	at org.apache.kafka.connect.runtime.Worker.<init>(
[Worker-05ea3408948fa0a4c] 	at org.apache.kafka.connect.runtime.Worker.<init>(
[Worker-05ea3408948fa0a4c] 	at org.apache.kafka.connect.cli.ConnectDistributed.startConnect(
[Worker-05ea3408948fa0a4c] 	at org.apache.kafka.connect.cli.ConnectDistributed.main(
[Worker-05ea3408948fa0a4c] Caused by: java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.SaslAuthenticationException: [e4afe53f-73b5-4b94-9ac3-30d737071e56]: Too many connects
[Worker-05ea3408948fa0a4c] 	at org.apache.kafka.common.internals.KafkaFutureImpl.wrapAndThrow(
[Worker-05ea3408948fa0a4c] 	at org.apache.kafka.common.internals.KafkaFutureImpl.access$000(
[Worker-05ea3408948fa0a4c] 	at org.apache.kafka.common.internals.KafkaFutureImpl$SingleWaiter.await(
[Worker-05ea3408948fa0a4c] 	at org.apache.kafka.common.internals.KafkaFutureImpl.get(
[Worker-05ea3408948fa0a4c] 	at org.apache.kafka.connect.util.ConnectUtils.lookupKafkaClusterId(
[Worker-05ea3408948fa0a4c] 	... 5 more
[Worker-05ea3408948fa0a4c] Caused by: org.apache.kafka.common.errors.SaslAuthenticationException: [e4afe53f-73b5-4b94-9ac3-30d737071e56]: Too many connects
[Worker-05ea3408948fa0a4c] [2022-01-01 22:41:54,281] INFO Stopped http_0.0.0.08083@68631b1d{HTTP/1.1, (http/1.1)}{} (org.eclipse.jetty.server.AbstractConnector:381)
[Worker-05ea3408948fa0a4c] [2022-01-01 22:41:54,283] INFO Stopped https_0.0.0.08443@611d0763{SSL, (ssl, http/1.1)}{} (org.eclipse.jetty.server.AbstractConnector:381)
[Worker-05ea3408948fa0a4c] MSK Connect encountered errors and failed.
1 Answers

Hi there, thank you for providing your valuable feedback regarding the service. Currently we advice that customers do not use IAM authenticated t3 instances with MSK Connect. This is due to connection limits currently in place on t3 instances. Amazon MSK team is aware of this issue and are working on solutions to increase the connection limit for t3 instances, which will allow this combination of connectors, instance type and authentication to function reliably. There is no ETA at the moment but please keep a tab of for updates on changes to current limits. Hope this helps!

answered 4 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions