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

Sarama TLS not working: client has run out of available brokers to talk to: 3 errors occurred:\n\t* unexpected EOF #3037

Open
Larleyt opened this issue Dec 12, 2024 · 9 comments

Comments

@Larleyt
Copy link

Larleyt commented Dec 12, 2024

Description

I have a service that already had completely working Confluent Kafka Consumers and Producers with SSL enabled in the environment I've got the following bug. Then I've added a goka package which only supports Sarama.
When I'm trying to turn on Sarama's TLS (without cert verifying – the same as Confluent consumer), I get the following error:
Error creating the kafka client: kafka: client has run out of available brokers to talk to: 3 errors occurred:\n\t* unexpected EOF\n\t* unexpected EOF\n\t* unexpected EOF\n"

Versions
Sarama Kafka Go
1.41.3 3.4.0 1.23.3

I also tried different sarama.V0_11_0_0, V2_8_*, etc. Nothing worked

Configuration
func getSaramaConfig(tlsEnabled bool) *sarama.Config {
	config := sarama.NewConfig()
	config.Version = sarama.V0_11_0_0
	config.Net.TLS.Enable = tlsEnabled
	config.Net.TLS.Config = &tls.Config{
		InsecureSkipVerify: true,
	}
	return config
}

The code that utilizes the Sarama and not starting:

code: CLICK ME

func NewStreamProcessor(cfg *config.KafkaStreams, logger *zerolog.Logger) (*StreamProcessor, error) {
	sp := &StreamProcessor{
		cfg:    cfg,
		logger: logger,
	}
	sp.logger.Info().Msg("Initializing StreamProcessor")
	// Sarama Kafka config
	saramaCfg := getSaramaConfig(cfg.TLSEnabled)

	requestCodec := new(RequestCodec)
	mediaResultCodec := new(MediaResultCodec)
	finalResponseCodec := new(FinalResponseCodec)
	stateCodec := new(ProcessingStateCodec)

	tmc := goka.NewTopicManagerConfig()
	tmc.Table.Replication = 1
	tmc.Stream.Replication = 1

	group := goka.Group(cfg.ConsumerGroup)
	requestsStream := goka.Stream(cfg.InputTopic)
	mediaStream := goka.Stream(cfg.MediaTopic)
	outputStream := goka.Stream(cfg.OutputTopic)

	builder := goka.DefineGroup(group,
		goka.Input(requestsStream, requestCodec, sp.handleRequest),
		goka.Input(mediaStream, mediaResultCodec, sp.handleMediaResult),
		goka.Output(outputStream, finalResponseCodec),
		goka.Persist(stateCodec),
	)

	sp.logger.Info().Str("bootstrap_servers", cfg.BootstrapServers).Msg("Kafka bootstrap servers")
	cfg.BootstrapServers = strings.ReplaceAll(cfg.BootstrapServers, " ", "")
	bsServers := strings.Split(cfg.BootstrapServers, ",")

	sp.logger.Info().Strs("bootstrap_servers_split", bsServers).Msg("Kafka bootstrap servers split")
	sp.logger.Info().
		Str("input_topic", cfg.InputTopic).
		Str("output_topic", cfg.OutputTopic).
		Str("media_topic", cfg.MediaTopic).
		Msg("Topics")

	emitter, err := goka.NewEmitter(
		bsServers,
		goka.Stream(cfg.OutputTopic),
		finalResponseCodec,
		goka.WithEmitterProducerBuilder(goka.ProducerBuilderWithConfig(saramaCfg)),
	)
	if err != nil {
		return nil, fmt.Errorf("failed to create emitter: %w", err)
	}
	sp.logger.Info().Msg("Kafka Streams Emitter created")

	processor, err := goka.NewProcessor(bsServers,
		builder,
		goka.WithStorageBuilder(func(topic string, partition int32) (storage.Storage, error) {
			// TODO: replace if will be memory consuming
			return storage.NewMemory(), nil
		}),
		goka.WithHasher(goka.DefaultHasher()),
		goka.WithConsumerGroupBuilder(goka.ConsumerGroupBuilderWithConfig(saramaCfg)),
		goka.WithTopicManagerBuilder(goka.TopicManagerBuilderWithConfig(saramaCfg, tmc)),
	)
	if err != nil {
		return nil, fmt.Errorf("failed to create processor: %w", err)
	}
	sp.logger.Info().Msg("Kafka streams Processor (consumer) created")

	sp.processor = processor
	sp.emitter = emitter
	return sp, nil
}

Logs
logs: CLICK ME

{"level":"info","caller":"/build/internal/infrastructure/repository/kafka/producer.go:40","time":"2024-12-12T09:45:15Z","message":"Creating Kafka Producer"}
{"level":"info","bootstrap.servers":"b-1.our-server:9094,b-3.our-server:9094,b-2.our-server:9094","security_protocol":"ssl","caller":"/build/internal/infrastructure/repository/kafka/producer.go:41","time":"2024-12-12T09:45:15Z","message":"Kafka Producer configuration"}
{"level":"info","caller":"/build/internal/infrastructure/repository/kafka/consumer.go:31","time":"2024-12-12T09:45:15Z","message":"Creating Kafka Consumer"}
{"level":"info","bootstrap.servers":"b-1.our-server:9094,b-3.our-server:9094,b-2.our-server:9094","security_protocol":"ssl","caller":"/build/internal/infrastructure/repository/kafka/consumer.go:32","time":"2024-12-12T09:45:15Z","message":"Kafka Consumer configuration"}
{"level":"info","caller":"/build/internal/infrastructure/repository/kafka/producer.go:40","time":"2024-12-12T09:45:15Z","message":"Creating Kafka Producer"}
{"level":"info","bootstrap.servers":"b-1.our-server:9094,b-3.our-server:9094,b-2.our-server:9094","security_protocol":"ssl","caller":"/build/internal/infrastructure/repository/kafka/producer.go:41","time":"2024-12-12T09:45:15Z","message":"Kafka Producer configuration"}
{"level":"info","caller":"/build/internal/app/app.go:152","time":"2024-12-12T09:45:15Z","message":"Application start"}
{"level":"debug","caller":"/build/internal/usecase/msgbroker/msgbroker.go:79","time":"2024-12-12T09:45:15Z","message":"MessageBroker is starting"}
{"level":"debug","caller":"/build/internal/infrastructure/repository/kafka/consumer.go:130","time":"2024-12-12T09:45:15Z","message":"Get all queue names"}
{"level":"debug","topicCount":16,"caller":"/build/internal/infrastructure/repository/kafka/consumer.go:136","time":"2024-12-12T09:45:15Z","message":"Get topic metadata"}
{"level":"debug","queue":"sc_input_with_media","caller":"/build/internal/infrastructure/repository/kafka/consumer.go:83","time":"2024-12-12T09:45:15Z","message":"Subscribing to queue"}
{"level":"debug","caller":"/build/internal/usecase/msgbroker/msgbroker.go:99","time":"2024-12-12T09:45:15Z","message":"MessageBroker finished initialization"}
{"level":"debug","caller":"/build/internal/usecase/msgbroker/msgbroker.go:102","time":"2024-12-12T09:45:15Z","message":"MessageBroker is starting Consumer"}
{"level":"debug","max_workers":20,"caller":"/build/internal/usecase/msgbroker/msgbroker.go:114","time":"2024-12-12T09:45:15Z","message":"Started message consuming loop"}
{"level":"info","caller":"/build/internal/usecase/streamprocessor/streamprocessor.go:49","time":"2024-12-12T09:45:15Z","message":"Initializing StreamProcessor"}
{"level":"info","bootstrap_servers":"b-1.our-server:9094,b-3.our-server:9094,b-2.our-server:9094","caller":"/build/internal/usecase/streamprocessor/streamprocessor.go:73","time":"2024-12-12T09:45:15Z","message":"Kafka bootstrap servers"}
{"level":"info","bootstrap_servers_split":["b-1.our-server:9094","b-3.our-server:9094","b-2.our-server:9094"[],"caller":"/build/internal/usecase/streamprocessor/streamprocessor.go:76","time":"2024-12-12T09:45:15Z","message":"Kafka bootstrap servers split"}
{"level":"info","input_topic":"messages_engine_input_request","output_topic":"sc_input_with_media","media_topic":"media_descriptions","caller":"/build/internal/usecase/streamprocessor/streamprocessor.go:81","time":"2024-12-12T09:45:15Z","message":"Topics"}
{"level":"info","client_id":"172.18.39.81","method":"GET","status_code":200,"body_size":-1,"path":"/ready","latency":"47.05µs","caller":"/build/internal/controller/http/v1/middleware/logger.go:62","time":"2024-12-12T09:45:16Z"}
{"level":"fatal","error":"failed to create emitter: error creating Kafka producer: Failed to start Sarama producer: kafka: client has run out of available brokers to talk to: 3 errors occurred:\n\t* unexpected EOF\n\t* unexpected EOF\n\t* unexpected EOF\n","caller":"/build/internal/app/app.go:142","time":"2024-12-12T09:45:16Z","message":"Unable to initialize StreamProcessor"}

Additional Context

As you can see from the logs, Confluent Kafka is starting absolutely fine (first part of the logs), but Sarama does not.
Additionally, I wonder why bootstrap servers' string split by comma (bootstrap_servers_split in logs) have this [] (Confluent accepts single string with comma, Goka accepts a slice). But that might be just Zerolog representation of slice in logs, cause otherwise this slice would not work locally (without TLS).

@Larleyt Larleyt changed the title Sarama TLS not working client has run out of available brokers to talk to: 3 errors occurred:\n\t* unexpected EOF Sarama TLS not working: client has run out of available brokers to talk to: 3 errors occurred:\n\t* unexpected EOF Dec 12, 2024
@Larleyt
Copy link
Author

Larleyt commented Dec 12, 2024

More logs with Sarama debug enabled:

 2024/12/12 11:59:33 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
 2024/12/12 11:59:33 [Sarama] client/metadata fetching metadata for all topics from broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
 2024/12/12 11:59:33 [Sarama] Connected to broker at b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
 2024/12/12 11:59:33 [Sarama] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
 2024/12/12 11:59:33 [Sarama] Closed connection to broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
 2024/12/12 11:59:33 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
 2024/12/12 11:59:33 [Sarama] client/metadata fetching metadata for all topics from broker b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
 2024/12/12 11:59:33 [Sarama] Connected to broker at b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
 2024/12/12 11:59:33 [Sarama] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
 2024/12/12 11:59:33 [Sarama] Closed connection to broker b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
 2024/12/12 11:59:33 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
 2024/12/12 11:59:33 [Sarama] client/metadata fetching metadata for all topics from broker b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
 2024/12/12 11:59:33 [Sarama] Connected to broker at b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
 2024/12/12 11:59:33 [Sarama] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
 2024/12/12 11:59:33 [Sarama] Closed connection to broker b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
 2024/12/12 11:59:33 client/metadata no available broker to send metadata request to
 2024/12/12 11:59:33 [Sarama] client/brokers resurrecting 3 dead seed brokers

@dnwe
Copy link
Collaborator

dnwe commented Dec 19, 2024

@Larleyt hmm, so an "unexpected EOF" at connection time when enabling TLS on the client like this usually suggests that the brokers are expecting plain traffic. If I point a tls-enabled sarama client at a non-TLS broker then I similarly get EOF

Can you try running this simple standalone "apiversions" sample? https://gist.github.com/dnwe/8cc61dad3e4fdabf857d03f20368dce5

If you go build and then try (within your aws environment so you have access to the hosts) doing:

./apiversions -broker b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094

and

./apiversions -tls -tls-skip-verify -broker b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094

and share the output from each, that would be useful

@Larleyt
Copy link
Author

Larleyt commented Dec 23, 2024

Hello @dnwe, thanks for your reply!

For first command (/apiversions -broker ..) it says:

2024/12/23 14:18:40 unexpected EOF

For ./apiversions -tls -tls-skip-verify -broker .. it says:

,APIs,
0,ProduceRequest,9
1,FetchRequest,13
2,ListOffsetsRequest,7
3,MetadataRequest,12
4,LeaderAndIsrRequest,7
5,StopReplicaRequest,4
6,UpdateMetadataRequest,8
7,ControlledShutdownRequest,3
8,OffsetCommitRequest,8
9,OffsetFetchRequest,8
10,FindCoordinatorRequest,4
11,JoinGroupRequest,9
12,HeartbeatRequest,4
13,LeaveGroupRequest,5
14,SyncGroupRequest,5
15,DescribeGroupsRequest,5
16,ListGroupsRequest,4
17,SaslHandshakeRequest,1
18,ApiVersionsRequest,3
19,CreateTopicsRequest,7
20,DeleteTopicsRequest,6
21,DeleteRecordsRequest,2
22,InitProducerIdRequest,4
23,OffsetForLeaderEpochRequest,4
24,AddPartitionsToTxnRequest,3
25,AddOffsetsToTxnRequest,3
26,EndTxnRequest,3
27,WriteTxnMarkersRequest,1
28,TxnOffsetCommitRequest,3
29,DescribeAclsRequest,3
30,CreateAclsRequest,3
31,DeleteAclsRequest,3
32,DescribeConfigsRequest,4
33,AlterConfigsRequest,2
34,AlterReplicaLogDirsRequest,2
35,DescribeLogDirsRequest,4
36,SaslAuthenticateRequest,2
37,CreatePartitionsRequest,3
38,CreateDelegationTokenRequest,3
39,RenewDelegationTokenRequest,2
40,ExpireDelegationTokenRequest,2
41,DescribeDelegationTokenRequest,3
42,DeleteGroupsRequest,2
43,ElectLeadersRequest,2
44,IncrementalAlterConfigsRequest,1
45,AlterPartitionReassignmentsRequest,0
46,ListPartitionReassignmentsRequest,0
47,OffsetDeleteRequest,0
48,DescribeClientQuotasRequest,1
49,AlterClientQuotasRequest,1
50,DescribeUserScramCredentialsRequest,0
51,AlterUserScramCredentialsRequest,0
56,AlterPartitionRequest,2
57,UpdateFeaturesRequest,1
58,EnvelopeRequest,0
60,DescribeClusterRequest,0
61,DescribeProducersRequest,0
65,DescribeTransactionsRequest,0
66,ListTransactionsRequest,0
67,AllocateProducerIdsRequest,0

As I understand, it doesn't work with plaintext (first cmd), but works with TLS enabled and skip-verify. As expected. But I have skip-verify=True in my code... so I have no idea why it's not working there.

@dnwe
Copy link
Collaborator

dnwe commented Dec 23, 2024

@Larleyt hmm thanks, so that test confirms that generally the brokers are working, they are correctly TLS-enabled (and Sarama can successfully TLS handshake with them) and they have matching support api versions to what you'd see with the official Apache Kafka 3.4.0 release.

@dnwe
Copy link
Collaborator

dnwe commented Dec 23, 2024

@Larleyt does something simple like this for roundtripping a metadata request also work OK?

Have you enabled SASL or similar auth in your cluster or are you just using TLS?

@Larleyt
Copy link
Author

Larleyt commented Dec 23, 2024

Here's what I've got now with sarama.V3_4..:

Logs
2024/12/23 11:41:37 [Sarama[] client/brokers registered new broker #3 at b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:37 [Sarama[] client/brokers registered new broker #1 at b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:37 Successfully initialized new client
2024/12/23 11:41:37 [Sarama[] Connected to broker at b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (registered as #2)
{"level":"info","client_id":"172.18.44.88","method":"GET","status_code":200,"body_size":-1,"path":"/ready","latency":"66.402µs","caller":"/build/internal/controller/http/v1/middleware/logger.go:62","time":"2024-12-23T11:41:37Z"}
2024/12/23 11:41:37 [Sarama[] client/metadata fetching metadata for all topics from broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:37 [Sarama[] client/metadata fetching metadata for all topics from broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:37 [Sarama[] client/metadata fetching metadata for all topics from broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
{"level":"info","caller":"/build/internal/usecase/streamprocessor/streamprocessor.go:110","time":"2024-12-23T11:41:37Z","message":"Kafka streams Processor (consumer) created"}
2024/12/23 11:41:37 Closing Client
2024/12/23 11:41:37 [Processor sc-streams-consumer-group[] starting
2024/12/23 11:41:37 Initializing new client
2024/12/23 11:41:37 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 11:41:37 [Sarama[] Closed connection to broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:37 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 11:41:37 [Sarama[] Closed connection to broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:37 [Sarama[] client/metadata fetching metadata for all topics from broker b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:37 [Sarama[] Connected to broker at b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 11:41:37 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 11:41:37 [Sarama[] Closed connection to broker b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:37 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 11:41:37 [Sarama[] client/metadata fetching metadata for all topics from broker b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:37 [Sarama[] Connected to broker at b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 11:41:37 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 11:41:37 [Sarama[] Closed connection to broker b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:37 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 11:41:37 [Sarama[] client/metadata fetching metadata for all topics from broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:37 [Sarama[] Connected to broker at b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 11:41:37 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 11:41:37 [Sarama[] Closed connection to broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:37 client/metadata no available broker to send metadata request to
2024/12/23 11:41:37 [Sarama[] client/brokers resurrecting 3 dead seed brokers
2024/12/23 11:41:38 [Sarama[] client/metadata retrying after 250ms... (2 attempts remaining)
2024/12/23 11:41:38 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 11:41:38 [Sarama[] client/metadata fetching metadata for all topics from broker b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:38 [Sarama[] Connected to broker at b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 11:41:38 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 11:41:38 [Sarama[] Closed connection to broker b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:38 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 11:41:38 [Sarama[] client/metadata fetching metadata for all topics from broker b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:38 [Sarama[] Connected to broker at b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 11:41:38 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 11:41:38 [Sarama[] Closed connection to broker b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:38 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 11:41:38 [Sarama[] client/metadata fetching metadata for all topics from broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:38 [Sarama[] Connected to broker at b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 11:41:38 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 11:41:38 [Sarama[] Closed connection to broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:38 client/metadata no available broker to send metadata request to
2024/12/23 11:41:38 [Sarama[] client/brokers resurrecting 3 dead seed brokers
2024/12/23 11:41:38 [Sarama[] client/metadata retrying after 250ms... (1 attempts remaining)
2024/12/23 11:41:38 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 11:41:38 [Sarama[] client/metadata fetching metadata for all topics from broker b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:38 [Sarama[] Connected to broker at b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 11:41:38 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 11:41:38 [Sarama[] Closed connection to broker b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:38 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 11:41:38 [Sarama[] client/metadata fetching metadata for all topics from broker b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:38 [Sarama[] Connected to broker at b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 11:41:38 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 11:41:38 [Sarama[] Closed connection to broker b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:38 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 11:41:38 [Sarama[] client/metadata fetching metadata for all topics from broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:38 [Sarama[] Connected to broker at b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 11:41:38 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 11:41:38 [Sarama[] Closed connection to broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:38 client/metadata no available broker to send metadata request to
2024/12/23 11:41:38 [Sarama[] client/brokers resurrecting 3 dead seed brokers
2024/12/23 11:41:38 [Sarama[] client/metadata retrying after 250ms... (0 attempts remaining)
2024/12/23 11:41:38 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 11:41:38 [Sarama[] client/metadata fetching metadata for all topics from broker b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:38 [Sarama[] Connected to broker at b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 11:41:38 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 11:41:38 [Sarama[] Closed connection to broker b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:38 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 11:41:38 [Sarama[] client/metadata fetching metadata for all topics from broker b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:38 [Sarama[] Connected to broker at b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 11:41:38 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 11:41:38 [Sarama[] Closed connection to broker b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:38 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 11:41:38 [Sarama[] client/metadata fetching metadata for all topics from broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:38 [Sarama[] Connected to broker at b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 11:41:38 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 11:41:38 [Sarama[] Closed connection to broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 11:41:38 client/metadata no available broker to send metadata request to
2024/12/23 11:41:38 [Sarama[] client/brokers resurrecting 3 dead seed brokers
2024/12/23 11:41:38 Closing Client
2024/12/23 11:41:38 [Processor sc-streams-consumer-group[] stopped
{"level":"error","error":"1 error occurred:\n\t* Error creating consumer for brokers [b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094,b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094,b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094[]: kafka: client has run out of available brokers to talk to: 3 errors occurred:\n\t* unexpected EOF\n\t* unexpected EOF\n\t* unexpected EOF\n\n\n","caller":"/build/internal/usecase/streamprocessor/streamprocessor.go:259","time":"2024-12-23T11:41:38Z","message":"Processor error"}
{"level":"error","error":"1 error occurred:\n\t* Error creating consumer for brokers [b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094,b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094,b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094[]: kafka: client has run out of available brokers to talk to: 3 errors occurred:\n\t* unexpected EOF\n\t* unexpected EOF\n\t* unexpected EOF\n\n\n","caller":"/build/internal/app/app.go:146","time":"2024-12-23T11:41:38Z","message":"Unexpected error during MessageBroker.Run"}
{"level":"info","caller":"/build/internal/app/app.go:156","time":"2024-12-23T11:41:38Z","message":"Shutting down HTTP server"}
{"level":"error","error":"http: Server closed","fn":"app.Run.httpServer.Notify","caller":"/build/internal/app/app.go:164","time":"2024-12-23T11:41:38Z"}
{"level":"error","error":"context canceled","fn":"app.Run.redisClient.Shutdown","caller":"/build/internal/app/app.go:173","time":"2024-12-23T11:41:38Z"}
{"level":"info","caller":"/build/internal/app/app.go:175","time":"2024-12-23T11:41:38Z","message":"Shutting down..."}
{"level":"debug","caller":"/build/internal/usecase/msgbroker/msgbroker.go:120","time":"2024-12-23T11:41:38Z","message":"Context cancelled"}
{"level":"debug","caller":"/build/internal/usecase/msgbroker/msgbroker.go:153","time":"2024-12-23T11:41:38Z","message":"MessageBroker is shutting down"}
{"level":"debug","caller":"/build/internal/infrastructure/repository/kafka/consumer.go:64","time":"2024-12-23T11:41:38Z","message":"Kafka is shutting down"}
{"level":"debug","caller":"/build/internal/infrastructure/repository/kafka/consumer.go:78","time":"2024-12-23T11:41:38Z","message":"Kafka has shut down"}
{"level":"debug","caller":"/build/internal/usecase/msgbroker/msgbroker.go:157","time":"2024-12-23T11:41:38Z","message":"MessageBroker has shut down"}
{"level":"info","caller":"/build/internal/app/app.go:185","time":"2024-12-23T11:41:38Z","message":"App shut down successfully."}
stream closed EOF for copilot/sc-dev-79d6c6884b-87wxq (sc-dev)
  

Confluent consumers don't work anymore too, when Sarama consumer/producer exist. As soon as I remove Sarama client Confluent work fine (with TLS enabled):

Logs
{"level":"info","bootstrap.servers":"b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094,b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094,b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094","security_protocol":"ssl","caller":"/build/internal/infrastructure/repository/kafka/producer.go:41","time":"2024-12-23T12:01:04Z","message":"Kafka Producer configuration"}
{"level":"info","caller":"/build/internal/infrastructure/repository/kafka/consumer.go:31","time":"2024-12-23T12:01:04Z","message":"Creating Kafka Consumer"}
{"level":"info","bootstrap.servers":"b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094,b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094,b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094","security_protocol":"ssl","caller":"/build/internal/infrastructure/repository/kafka/consumer.go:32","time":"2024-12-23T12:01:04Z","message":"Kafka Consumer configuration"}
{"level":"info","caller":"/build/internal/infrastructure/repository/kafka/producer.go:40","time":"2024-12-23T12:01:04Z","message":"Creating Kafka Producer"}
{"level":"info","bootstrap.servers":"b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094,b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094,b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094","security_protocol":"ssl","caller":"/build/internal/infrastructure/repository/kafka/producer.go:41","time":"2024-12-23T12:01:04Z","message":"Kafka Producer configuration"}
{"level":"info","caller":"/build/internal/app/app.go:151","time":"2024-12-23T12:01:04Z","message":"Application start"}
{"level":"debug","caller":"/build/internal/usecase/msgbroker/msgbroker.go:79","time":"2024-12-23T12:01:04Z","message":"MessageBroker is starting"}
{"level":"debug","caller":"/build/internal/infrastructure/repository/kafka/consumer.go:130","time":"2024-12-23T12:01:04Z","message":"Get all queue names"}
{"level":"debug","topicCount":16,"caller":"/build/internal/infrastructure/repository/kafka/consumer.go:136","time":"2024-12-23T12:01:04Z","message":"Get topic metadata"}
{"level":"debug","queue":"sc_input_with_media","caller":"/build/internal/infrastructure/repository/kafka/consumer.go:83","time":"2024-12-23T12:01:04Z","message":"Subscribing to queue"}
{"level":"debug","caller":"/build/internal/usecase/msgbroker/msgbroker.go:99","time":"2024-12-23T12:01:04Z","message":"MessageBroker finished initialization"}
{"level":"debug","caller":"/build/internal/usecase/msgbroker/msgbroker.go:102","time":"2024-12-23T12:01:04Z","message":"MessageBroker is starting Consumer"}
{"level":"debug","max_workers":20,"caller":"/build/internal/usecase/msgbroker/msgbroker.go:114","time":"2024-12-23T12:01:04Z","message":"Started message consuming loop"}
{"level":"info","client_id":"172.18.36.118","method":"GET","status_code":200,"body_size":-1,"path":"/ready","latency":"54.301µs","caller":"/build/internal/controller/http/v1/middleware/logger.go:62","time":"2024-12-23T12:01:06Z"}
{"level":"info","client_id":"172.18.36.118","method":"GET","status_code":200,"body_size":-1,"path":"/health","latency":"40.52µs","caller":"/build/internal/controller/http/v1/middleware/logger.go:62","time":"2024-12-23T12:01:12Z"}
{"level":"info","client_id":"172.18.36.118","method":"GET","status_code":200,"body_size":-1,"path":"/ready","latency":"59.34µs","caller":"/build/internal/controller/http/v1/middleware/logger.go:62","time":"2024-12-23T12:01:12Z"}
{"level":"info","client_id":"172.18.36.118","method":"GET","status_code":200,"body_size":-1,"path":"/ready","latency":"10.73µs","caller":"/build/internal/controller/http/v1/middleware/logger.go:62","time":"2024-12-23T12:01:22Z"}
{"level":"info","client_id":"172.18.36.118","method":"GET","status_code":200,"body_size":-1,"path":"/health","latency":"5.09µs","caller":"/build/internal/controller/http/v1/middleware/logger.go:62","time":"2024-12-23T12:01:22Z"}

something simple like this

This link is in private repo, no access.

@Larleyt
Copy link
Author

Larleyt commented Dec 23, 2024

If I leave only Sarama client, it doesn't work:

Logs
2024/12/23 12:37:27 [Sarama[] client/metadata fetching metadata for all topics from broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:27 [Sarama[] Connected to broker at b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 12:37:27 [Sarama[] client/brokers registered new broker #2 at b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:27 [Sarama[] client/brokers registered new broker #3 at b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:27 [Sarama[] client/brokers registered new broker #1 at b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:27 Successfully initialized new client
2024/12/23 12:37:27 [Sarama[] Connected to broker at b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (registered as #2)
2024/12/23 12:37:27 [Sarama[] client/metadata fetching metadata for all topics from broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:27 [Sarama[] client/metadata fetching metadata for all topics from broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:27 [Sarama[] client/metadata fetching metadata for all topics from broker b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:27 [Sarama[] Connected to broker at b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (registered as #1)
{"level":"info","caller":"/build/internal/usecase/streamprocessor/streamprocessor.go:110","time":"2024-12-23T12:37:27Z","message":"Kafka streams Processor (consumer) created"}
2024/12/23 12:37:27 Closing Client
2024/12/23 12:37:27 [Processor sc-streams-consumer-group[] starting
2024/12/23 12:37:27 Initializing new client
2024/12/23 12:37:27 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 12:37:27 [Sarama[] Closed connection to broker b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:27 [Sarama[] Closed connection to broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:27 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 12:37:27 [Sarama[] Closed connection to broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:27 [Sarama[] client/metadata fetching metadata for all topics from broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:27 [Sarama[] Connected to broker at b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 12:37:27 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 12:37:27 [Sarama[] Closed connection to broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:27 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 12:37:27 [Sarama[] client/metadata fetching metadata for all topics from broker b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:27 [Sarama[] Connected to broker at b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 12:37:27 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 12:37:27 [Sarama[] Closed connection to broker b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:27 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 12:37:27 [Sarama[] client/metadata fetching metadata for all topics from broker b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:27 [Sarama[] Connected to broker at b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 12:37:27 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 12:37:27 [Sarama[] Closed connection to broker b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:27 client/metadata no available broker to send metadata request to
2024/12/23 12:37:27 [Sarama[] client/brokers resurrecting 3 dead seed brokers
2024/12/23 12:37:28 [Sarama[] client/metadata retrying after 250ms... (2 attempts remaining)
2024/12/23 12:37:28 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 12:37:28 [Sarama[] client/metadata fetching metadata for all topics from broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:28 [Sarama[] Connected to broker at b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 12:37:28 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 12:37:28 [Sarama[] Closed connection to broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:28 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 12:37:28 [Sarama[] client/metadata fetching metadata for all topics from broker b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:28 [Sarama[] Connected to broker at b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 12:37:28 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 12:37:28 [Sarama[] Closed connection to broker b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:28 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 12:37:28 [Sarama[] client/metadata fetching metadata for all topics from broker b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:28 [Sarama[] Connected to broker at b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 12:37:28 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 12:37:28 [Sarama[] Closed connection to broker b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:28 client/metadata no available broker to send metadata request to
2024/12/23 12:37:28 [Sarama[] client/brokers resurrecting 3 dead seed brokers
2024/12/23 12:37:28 [Sarama[] client/metadata retrying after 250ms... (1 attempts remaining)
2024/12/23 12:37:28 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 12:37:28 [Sarama[] client/metadata fetching metadata for all topics from broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:28 [Sarama[] Connected to broker at b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 12:37:28 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 12:37:28 [Sarama[] Closed connection to broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:28 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 12:37:28 [Sarama[] client/metadata fetching metadata for all topics from broker b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:28 [Sarama[] Connected to broker at b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 12:37:28 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 12:37:28 [Sarama[] Closed connection to broker b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:28 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 12:37:28 [Sarama[] client/metadata fetching metadata for all topics from broker b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:28 [Sarama[] Connected to broker at b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 12:37:28 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 12:37:28 [Sarama[] Closed connection to broker b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:28 client/metadata no available broker to send metadata request to
2024/12/23 12:37:28 [Sarama[] client/brokers resurrecting 3 dead seed brokers
2024/12/23 12:37:28 [Sarama[] client/metadata retrying after 250ms... (0 attempts remaining)
2024/12/23 12:37:28 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 12:37:28 [Sarama[] client/metadata fetching metadata for all topics from broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:28 [Sarama[] Connected to broker at b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 12:37:28 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 12:37:28 [Sarama[] Closed connection to broker b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:28 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 12:37:28 [Sarama[] client/metadata fetching metadata for all topics from broker b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
{"level":"info","client_id":"172.18.36.118","method":"GET","status_code":200,"body_size":-1,"path":"/ready","latency":"53.021µs","caller":"/build/internal/controller/http/v1/middleware/logger.go:62","time":"2024-12-23T12:37:28Z"}
2024/12/23 12:37:28 [Sarama[] Connected to broker at b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 12:37:28 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 12:37:28 [Sarama[] Closed connection to broker b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:28 Deprecation warning: Consumer.Group.Rebalance.Strategy exists for historical compatibility and should not be used. Please use Consumer.Group.Rebalance.GroupStrategies
2024/12/23 12:37:28 [Sarama[] client/metadata fetching metadata for all topics from broker b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:28 [Sarama[] Connected to broker at b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094 (unregistered)
2024/12/23 12:37:28 [Sarama[] client/metadata got error from broker -1 while fetching metadata: unexpected EOF
2024/12/23 12:37:28 [Sarama[] Closed connection to broker b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094
2024/12/23 12:37:28 client/metadata no available broker to send metadata request to
2024/12/23 12:37:28 [Sarama[] client/brokers resurrecting 3 dead seed brokers
2024/12/23 12:37:28 Closing Client
2024/12/23 12:37:28 [Processor sc-streams-consumer-group[] stopped
{"level":"error","error":"1 error occurred:\n\t* Error creating consumer for brokers [b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094,b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094,b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094[]: kafka: client has run out of available brokers to talk to: 3 errors occurred:\n\t* unexpected EOF\n\t* unexpected EOF\n\t* unexpected EOF\n\n\n","caller":"/build/internal/usecase/streamprocessor/streamprocessor.go:259","time":"2024-12-23T12:37:28Z","message":"Processor error"}
{"level":"error","error":"1 error occurred:\n\t* Error creating consumer for brokers [b-1.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094,b-3.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094,b-2.t1devkafka.u91w03.c17.kafka.us-east-1.amazonaws.com:9094[]: kafka: client has run out of available brokers to talk to: 3 errors occurred:\n\t* unexpected EOF\n\t* unexpected EOF\n\t* unexpected EOF\n\n\n","caller":"/build/internal/app/app.go:144","time":"2024-12-23T12:37:28Z","message":"Unexpected error during MessageBroker.Run"}
{"level":"info","caller":"/build/internal/app/app.go:154","time":"2024-12-23T12:37:28Z","message":"Shutting down HTTP server"}
{"level":"error","error":"http: Server closed","fn":"app.Run.httpServer.Notify","caller":"/build/internal/app/app.go:162","time":"2024-12-23T12:37:28Z"}
{"level":"error","error":"context canceled","fn":"app.Run.redisClient.Shutdown","caller":"/build/internal/app/app.go:171","time":"2024-12-23T12:37:28Z"}
{"level":"info","caller":"/build/internal/app/app.go:173","time":"2024-12-23T12:37:28Z","message":"Shutting down..."}
{"level":"info","caller":"/build/internal/app/app.go:183","time":"2024-12-23T12:37:28Z","message":"App shut down successfully."}
stream closed EOF for copilot/sc-dev-847899dd6-z8crx (sc-dev)

@Larleyt
Copy link
Author

Larleyt commented Dec 23, 2024

It looks to me (from last logs) like it can only create one client for Sarama and I need 3 (in the original code in first post you can see I use saramaCfg var 3 times). Can it be the problem? (tho, it worked with local plaintext kafka)

@dnwe
Copy link
Collaborator

dnwe commented Dec 24, 2024

something simple like this

This link is in private repo, no access.

Sorry, link fixed here

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

2 participants