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.

'dictionary changed size during iteration' error in log_result

See original GitHub issue

I frequently see following exception in logs:

2020-09-15 23:30:11    ERROR (simplemonitor) Caught unhandled exception during main loop
Traceback (most recent call last):
  File "/root/monitor/simplemonitor/simplemonitor/simplemonitor.py", line 766, in run
    self.run_loop()
  File "/root/monitor/simplemonitor/simplemonitor/simplemonitor.py", line 735, in run_loop
    self.do_alerts()
  File "/root/monitor/simplemonitor/simplemonitor/simplemonitor.py", line 663, in do_alerts
    self.do_alert(alerter)
  File "/root/monitor/simplemonitor/simplemonitor/simplemonitor.py", line 583, in do_alert
    for (name, monitor) in host_monitors.items():
RuntimeError: dictionary changed size during iteration

also

2020-09-16 00:52:54    ERROR (simplemonitor) exception while logging remote monitors
Traceback (most recent call last):
  File "/root/monitor/simplemonitor/simplemonitor/simplemonitor.py", line 547, in log_result
    for (name, monitor) in host_monitors.items():
RuntimeError: dictionary changed size during iteration

I haven’t yet investigated issue in depth, just leaving stack traces here.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
slomkowskicommented, Sep 28, 2020

I pulled this branch on my main machine and one of the machines behind NAT The other machine behind NAT uses an old version.

For now, looks OK to me, reports from both machines are visible. Thank you!

1reaction
jamesoffcommented, Sep 24, 2020

I’m happy to do it, I should have some time this weekend to look at it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

dictionary changed size during iteration" error? - Stack Overflow
The Python "RuntimeError: dictionary changed size during iteration" occurs when we change the size of a dictionary when iterating over it. · To...
Read more >
RuntimeError: dictionary changed size during iteration
The Python "RuntimeError: dictionary changed size during iteration" occurs when we change the size of a dictionary when iterating over it. To solve...
Read more >
Filtering Dictionary In Python 3. “RuntimeError - codeburst
RuntimeError : Dictionary changed size during iteration”, Python slaps you in your face when you try to add/remove entries in dict object during...
Read more >
Dictionary Changed Size During Iteration: Its Origins and Fixes
The dictionary changed size during iteration error occurs in inaccurate executions with iterating dictionaries. Click here to learn how to get rid of...
Read more >
Runtimeerror: Dictionary Changed Size During Iteration
The runtimeerror: dictionary changed size during iteration occurs whenever you modify entries in a dictionary object during iteration.
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