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 codes are missing in the list of error codes #1216

Closed
nrvnrvn opened this issue Nov 15, 2018 · 1 comment
Closed

Error codes are missing in the list of error codes #1216

nrvnrvn opened this issue Nov 15, 2018 · 1 comment

Comments

@nrvnrvn
Copy link
Contributor

nrvnrvn commented Nov 15, 2018

Versions

Please specify real version numbers or git SHAs, not just "Latest" since that changes fairly regularly.
Sarama Version: ec84346
Kafka Version: 1.1.1
Go Version: 1.11

Configuration

What configuration values are you using for Sarama and Kafka?

Logs

When filing an issue please provide logs from Sarama and Kafka if at all
possible. You can set sarama.Logger to a log.Logger to capture Sarama debug
output.

Problem Description

While implementing a simple CLI app for removing orphaned consumer groups got this message:

2018/11/15 13:46:37 Successfully initialized new client
2018/11/15 13:46:37 client/coordinator requesting coordinator for consumergroup woot from kafka:9092
2018/11/15 13:46:37 client/coordinator coordinator for consumergroup woot is #3 (10.20.5.14:9092)
2018/11/15 13:46:37 Connected to broker at 10.20.5.14:9092 (registered as #3)
&{0s map[woot:Unknown error, how did this happen? Error code = 69]}
2018/11/15 13:46:37 Closing Client

Corresponding code snippet:

	config := sarama.NewConfig()
	config.Version = sarama.V1_1_0_0
	client, err := sarama.NewClient(strings.Split(*brokerList, ","), config)
	if err != nil {
		// deal with it
	}
	defer client.Close()

	broker, err := client.Coordinator(*consumerGroupID)
	if err != nil {
		// deal with it
	}

	resp, err := broker.DeleteGroups(&sarama.DeleteGroupsRequest{Groups: []string{*consumerGroupID}})
	if err != nil {
		// deal with it
	}
	fmt.Printf("%v\n", resp)

fmt.Printf("%v\n", resp) produces the &{0s map[woot:Unknown error, how did this happen? Error code = 69]} line.
Error code 69 (GROUP_ID_NOT_FOUND ) is absent apparently.

Moreover https://kafka.apache.org/protocol#protocol_error_codes and https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol#AGuideToTheKafkaProtocol-ErrorCodes do not match. And the latter is referred to in errors.go

The suggestion is:

  1. add missing error codes
  2. make the error codes and descriptions match https://kafka.apache.org/protocol#protocol_error_codes for easier mapping between sarama's output and the official docs.
@d1egoaz
Copy link
Contributor

d1egoaz commented Aug 22, 2019

Fixed by
#1195
#1239

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

No branches or pull requests

2 participants