Skip to content

ArgumentException while OutputCache is cached #55988

Open
@abratv

Description

@abratv

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

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, ReadOnlyMemory1 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

Metadata

Metadata

Assignees

Labels

area-middlewareIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresfeature-output-caching

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions