AlexVerrico / octoprint-stats

Stats for your octoprint instance. Mirrored from https://github.com/amsbr/OctoPrint-Stats originally
14 stars 8 forks source link

[Bug] KeyError in logs #32

Closed alexiri closed 2 years ago

alexiri commented 2 years ago

Describe the bug Checking the logs, I found the following output:

2022-05-30 13:58:21,867 - octoprint.plugins.detailedprogress - INFO - Printing stopped. Detailed progress stopped.
2022-05-30 13:58:21,895 - octoprint.plugins.stats - INFO - Printer Stats - on_event
2022-05-30 13:58:21,895 - octoprint.plugin - ERROR - Error while calling plugin stats
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/plugin/__init__.py", line 273, in call_plugin
    result = getattr(plugin, method)(*args, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/__init__.py", line 1688, in wrapper
    return f(*args, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_stats/__init__.py", line 939, in on_event
    user = payload["user"]
KeyError: 'user'

Environment information: