lightning
lightning copied to clipboard
Exception when History page gets a WorkOrderUpdated event
Sentry Issue: LIGHTNING-9Q
KeyError: key :id not found in: nil
If you are using the dot syntax, such as map.field, make sure the left-hand side of the dot is a map
File "lib/lightning_web/live/run_live/index.ex", line 559, in anonymous fn/3 in LightningWeb.RunLive.Index.update_workorder/2
File "lib/enum.ex", line 2528, in Enum."-reduce/3-lists^foldl/2-0-"/3
File "lib/lightning_web/live/run_live/index.ex", line 558, in LightningWeb.RunLive.Index.update_workorder/2
File "lib/lightning_web/live/run_live/index.ex", line 548, in LightningWeb.RunLive.Index.update_page/2
File "lib/lightning_web/live/run_live/index.ex", line 252, in LightningWeb.RunLive.Index.handle_info/2
...
(3 additional frame(s) were not displayed)
(KeyError key :id not found in: nil
If you are using the dot syntax, such as map.field, make sure the left-hand side of the dot is a map)
It looks like the update_workorder
private function has either an existing entry with no id, or the work order passed into update_page
doesn't have an id.
Previous discussion tracking this: https://openfn.slack.com/archives/C05KZNPEJFN/p1717670761741179
Unable to reproduce
lib/lightning_web/live/run_live/index.ex in anonymous fn/3 in LightningWeb.RunLive.Index.update_workorder/2 at line 621
lib/enum.ex in Enum."-reduce/3-lists^foldl/2-0-"/3 at line 2528
lib/lightning_web/live/run_live/index.ex in LightningWeb.RunLive.Index.update_workorder/2 at line 620
lib/lightning_web/live/run_live/index.ex in LightningWeb.RunLive.Index.update_page/2 at line 610
lib/lightning_web/live/run_live/index.ex in LightningWeb.RunLive.Index.handle_info/2 at line 263
lib/phoenix_live_view/channel.ex in Phoenix.LiveView.Channel.handle_info/2 at line 359
gen_server.erl in :gen_server.try_handle_info/3 at line 1095
gen_server.erl in :gen_server.handle_msg/6 at line 1183
@midigofrank this is the latest log from Sentry. Do you know if we can trace the line numbers?
The last logs are also from v2.9.6
@christad92 yes I can trace the line number. I know exactly where the error is coming from, I'm just unable to reproduce it. 2 months ago, I was able to reproduce it locally, but it wasn't making sense to me, check this thread: https://openfn.slack.com/archives/C05KZNPEJFN/p1717670761741179
I have some logs in there as well. We should probably get some fresh eyes to look at the logs, maybe my eyes are biased 😂