CAP icon indicating copy to clipboard operation
CAP copied to clipboard

Redis stream entry with id 1732000400810-0 missing cap headers

Open zhangkeyuan opened this issue 2 years ago • 11 comments

[2024-11-19 21:02:51.692 ERR] [DotNetCore.CAP.RedisStreams.RedisConsumerClient] Redis stream entry with id 1732000400810-0 missing cap headers [2024-11-19 21:02:51.692 ERR] [DotNetCore.CAP.RedisStreams.RedisConsumerClient] Redis stream entry with id 1732000399858-0 missing cap headers [2024-11-19 21:02:51.692 ERR] [DotNetCore.CAP.Internal.ConsumerRegister] Kafka client consume error. --> System.ArgumentException: Redis stream entry with id 1732000400810-0 missing cap headers at DotNetCore.CAP.RedisStreams.RedisMessage.Create(StreamEntry streamEntry, String groupId) at DotNetCore.CAP.RedisStreams.RedisConsumerClient.<>c__DisplayClass24_0.<g__Consume|0>d.MoveNext()

使用RedisStreams 经常服务重启后会报 missing cap headers错误,清空CapSubscribe订阅的Redis Key后又恢复正常; 检查了代码都是通过ICapPublisher.PublishAsync发布的消息,理论上不应该出现没有headers的情况吧

zhangkeyuan avatar Nov 20 '24 08:11 zhangkeyuan

Could you please verify if the message in the Redis streams was created as Cap expected?

MahmoudSamir101 avatar Nov 20 '24 12:11 MahmoudSamir101

Could you please verify if the message in the Redis streams was created as Cap expected?

A_1 A_2 A_3

zhangkeyuan avatar Nov 21 '24 03:11 zhangkeyuan

@zhangkeyuan Are there reproducible steps or examples for us to see?

yang-xiaodong avatar Nov 21 '24 12:11 yang-xiaodong

@zhangkeyuan , Additionally, you may inspect the message itself on Redis using the Redis Insights tool to verify its proper creation or the recevied table.

I noticed that the stack trace contains log messages from the Kafka consumer client. May I know if you are utilizing both Kafka and Redis in your project?

MahmoudSamir101 avatar Nov 21 '24 13:11 MahmoudSamir101

@zhangkeyuan , Additionally, you may inspect the message itself on Redis using the Redis Insights tool to verify its proper creation or the recevied table.

I noticed that the stack trace contains log messages from the Kafka consumer client. May I know if you are utilizing both Kafka and Redis in your project?

Sorry, it is an occasional error and there is currently no way to reproduce it Only using Redis

zhangkeyuan avatar Nov 22 '24 00:11 zhangkeyuan

@zhangkeyuan , Additionally, you may inspect the message itself on Redis using the Redis Insights tool to verify its proper creation or the recevied table. I noticed that the stack trace contains log messages from the Kafka consumer client. May I know if you are utilizing both Kafka and Redis in your project?

Sorry, it is an occasional error and there is currently no way to reproduce it Only using Redis

1A 1B

zhangkeyuan avatar Nov 22 '24 01:11 zhangkeyuan

@zhangkeyuan , Additionally, you may inspect the message itself on Redis using the Redis Insights tool to verify its proper creation or the recevied table.

I noticed that the stack trace contains log messages from the Kafka consumer client. May I know if you are utilizing both Kafka and Redis in your project?

Sorry, it is an occasional error and there is currently no way to reproduce it Only using Redis

One of the reasons I can think of now for that issue is that the entry was created not by Cap. So we won't be sure about that unless you can check it directly on Redis streams using a client GUI tool like Redis Insights. Also, to make things clearer, we can add more info to our logs for these cases by logging the Redis value of that entry when errors happen.

MahmoudSamir101 avatar Nov 22 '24 11:11 MahmoudSamir101

@zhangkeyuan , Additionally, you may inspect the message itself on Redis using the Redis Insights tool to verify its proper creation or the recevied table. I noticed that the stack trace contains log messages from the Kafka consumer client. May I know if you are utilizing both Kafka and Redis in your project?

Sorry, it is an occasional error and there is currently no way to reproduce it Only using Redis

1A 1B

This needs to be updated with Redis Streams values to resolve any conflicts in our logs with other transports.

MahmoudSamir101 avatar Nov 22 '24 11:11 MahmoudSamir101

@zhangkeyuan , @yang-xiaodong

I'll make a PR for these changes over the weekend.

MahmoudSamir101 avatar Nov 22 '24 11:11 MahmoudSamir101

image

@MahmoudSamir101

Yes, The Pulsar, Redis Streams and Kafka used the same log type for logging, perhaps we should add a couple of generic log types.

yang-xiaodong avatar Nov 23 '24 09:11 yang-xiaodong

@zhangkeyuan, you can use the new option OnConsumeError to log the failed messages when they occur.

MahmoudSamir101 avatar Dec 02 '24 10:12 MahmoudSamir101