-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
'0x00' is an invalid start of a value. #87036
Comments
OS info: Amazon Linux 2 | x86_64, arm64 |
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis Issue DetailsDescription
Configuration
Regression?
Other informationException:
|
Can you share the part of the json that is causing this? Ideally reduce your json file down to just the minimum necessary to still make it fail |
This is by-design, but we have an issue tracking potentially tolerating invalid data: |
Hi @danmoseley Honestly its a very very large JSON for about 3MB worth of data. Its super hard to know where the error is from. The json contains excel spreadsheet data and structure but when i paste the json in a json formatter it says the json structure is valid and the error never appears on a windows machine too |
No problem, it looks like the team knows the issue, per above. |
Description
This occurs when i try to parse very large complex json, using the JsonObject.Parse() from a file stream.
Configuration
Regression?
Not sure it did, a new feature i am working on uses large json so that's where i discovered the error
Other information
Exception:
System.Text.Json.JsonException: '0x00' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
---> System.Text.Json.JsonReaderException: '0x00' 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.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack)
--- End of inner exception stack trace ---
at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& readStack, JsonReaderException ex)
at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack)
at System.Text.Json.JsonSerializer.ReadCore(Type returnType, JsonSerializerOptions options, Utf8JsonReader& reader)
at System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options)
at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
at PowerLauncher.SettingsWatcher.OverloadSettings()
at PowerLauncher.SettingsWatcher..ctor(Settings settings)
at PowerLauncher.App.<>c__DisplayClass16_0.b__1()
at Wox.Infrastructure.Stopwatch.Normal(String message, Action action)
at PowerLauncher.App.OnStartup(Object sender, StartupEventArgs e)
at System.Windows.Application.OnStartup(StartupEventArgs e)
at System.Windows.Application.<.ctor>b__1_0(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
Seems like Newtonsoft handles such scenario correctly. But i prefer system.text.json as it is more efficient.
The text was updated successfully, but these errors were encountered: