Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to read the 'ContentDefinitionRecord' from the distributed cache System.Text.Json.JsonException #16414

Closed
MikeAlhayek opened this issue Jul 9, 2024 · 1 comment · Fixed by #16415
Milestone

Comments

@MikeAlhayek
Copy link
Member

Describe the bug

When enabling REDIS cache feature. I randomly get the following exception in the logs

ERROR|Failed to read the 'ContentDefinitionRecord' from the distributed cache System.Text.Json.JsonException: '0x1F' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
 ---> System.Text.Json.JsonReaderException: '0x1F' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0.
   at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan`1 bytes)
   at System.Text.Json.Utf8JsonReader.ConsumeValue(Byte marker)
   at System.Text.Json.Utf8JsonReader.ReadFirstToken(Byte first)
   at System.Text.Json.Utf8JsonReader.ReadSingleSegment()
   at System.Text.Json.Utf8JsonReader.Read()
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   --- End of inner exception stack trace ---
   at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, JsonReaderException ex)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 utf8Json, JsonTypeInfo`1 jsonTypeInfo, Nullable`1 actualByteCount)
   at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 json, JsonTypeInfo`1 jsonTypeInfo)
   at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
   at System.Text.Json.JConvert.DeserializeObject[TValue](String json, JsonSerializerOptions options)
   at OrchardCore.Documents.DefaultDocumentSerializer.DeserializeAsync[TDocument](Byte[] data)
   at OrchardCore.Documents.DocumentManager`1.GetFromDistributedCacheAsync()
   at OrchardCore.Documents.DocumentManager`1.GetInternalAsync(Boolean failover)
   at OrchardCore.Documents.DocumentManager`1.GetOrCreateImmutableAsync(Func`1 factoryAsync)    at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, JsonReaderException ex)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 utf8Json, JsonTypeInfo`1 jsonTypeInfo, Nullable`1 actualByteCount)
   at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 json, JsonTypeInfo`1 jsonTypeInfo)
   at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
   at System.Text.Json.JConvert.DeserializeObject[TValue](String json, JsonSerializerOptions options)
   at OrchardCore.Documents.DefaultDocumentSerializer.DeserializeAsync[TDocument](Byte[] data)
   at OrchardCore.Documents.DocumentManager`1.GetFromDistributedCacheAsync()
   at OrchardCore.Documents.DocumentManager`1.GetInternalAsync(Boolean failover)
   at OrchardCore.Documents.DocumentManager`1.GetOrCreateImmutableAsync(Func`1 factoryAsync)

Orchard Core version

2.0.0

To Reproduce

Steps to reproduce the behavior:

  1. Enabled REDIS cache
  2. reload couple of pages
@MikeAlhayek MikeAlhayek added this to the 2.0 milestone Jul 9, 2024
Copy link
Contributor

github-actions bot commented Jul 9, 2024

We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues).

This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants