Null pointer exception when receiving tombstone message with traceparent header using Kafka Pubsub
In what area(s)?
/area runtime
/area operator
/area placement
/area docs
/area test-and-release
/area injector
/area scheduler
/area sentry
What version of Dapr?
1.15.8 (probably all 1.15.x)
Expected Behavior
A tombstone message should be sent to an underlying service.
Actual Behavior
Null pointer is thrown when handling traceparent header.
Probable behaviour:
- because of the message is tombstone (key + null value), the
cloudEventvariable is null after deserialization https://github.com/dapr/dapr/blob/bf697b8b3105f10427b326dd2f97b168c14ea2a0/pkg/runtime/subscription/subscription.go#L177 - as a traceparent header is present, an access to the null map throws an exception https://github.com/dapr/dapr/blob/bf697b8b3105f10427b326dd2f97b168c14ea2a0/pkg/runtime/subscription/subscription.go#L199
panic: assignment to entry in nil map
goroutine 486 [running]:
[github.com/dapr/dapr/pkg/runtime/subscription.New.func1({0x6ff1750](http://github.com/dapr/dapr/pkg/runtime/subscription.New.func1(%7B0x6ff1750), 0x4000fdee10}, 0x4000bf8c80)
/home/runner/work/dapr/dapr/pkg/runtime/subscription/subscription.go:199 +0xa94
[github.com/dapr/components-contrib/pubsub/kafka.(*PubSub).Subscribe.adaptHandler.func1({0x6ff1750](http://github.com/dapr/components-contrib/pubsub/kafka.(*PubSub).Subscribe.adaptHandler.func1(%7B0x6ff1750), 0x4000fdee10}, 0x4000bf8c40)
/home/runner/go/pkg/mod/[github.com/dapr/[email protected]/pubsub/kafka/kafka.go:147](http://github.com/dapr/[email protected]/pubsub/kafka/kafka.go:147) +0xdc
[github.com/dapr/components-contrib/common/component/kafka.(*consumer).doCallback(0x4001306440](http://github.com/dapr/components-contrib/common/component/kafka.(*consumer).doCallback(0x4001306440), {0x70171c8, 0x40012233b0}, 0x40015726e0)
/home/runner/go/pkg/mod/[github.com/dapr/[email protected]/common/component/kafka/consumer.go:210](http://github.com/dapr/[email protected]/common/component/kafka/consumer.go:210) +0x2f4
[github.com/dapr/components-contrib/common/component/kafka.(*consumer).ConsumeClaim.func1()](http://github.com/dapr/components-contrib/common/component/kafka.(*consumer).ConsumeClaim.func1())
/home/runner/go/pkg/mod/[github.com/dapr/[email protected]/common/component/kafka/consumer.go:88](http://github.com/dapr/[email protected]/common/component/kafka/consumer.go:88) +0x2c
[github.com/dapr/kit/retry.NotifyRecover.func1()](http://github.com/dapr/kit/retry.NotifyRecover.func1())
/home/runner/go/pkg/mod/[github.com/dapr/[email protected]/retry/retry.go:160](http://github.com/dapr/[email protected]/retry/retry.go:160) +0x38
[github.com/cenkalti/backoff/v4.RetryNotifyWithTimer.Operation.withEmptyData.func1()](http://github.com/cenkalti/backoff/v4.RetryNotifyWithTimer.Operation.withEmptyData.func1())
/home/runner/go/pkg/mod/[github.com/cenkalti/backoff/[email protected]/retry.go:18](http://github.com/cenkalti/backoff/[email protected]/retry.go:18) +0x24
[github.com/cenkalti/backoff/v4.doRetryNotify[...](0x4001467b78](http://github.com/cenkalti/backoff/v4.doRetryNotify%5B...%5D(0x4001467b78)?, {0x6fb5998, 0x400060c0a0}, 0x4001467bd0, {0x0, 0x0?})
/home/runner/go/pkg/mod/[github.com/cenkalti/backoff/[email protected]/retry.go:88](http://github.com/cenkalti/backoff/[email protected]/retry.go:88) +0xcc
[github.com/cenkalti/backoff/v4.RetryNotifyWithTimer(0x4000a81500](http://github.com/cenkalti/backoff/v4.RetryNotifyWithTimer(0x4000a81500)?, {0x6fb5998?, 0x400060c0a0?}, 0x4001303110?, {0x0?, 0x0?})
/home/runner/go/pkg/mod/[github.com/cenkalti/backoff/[email protected]/retry.go:61](http://github.com/cenkalti/backoff/[email protected]/retry.go:61) +0x5c
[github.com/cenkalti/backoff/v4.RetryNotify(..](http://github.com/cenkalti/backoff/v4.RetryNotify(..).)
/home/runner/go/pkg/mod/[github.com/cenkalti/backoff/[email protected]/retry.go:49](http://github.com/cenkalti/backoff/[email protected]/retry.go:49)
[github.com/dapr/kit/retry.NotifyRecover(0x4001530d38](http://github.com/dapr/kit/retry.NotifyRecover(0x4001530d38)?, {0x6fb5998?, 0x400060c0a0?}, 0x0?, 0xffffa9cd7108?)
/home/runner/go/pkg/mod/[github.com/dapr/[email protected]/retry/retry.go:159](http://github.com/dapr/[email protected]/retry/retry.go:159) +0x68
[github.com/dapr/components-contrib/common/component/kafka.(*consumer).ConsumeClaim(0x4001306440](http://github.com/dapr/components-contrib/common/component/kafka.(*consumer).ConsumeClaim(0x4001306440), {0x70171c8, 0x40012233b0}, {0x7002b20, 0x40012e8d50})
/home/runner/go/pkg/mod/[github.com/dapr/[email protected]/common/component/kafka/consumer.go:87](http://github.com/dapr/[email protected]/common/component/kafka/consumer.go:87) +0x978
[github.com/IBM/sarama.(*consumerGroupSession).consume(0x40012233b0](http://github.com/IBM/sarama.(*consumerGroupSession).consume(0x40012233b0), {0x4000f9c708, 0x13}, 0x0)
/home/runner/go/pkg/mod/[github.com/!i!b!m/[email protected]/consumer_group.go:952](http://github.com/!i!b!m/[email protected]/consumer_group.go:952) +0x1d8
[github.com/IBM/sarama.newConsumerGroupSession.func2({0x4000f9c708](http://github.com/IBM/sarama.newConsumerGroupSession.func2(%7B0x4000f9c708)?, 0x4001522998?}, 0x10a9fa8?)
/home/runner/go/pkg/mod/[github.com/!i!b!m/[email protected]/consumer_group.go:877](http://github.com/!i!b!m/[email protected]/consumer_group.go:877) +0x78
created by [github.com/IBM/sarama.newConsumerGroupSession](http://github.com/IBM/sarama.newConsumerGroupSession) in goroutine 458
/home/runner/go/pkg/mod/[github.com/!i!b!m/[email protected]/consumer_group.go:869](http://github.com/!i!b!m/[email protected]/consumer_group.go:869) +0x340
Steps to Reproduce the Problem
Send and receive a tombstone message (key + null value) with the traceparent header.
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as pinned, good first issue, help wanted or triaged/resolved. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as pinned, good first issue, help wanted or triaged/resolved. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.