KoenZomers/RingSnapshotDownload

[BUG] Latest osx release is failing to parse response from Ring

Closed this issue · 8 comments

prvn commented

Describe the bug
Downloaded latest osx asset to list devices on account, provided username password and 2FA and application throws exception unable to parse JSON output.

To Reproduce
Steps to reproduce the behavior:

  1. Download osx-x64.zip from https://github.com/KoenZomers/RingSnapshotDownload/releases/tag/1.2.0.0
  2. Extract and run ./RingSnapshotDownload -username $RING_USERNAME -password $RING_PASSWORD -list
  3. Provide 2FA code
  4. See error
Retrieving all devices... Unhandled exception. System.Text.Json.JsonException: The JSON value could not be converted to System.Nullable`1[System.Int64]. Path: $.stickup_cams[0].latitude | LineNumber: 0 | BytePositionInLine: 6908.
 ---> System.FormatException: Either the JSON value is not in a supported format, or is out of bounds for an Int64.
   at System.Text.Json.Utf8JsonReader.GetInt64()
   at System.Text.Json.Serialization.Converters.Int64Converter.Read(Utf8JsonReader& , Type , JsonSerializerOptions )
   at System.Text.Json.Serialization.Converters.NullableConverter`1.Read(Utf8JsonReader& , Type , JsonSerializerOptions )
   at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1.ReadJsonAndSetMember(Object , ReadStack& , Utf8JsonReader& )
   at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryRead(Utf8JsonReader& , Type , JsonSerializerOptions , ReadStack& , T& )
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& , Type , JsonSerializerOptions , ReadStack& , T& )
   at System.Text.Json.Serialization.JsonCollectionConverter`2.OnTryRead(Utf8JsonReader& , Type , JsonSerializerOptions , ReadStack& , TCollection& )
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& , Type , JsonSerializerOptions , ReadStack& , T& )
   at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1.ReadJsonAndSetMember(Object , ReadStack& , Utf8JsonReader& )
   at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryRead(Utf8JsonReader& , Type , JsonSerializerOptions , ReadStack& , T& )
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& , Type , JsonSerializerOptions , ReadStack& , T& )
   at System.Text.Json.Serialization.JsonConverter`1.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](ReadOnlySpan`1 , 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.<Main>(String[] args)

Expected behavior
Binary runs without error and lists devices on account

Screenshots
n/a

Versions (please complete the following information):

Bit late, but if you're still interested in this, could you try it again with the latest version and see if it works well now?

prvn commented

Will give it a try. Thank you!!

Will give it a try. Thank you!!

Were you able to get to work? I am having the same problem with the windows and Mac version not sure if it is something with my camera names, code, account, etc?

prvn commented

I tried, forgot to respond. I think the binary is not made for macos? I downloaded latest from https://github.com/KoenZomers/RingSnapshotDownload/releases/download/1.3.0.0/osx-x64.zip and when I run I get

./RingSnapshotDownload -username $RING_USERNAME -password $RING_PASSWORD -list
zsh: exec format error: ./RingSnapshotDownload

I checked file command and

file RingSnapshotDownload                                                                                            7s
RingSnapshotDownload: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=f5cce2e5155ed5110cfe461f857122cbe5ba8ddc, for GNU/Linux 2.6.32, stripped, too many notes (256)

I am not sure if this supposed to work on macos.

It should work, but I don't have a Mac myself, so cannot validate this. I can only instruct a version to be compiled for MacOS. The error also doesn't give me an idea what it could be I'm afraid. The parsing issue you addressed at the beginning should hopefully already be resolved in the current latest version.

Give it a try with 1.4.0.0 and see if it works now for you.

prvn commented

It didn't work, but my hunch is, the binary is not compatible with Apple Silicon, might work on older macs, but I don't have one to check, sadly.
Appreciate you looking into this though. I am not actively looking to use this right now. I had a usecase that needed this and it worked for a while and mostly achieved what I wanted to do and I am good now.