question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unexpected character encountered while parsing value:\u0001 . Path '', line 0

See original GitHub issue
fail: Darkflame.BilibiliLiveChatRecorder.Background.LiveChatBackgroundService[0]
      Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: \u0001. Path '', line 0, position 0.
         at Newtonsoft.Json.JsonTextReader.ParseValue()
         at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
         at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
         at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
         at EasyNetQ.JsonSerializer.BytesToMessage(Type messageType, Byte[] bytes)
         at EasyNetQ.DefaultMessageSerializationStrategy.DeserializeMessage(MessageProperties properties, Byte[] body)
         at EasyNetQ.PullingConsumer`1.PullAsync(CancellationToken cancellationToken)
         at EasyNetQ.PullingConsumerExtensions.PullBatchAsync[TPullResult](IPullingConsumer`1 consumer, Int32 batchSize, CancellationToken cancellationToken)

when I pull from rabbitmq,This exception is thrown at random…

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
micdennycommented, Dec 30, 2020

~@darkflame0 in the meanwhile, if the problem is something internally on rmq client, you can try bypass this, by using different bus instance, one bus to pull, one bus to produce, I know it will create another connection and stuff, but this will give the best chance to trick the problem, but if rmq client use a static application wide pool to re-use arrays, then you will see the problem raise again.~

@Pliner just pointed me out that rmq client use ArrayPool.Shared and so it’s shared application wide. ~At this point the only way I can see right now it’s to split the application, one that pulls, one that produces.~

@Pliner also pointed me out that can happen also with only basicget operations, in a high load scenario where for instance an heartbeat could be sent before we read the basicget.body, by splitting the application you just increase your chance, your luckiness of not read an array released from other command send to rmq.

To avoid having pliner slap me again, I would silence me for a while 😂

1reaction
darkflame0commented, Nov 24, 2020

@Pliner and……I think it should be rejected automatically or throw a exception with DeliveryTag when an inner exception occurs during pull(batch) I can’t deal with them without DeliveryTag

Before I used PullingBatch and AckBatch so that lost a lot of messages

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected character encountered while parsing value
I'm using C# with Json.NET. The issue is that I always get: {"Unexpected character encountered while parsing value: e. Path '', line 0,...
Read more >
Deserialize JSON: Unexpected character encountered ...
Deserialize JSON: Unexpected character encountered while parsing value: <. Path '', line 0, position 0. My Orchestrator HTTP Request End ...
Read more >
Unexpected character encountered while parsing value ...
Trouble with Torrentleech: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
Read more >
Unexpected character encountered while parsing value ...
Hi, Unity with JsonReader from JSON.NET throws me an exception. JsonReaderException: Unexpected character encountered while parsing value: .
Read more >
Solved: Error while parsing JSON: 'Unexpected character en...
Error while parsing JSON: 'Unexpected character encountered while parsing value: A. Path '', line 0, position 0.' Need immediate help on this. Please...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found