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.

IAlpacaStreamingClient Exception thrown

See original GitHub issue

Hi Guys,

Just want to give a headsup about a exception that was invoked by IAlpacaStreamingClient.OnError. This happend when I received a ITradingUpdate about a StopLossOrder I had on.

Here is the received Exception:

ERROR  21/01/2021 16:46:04,050  TradingAlgo.TradingService.Alpaca.AlpacaTradingService ==>  [7] [InitiateStream]: Alpaca TradingStream threw an Exception: Error setting value to 'TimestampUtc' on 'Alpaca.Markets.JsonTradeUpdate'.
Newtonsoft.Json.JsonSerializationException: Error setting value to 'TimestampUtc' on 'Alpaca.Markets.JsonTradeUpdate'. ---> System.NullReferenceException: De objectverwijzing is niet op een exemplaar van een object ingesteld.
   bij SetTimestampUtc(Object , Object )
   bij Newtonsoft.Json.Serialization.DynamicValueProvider.SetValue(Object target, Object value)
   --- Einde van intern uitzonderingsstackpad ---
   bij Newtonsoft.Json.Serialization.DynamicValueProvider.SetValue(Object target, Object value)
   bij Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   bij Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   bij Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   bij Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   bij Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   bij Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   bij Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
   bij Newtonsoft.Json.Linq.JToken.ToObject(Type objectType)
   bij Newtonsoft.Json.Linq.JToken.ToObject[T]()
   bij Alpaca.Markets.ActionExtensions.DeserializeAndInvoke[TApi,TJson](Action`1 eventHandler, JToken eventArg)
   bij Alpaca.Markets.AlpacaStreamingClient.handleTradeUpdate(JToken token)
   bij Alpaca.Markets.StreamingClientBase`1.<>c__DisplayClass24_0`1.<HandleMessage>b__0()
   bij Alpaca.Markets.SynchronizationQueue.processingTask()

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Ricbun16commented, Jan 28, 2021

I’ve not encountered the issue since I updated and made 50+ trades since. Seems to work great.

1reaction
Ricbun16commented, Jan 23, 2021

@OlegRa Thanks for the quick fix! Just updated to 4.0.2 and updated my code with null handeling. Will test in de coming week and let you know.

Nice work on the SDK by the way, it’s really straight forward to use!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Catching exceptions thrown by the FileSystemWatcher ...
I am trying to figure out a way to catch exceptions thrown by FileSystemWatcher these seem to happen randomly as I have noticed...
Read more >
Handle errors in ASP.NET Core
Exception -handling code. Code in exception handling pages can also throw exceptions. Production error pages should be tested thoroughly and take ...
Read more >
MetadataFileReferenceResolver, Microsoft.CodeAnalysis C# ...
<summary> /// Resolves metadata references stored in command line arguments and reports errors for those that can't be resolved.
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