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

panic: runtime error: slice bounds out of range #7

Closed
whatsupbros opened this issue Mar 3, 2023 · 2 comments · Fixed by #9
Closed

panic: runtime error: slice bounds out of range #7

whatsupbros opened this issue Mar 3, 2023 · 2 comments · Fixed by #9
Assignees
Labels
bug Something isn't working

Comments

@whatsupbros
Copy link

whatsupbros commented Mar 3, 2023

When attempt to connect to the cluster and consume a topic data to analyze, getting this error all the time.

Expected Behavior

The topic data is consumed without issues, and schema IDs stats provided as the result.

Current Behavior

Getting this exception on any attempt to use the application:

$ ./schema-registry-statistics --bootstrap "<broker host>:9093" --topic "<topic name>" --group "schema-stats-client" --tls --cert /path/to/ca.cer --user "<user>" --password "<password>" --store --path "./output.json" --oldest --verbose
[sr-stats] 2023/03/03 12:30:22 Starting to consume from <topic name>
[sr-stats DEBUG] 2023/03/03 12:30:22 Initializing new client
[sr-stats DEBUG] 2023/03/03 12:30:22 ClientID is the default of 'sarama', you should consider setting it to something application-specific.
[sr-stats DEBUG] 2023/03/03 12:30:22 ClientID is the default of 'sarama', you should consider setting it to something application-specific.
[sr-stats DEBUG] 2023/03/03 12:30:22 client/metadata fetching metadata for all topics from broker <broker host>:9093
[sr-stats DEBUG] 2023/03/03 12:30:23 Completed pre-auth SASL handshake. Available mechanisms: [PLAIN]
[sr-stats DEBUG] 2023/03/03 12:30:23 SASL authentication successful with broker <broker host>:9093:4 - [0 0 0 0]
[sr-stats DEBUG] 2023/03/03 12:30:23 Connected to broker at <broker host>:9093 (unregistered)
[sr-stats DEBUG] 2023/03/03 12:30:23 client/brokers registered new broker #1 at <broker host>:9093
[sr-stats DEBUG] 2023/03/03 12:30:23 Successfully initialized new client
[sr-stats DEBUG] 2023/03/03 12:30:23 client/metadata fetching metadata for [<topic name>] from broker <broker host>:9093
[sr-stats DEBUG] 2023/03/03 12:30:23 client/coordinator requesting coordinator for schema-stats-client from <broker host>:9093
[sr-stats DEBUG] 2023/03/03 12:30:23 client/coordinator coordinator for schema-stats-client is #1 (<broker host>:9093)
[sr-stats DEBUG] 2023/03/03 12:30:23 ClientID is the default of 'sarama', you should consider setting it to something application-specific.
[sr-stats DEBUG] 2023/03/03 12:30:23 Completed pre-auth SASL handshake. Available mechanisms: [PLAIN]
[sr-stats DEBUG] 2023/03/03 12:30:23 SASL authentication successful with broker <broker host>:9093:4 - [0 0 0 0]
[sr-stats DEBUG] 2023/03/03 12:30:23 Connected to broker at <broker host>:9093 (registered as #1)
[sr-stats DEBUG] 2023/03/03 12:30:26 client/coordinator requesting coordinator for schema-stats-client from <broker host>:9093
[sr-stats DEBUG] 2023/03/03 12:30:26 client/coordinator coordinator for schema-stats-client is #1 (<broker host>:9093)
[sr-stats] 2023/03/03 12:30:26 Consumer up and running!...
[sr-stats] 2023/03/03 12:30:26 Use SIGINT to stop consuming.
[sr-stats DEBUG] 2023/03/03 12:30:26 consumer/broker/1 accumulated 10 new subscriptions
[sr-stats DEBUG] 2023/03/03 12:30:26 consumer/broker/1 added subscription to <topic name>/6
[sr-stats DEBUG] 2023/03/03 12:30:26 consumer/broker/1 added subscription to <topic name>/0
[sr-stats DEBUG] 2023/03/03 12:30:26 consumer/broker/1 added subscription to <topic name>/2
[sr-stats DEBUG] 2023/03/03 12:30:26 consumer/broker/1 added subscription to <topic name>/5
[sr-stats DEBUG] 2023/03/03 12:30:26 consumer/broker/1 added subscription to <topic name>/4
[sr-stats DEBUG] 2023/03/03 12:30:26 consumer/broker/1 added subscription to <topic name>/8
[sr-stats DEBUG] 2023/03/03 12:30:26 consumer/broker/1 added subscription to <topic name>/3
[sr-stats DEBUG] 2023/03/03 12:30:26 consumer/broker/1 added subscription to <topic name>/7
[sr-stats DEBUG] 2023/03/03 12:30:26 consumer/broker/1 added subscription to <topic name>/9
[sr-stats DEBUG] 2023/03/03 12:30:26 consumer/broker/1 added subscription to <topic name>/11
[sr-stats DEBUG] 2023/03/03 12:30:26 consumer/broker/1 accumulated 2 new subscriptions
panic: runtime error: slice bounds out of range [:5] with capacity 0

goroutine 48 [running]:
main.(*Consumer).ConsumeClaim(0xc000124420, {0x823360, 0xc000140f30}, {0x821ca8, 0xc000510240})
        /home/runner/work/schema-registry-statistics/schema-registry-statistics/main.go:109 +0x2fa
github.com/Shopify/sarama.(*consumerGroupSession).consume(0xc000140f30, {0xc0003f2630, 0x2b}, 0xb)
        /home/runner/go/pkg/mod/github.com/!shopify/sarama@v1.37.2/consumer_group.go:868 +0x26e
github.com/Shopify/sarama.newConsumerGroupSession.func2({0xc0003f2630?, 0x0?}, 0x0?)
        /home/runner/go/pkg/mod/github.com/!shopify/sarama@v1.37.2/consumer_group.go:793 +0x76
created by github.com/Shopify/sarama.newConsumerGroupSession
        /home/runner/go/pkg/mod/github.com/!shopify/sarama@v1.37.2/consumer_group.go:785 +0x4b4

Context (Environment)

SASL_PLAIN with TLS/SSL endpoint is used to connect to the Broker.
With other consumers I can read the topic data without issues.
There are 12 partitions of the topic.
There are 6 versions of schemas registered for the topic value subject in Schema Registry.

@EladLeev EladLeev self-assigned this Mar 3, 2023
@EladLeev EladLeev added the bug Something isn't working label Mar 3, 2023
@EladLeev
Copy link
Owner

EladLeev commented Mar 3, 2023

Sorry that you faced that issue, @Zza .
I'm still trying to simulate the issue raised with no success. I have tried locally and using an Aiven cluster.
I was wondering if that related to your deployment or some strange edge case
Anyway, I will try to do more tests - hopefully I'll catch that 🙏

@EladLeev EladLeev mentioned this issue Mar 5, 2023
@EladLeev
Copy link
Owner

EladLeev commented Mar 5, 2023

Hi @Zza ,
I was unable to simulate the issue, but added some locks that are supposed to solve the issue.
If the issue still occurs with the revised version, please create a new bug 🙏

Thanks for using the tool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants