Open samhilluk opened 1 year ago
Also getting the following on win x64
Retrieving all devices... Unhandled exception. System.Text.Json.JsonException: The JSON value could not be converted to System.Nullable1[System.Int32]. Path: $.doorbots[0].battery_life | LineNumber: 0 | BytePositionInLine: 173. ---> System.InvalidOperationException: Cannot get the value of a token type 'String' as a number. at System.Text.Json.Utf8JsonReader.TryGetInt32(Int32& ) at System.Text.Json.Utf8JsonReader.GetInt32() at System.Text.Json.Serialization.Converters.Int32Converter.Read(Utf8JsonReader& , Type , JsonSerializerOptions ) at System.Text.Json.Serialization.Converters.NullableConverter
1.Read(Utf8JsonReader& , Type , JsonSerializerOptions )
at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.ReadJsonAndSetMember(Object , ReadStack& , Utf8JsonReader& ) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter
1.OnTryRead(Utf8JsonReader& , Type , JsonSerializerOptions , ReadStack& , T& )
at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& , Type , JsonSerializerOptions , ReadStack& , T& ) at System.Text.Json.Serialization.JsonCollectionConverter
2.OnTryRead(Utf8JsonReader& , Type , JsonSerializerOptions , ReadStack& , TCollection& )
at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& , Type , JsonSerializerOptions , ReadStack& , T& ) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo
1.ReadJsonAndSetMember(Object , ReadStack& , Utf8JsonReader& )
at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryRead(Utf8JsonReader& , Type , JsonSerializerOptions , ReadStack& , T& ) at System.Text.Json.Serialization.JsonConverter
1.TryRead(Utf8JsonReader& , Type , JsonSerializerOptions , ReadStack& , T& )
at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& , JsonSerializerOptions , ReadStack& ) --- End of inner exception stack trace --- at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& , Utf8JsonReader& , Exception ) at System.Text.Json.Serialization.JsonConverter
1.ReadCore(Utf8JsonReader& , JsonSerializerOptions , ReadStack& )
at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 , JsonTypeInfo , Nullable
1 )
at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 , JsonTypeInfo )
at System.Text.Json.JsonSerializer.Deserialize[TValue](String , JsonSerializerOptions )
at KoenZomers.Ring.Api.Session.GetRingDevices()
at KoenZomers.Ring.SnapshotDownload.Program.Main(String[] args)
at KoenZomers.Ring.SnapshotDownload.Program.
Bit late, but if you're still interested in this, can you try it again with the latest version and see if it works well now?
Bit late, but if you're still interested in this, can you try it again with the latest version and see if it works well now?
Thanks for the update, on version 1.3
I'm getting the following;
PS C:\Users\Craig\Downloads\Ring> .\ring -list
Ring Snapshot Download Tool v1.3.0.0 by Koen Zomers
Using settings from C:\Users\Craig\Downloads\Ring\Settings.json
Connecting to Ring services
Authenticating using refresh token from previous session
Retrieving all devices... Unhandled exception. System.Text.Json.JsonException: The JSON value could not be converted to System.Nullable1[System.Int64]. Path: $.stickup_cams[0].battery_life | LineNumber: 0 | BytePositionInLine: 10358. ---> System.InvalidOperationException: Cannot get the value of a token type 'String' as a number. at System.Text.Json.Utf8JsonReader.TryGetInt64(Int64& value) at System.Text.Json.Utf8JsonReader.GetInt64() at System.Text.Json.Serialization.Converters.Int64Converter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options) at System.Text.Json.Serialization.Converters.NullableConverter
1.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter
1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.JsonCollectionConverter
2.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TCollection& value)
at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo
1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)
at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.JsonConverter
1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) --- End of inner exception stack trace --- at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, Utf8JsonReader& reader, Exception ex) at System.Text.Json.Serialization.JsonConverter
1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 utf8Json, JsonTypeInfo jsonTypeInfo, Nullable
1 actualByteCount)
at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 json, JsonTypeInfo jsonTypeInfo)
at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
at KoenZomers.Ring.Api.Session.GetRingDevices()
at KoenZomers.Ring.SnapshotDownload.Program.Main(String[] args)
at KoenZomers.Ring.SnapshotDownload.Program.
GPT4 says; It looks like the application encountered an exception while trying to parse the JSON response from the Ring API. The error message indicates that it was expecting to find a numeric value (a nullable int64, to be precise) at the path $.stickup_cams[0].battery_life in the JSON, but it found a string value instead.
Sorry I'm a novice at this. I tried loading up in visual basic, but I couldn't find the relevant part of the code.
I ran some tests and I think I have found the reason why it fails. Still running some tests. Will include it in the next release.
Give it a try with 2.0.0.0 and see if it works now for you.
Had this Json exeption today with 1.3, when doing a list after adding a spotlight cam, used 2.1.0.0 just for list and it worked fine. Due to my issue with authentification see my thread I'm using 1.3 for receiving the jpgs.
Ok, now getting json exception with all verions starting 1.3 through 2.1.0.0:
sing settings from /home/pi/Ring/New/Settings.json
Connecting to Ring services
Authenticating using refresh token from previous session
Unhandled exception. System.Text.Json.JsonException: '<' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
---> System.Text.Json.JsonReaderException: '<' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0.
at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan1 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.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan
1 utf8Json, JsonTypeInfo jsonTypeInfo, Nullable1 actualByteCount) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan
1 json, JsonTypeInfo jsonTypeInfo)
at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
at KoenZomers.Ring.Api.Session.RefreshSession(String refreshToken)
at KoenZomers.Ring.Api.Session.GetSessionByRefreshToken(String refreshToken)
at KoenZomers.Ring.SnapshotDownload.Program.Main(String[] args)
at KoenZomers.Ring.SnapshotDownload.Program.
Is there going to be another update? Seemed that all stopped working on March 8th in the morning...
Describe the bug Running on Linux ARM with -list action getting the following error:
Connecting to Ring services Authenticating using refresh token from previous session Retrieving all devices... Unhandled exception. System.Text.Json.JsonException: The JSON value could not be converted to System.Nullable(String[] args)
Aborted
1[System.Int32]. Path: $.doorbots[0].battery_life | LineNumber: 0 | BytePositionInLine: 173. ---> System.InvalidOperationException: Cannot get the value of a token type 'String' as a number. at System.Text.Json.Utf8JsonReader.TryGetInt32(Int32& ) at System.Text.Json.Utf8JsonReader.GetInt32() at System.Text.Json.Serialization.Converters.Int32Converter.Read(Utf8JsonReader& , Type , JsonSerializerOptions ) at System.Text.Json.Serialization.Converters.NullableConverter
1.Read(Utf8JsonReader& , Type , JsonSerializerOptions ) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.ReadJsonAndSetMember(Object , ReadStack& , Utf8JsonReader& ) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter
1.OnTryRead(Utf8JsonReader& , Type , JsonSerializerOptions , ReadStack& , T& ) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& , Type , JsonSerializerOptions , ReadStack& , T& ) at System.Text.Json.Serialization.JsonCollectionConverter
2.OnTryRead(Utf8JsonReader& , Type , JsonSerializerOptions , ReadStack& , TCollection& ) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& , Type , JsonSerializerOptions , ReadStack& , T& ) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo
1.ReadJsonAndSetMember(Object , ReadStack& , Utf8JsonReader& ) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryRead(Utf8JsonReader& , Type , JsonSerializerOptions , ReadStack& , T& ) at System.Text.Json.Serialization.JsonConverter
1.TryRead(Utf8JsonReader& , Type , JsonSerializerOptions , ReadStack& , T& ) at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& , JsonSerializerOptions , ReadStack& ) --- End of inner exception stack trace --- at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& , Utf8JsonReader& , Exception ) at System.Text.Json.Serialization.JsonConverter
1.ReadCore(Utf8JsonReader& , JsonSerializerOptions , ReadStack& ) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 , JsonTypeInfo , Nullable
1 ) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 , JsonTypeInfo ) at System.Text.Json.JsonSerializer.Deserialize[TValue](String , JsonSerializerOptions ) at KoenZomers.Ring.Api.Session.GetRingDevices() at KoenZomers.Ring.SnapshotDownload.Program.Main(String[] args) at KoenZomers.Ring.SnapshotDownload.Program.Expected behavior Error should be handled with error handling, also should output contents of JSON object if error occurs to allow for fixing of issue.
Versions (please complete the following information):