Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Hi,
I got error message in log while i swear my endpoint output is cached
Any how I can find what the cause of this exception?
Moved from StackExchange/StackExchange.Redis#2732
Expected Behavior
- No exception at all
- A way to debug the exception? log the key for example
- Or simply warn, this key is null instead of throwing exception
Steps To Reproduce
- The code is nothing fancy
It is based on example https://learn.microsoft.com/en-us/aspnet/core/performance/caching/output?view=aspnetcore-8.0 - New custom policy
- VaryByQuery *
- VarByHeader Authorization
- I removed part where if there is Authorization, do not cache (which mean I do need to cache authorized request)
- I used yarp
Exceptions (if any)
System.ArgumentException: A null value is not valid in this context
at StackExchange.Redis.RedisValue.AssertNotNull() in //src/StackExchange.Redis/RedisValue.cs:line 308
at StackExchange.Redis.RedisDatabase.ScriptEvalMessage..ctor(Int32 db, CommandFlags flags, RedisCommand command, String script, Byte[] hexHash, RedisKey[] keys, RedisValue[] values) in //src/StackExchange.Redis/RedisDatabase.cs:line 4814
at StackExchange.Redis.RedisDatabase.ScriptEvalMessage..ctor(Int32 db, CommandFlags flags, RedisCommand command, String script, RedisKey[] keys, RedisValue[] values) in //src/StackExchange.Redis/RedisDatabase.cs:line 4790
at StackExchange.Redis.RedisDatabase.ScriptEvaluateAsync(String script, RedisKey[] keys, RedisValue[] values, CommandFlags flags) in //src/StackExchange.Redis/RedisDatabase.cs:line 1547
at Microsoft.AspNetCore.OutputCaching.StackExchangeRedis.RedisOutputCacheStore.Microsoft.AspNetCore.OutputCaching.IOutputCacheBufferStore.SetAsync(String key, ReadOnlySequence1 value, ReadOnlyMemory
1 tags, TimeSpan validFor, CancellationToken cancellationToken)
at Microsoft.AspNetCore.OutputCaching.OutputCacheEntryFormatter.StoreAsync(String key, OutputCacheEntry value, HashSet`1 tags, TimeSpan duration, IOutputCacheStore store, ILogger logger, CancellationToken cancellationToken)
.NET Version
8
Anything else?
No response