# Question about ea7: Test server panic

**URL:** <https://forum.codecrafters.io/t/question-about-ea7-test-server-panic/3914>\
**Category:** Bug Reports\
**Tags:** challenge:kafka\
**Created:** [January 3, 2025, 5:11am UTC](https://forum.codecrafters.io/t/question-about-ea7-test-server-panic/3914 "2025-01-03T05:11:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![harveysanders](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/harveysanders/32/279_2.png) [@harveysanders](https://forum.codecrafters.io/u/harveysanders)\
**Post date:** [January 3, 2025, 5:11am UTC](https://forum.codecrafters.io/t/question-about-ea7-test-server-panic/3914/1 "2025-01-03T05:11:03Z")

</div>

I haven’t had a chance to dig into the root cause yet, and my solution is not complete, but my current implementation is causing a panic on the tester application.  
I’m submitting this question mainly as feedback and to highlight an example of a response that causes a `panic`. It’s less about seeking help on my solution and more about contributing to the discussion. Hope this is helpful

```auto
[tester::#EA7] Sending "DescribeTopicPartitions" (version: 0) request (Correlation id: 1455906278)
[tester::#EA7] Hexdump of sent "DescribeTopicPartitions" request: 
[tester::#EA7] Idx | Hex | ASCII
[tester::#EA7] -----+-------------------------------------------------+-----------------
[tester::#EA7] 0000 | 00 00 00 23 00 4b 00 00 56 c7 5d e6 00 0c 6b 61 | ...#.K..V.]...ka
[tester::#EA7] 0010 | 66 6b 61 2d 74 65 73 74 65 72 00 02 04 62 61 72 | fka-tester...bar
[tester::#EA7] 0020 | 00 00 00 00 01 ff 00 | .......
[tester::#EA7] Hexdump of received "DescribeTopicPartitions" response: 
[tester::#EA7] Idx | Hex | ASCII
[tester::#EA7] -----+-------------------------------------------------+-----------------
[tester::#EA7] 0000 | 00 00 00 39 56 c7 5d e6 00 00 00 00 00 02 00 00 | ...9V.].........
[tester::#EA7] 0010 | 04 62 61 72 00 00 00 00 00 00 40 00 80 00 00 00 | .bar......@.....
[tester::#EA7] 0020 | 00 00 00 56 00 02 00 00 00 00 00 00 00 00 00 00 | ...V............
[tester::#EA7] 0030 | 02 02 02 02 02 00 00 00 00 00 00 ff 00 | .............
[tester::#EA7] 
[tester::#EA7] [Decoder] - .ResponseHeader
[tester::#EA7] [Decoder] - .correlation_id (1455906278)
[tester::#EA7] [Decoder] - .TAG_BUFFER
[tester::#EA7] [Decoder] - .ResponseBody
[tester::#EA7] [Decoder] - .throttle_time_ms (0)
[your_program] read 39 bytes from request
[your_program] wrote response of len 57
[tester::#EA7] [Decoder] - .topic.length (1)
[tester::#EA7] [Decoder] - .Topics[0]
[tester::#EA7] [Decoder] - .error_code (0)
[tester::#EA7] [Decoder] - .name (bar)
[tester::#EA7] [Decoder] - .topic_id (00000000-0000-4000-8000-000000000056)
[tester::#EA7] [Decoder] - .is_internal (false)
[tester::#EA7] [Decoder] - .num_partitions (1)
[tester::#EA7] [Decoder] - .Partitions[0]
[tester::#EA7] [Decoder] - .error_code (0)
[tester::#EA7] [Decoder] - .partition_index (0)
[tester::#EA7] [Decoder] - .leader_id (0)
[tester::#EA7] [Decoder] - .leader_epoch (33686018)
[tester::#EA7] [Decoder] - .replica_nodes ([0])
[tester::#EA7] [Decoder] - .isr_nodes ([])
[tester::#EA7] [Decoder] - .eligible_leader_replicas ([])
panic: runtime error: index out of range [3] with length 0

goroutine 3 [running]:
encoding/binary.bigEndian.Uint32(...)
        /opt/hostedtoolcache/go/1.22.10/x64/src/encoding/binary/binary.go:161
github.com/codecrafters-io/kafka-tester/protocol/decoder.(*RealDecoder).GetCompactInt32Array(0xc000159b08)
        /home/runner/work/kafka-tester/kafka-tester/protocol/decoder/real_decoder.go:355 +0x1ee
github.com/codecrafters-io/kafka-tester/protocol/api.(*DescribeTopicPartitionsResponsePartition).Decode(0xc0001598c8, 0xc000159b08, 0xc00011c1e0, 0x3)
        /home/runner/work/kafka-tester/kafka-tester/protocol/api/describe_topic_partitions_response.go:243 +0xb78
github.com/codecrafters-io/kafka-tester/protocol/api.(*DescribeTopicPartitionsResponseTopic).Decode(0xc0001599f8, 0xc000159b08, 0xc00011c1e0, 0x2)
        /home/runner/work/kafka-tester/kafka-tester/protocol/api/describe_topic_partitions_response.go:140 +0xb9a
github.com/codecrafters-io/kafka-tester/protocol/api.(*DescribeTopicPartitionsResponse).Decode(0xc0000a6040, 0xc000159b08, 0xc00011c1e0, 0x1)
        /home/runner/work/kafka-tester/kafka-tester/protocol/api/describe_topic_partitions_response.go:43 +0x4ba
github.com/codecrafters-io/kafka-tester/protocol/api.DecodeDescribeTopicPartitionsHeaderAndResponse({0xc0000a8000?, 0x5e6408?, 0xc00011c1e0?}, 0xc00011c1e0)
        /home/runner/work/kafka-tester/kafka-tester/protocol/api/describe_topic_partitions.go:57 +0x44e
github.com/codecrafters-io/kafka-tester/internal.testDTPartitionWithTopicAndSinglePartition(0xc000066c60)
        /home/runner/work/kafka-tester/kafka-tester/internal/stagep3.go:60 +0x5fe
github.com/codecrafters-io/tester-utils/test_runner.TestRunner.Run.func1()
        /home/runner/go/pkg/mod/github.com/codecrafters-io/tester-utils@v0.2.40/test_runner/test_runner.go:57 +0x28
created by github.com/codecrafters-io/tester-utils/test_runner.TestRunner.Run in goroutine 1
        /home/runner/go/pkg/mod/github.com/codecrafters-io/tester-utils@v0.2.40/test_runner/test_runner.go:56 +0x3d0
CodeCrafters internal error: exit status 2

```

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [January 3, 2025, 5:14am UTC](https://forum.codecrafters.io/t/question-about-ea7-test-server-panic/3914/3 "2025-01-03T05:14:00Z")

</div>

Hi @harveysanders, thanks for your feedback! We’ll investigate the issue and keep you updated on any changes.

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [July 8, 2025, 4:40pm UTC](https://forum.codecrafters.io/t/question-about-ea7-test-server-panic/3914/5 "2025-07-08T16:40:33Z")

</div>

Quick update: the issue has been fixed in [this PR](https://github.com/codecrafters-io/kafka-tester/pull/42). Let us know if you’re still running into any problems!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [July 15, 2025, 4:50pm UTC](https://forum.codecrafters.io/t/question-about-ea7-test-server-panic/3914/7 "2025-07-15T16:50:45Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
