EasyCaching icon indicating copy to clipboard operation
EasyCaching copied to clipboard

EasyCaching.Disk - MessagePack.MessagePackSerializationException

Open Stiwa-PohG opened this issue 2 months ago • 0 comments

I use EasyCaching.Disk (v1.9.2) in a multi-threaded application. Accesses are locked. Sometimes, when accessing the stored data, the exception listed below occurs. When this happens, I use Polly (retry with wait time) – this can fix the problem, but not always. What could be the problem here?

MessagePack.MessagePackSerializationException: Failed to deserialize EasyCaching.Disk.DiskCacheValue value. ---> MessagePack.MessagePackSerializationException: Unexpected msgpack code 0 (positive fixint) encountered. at MessagePack.MessagePackReader.ThrowInvalidCode(Byte code) at MessagePack.MessagePackReader.<TryGetStringLengthInBytes>g__SlowPath|57_0(MessagePackReader& self, DecodeResult readResult, UInt32& length, Int32& tokenSize) at MessagePack.Internal.CodeGenHelpers.ReadStringSpan(MessagePackReader& reader) at MessagePack.Formatters.EasyCaching_Disk_DiskCacheValueFormatter7.Deserialize(MessagePackReader& reader, MessagePackSerializerOptions options) at MessagePack.MessagePackSerializer.Deserialize[T](MessagePackReader& reader, MessagePackSerializerOptions options) --- End of inner exception stack trace --- at MessagePack.MessagePackSerializer.Deserialize[T](MessagePackReader& reader, MessagePackSerializerOptions options) at MessagePack.MessagePackSerializer.Deserialize[T](ReadOnlyMemory`1 buffer, MessagePackSerializerOptions options, CancellationToken cancellationToken) at EasyCaching.Serialization.MessagePack.DefaultMessagePackSerializer.Deserialize[T](Byte[] bytes) at EasyCaching.Disk.DefaultDiskCachingProvider.GetDiskCacheValue(String path) at EasyCaching.Disk.DefaultDiskCachingProvider.BaseGet[T](String cacheKey) at EasyCaching.Core.EasyCachingAbstractProvider.Get[T](String cacheKey)

Stiwa-PohG avatar Nov 05 '25 08:11 Stiwa-PohG