vitormhenrique / OctoPrint-Enclosure

OctoPrint Enclosure Plugin
GNU General Public License v3.0
395 stars 201 forks source link

Octoprint often gets stuck at 99% at the end of print, Enclosure probable cause #465

Closed Ohmarinus closed 2 years ago

Ohmarinus commented 2 years ago

Describe the bug

Octoprint often gets stuck at 99%, looking at the logs, the Enclosure plugin throws an error:

2022-01-06 15:42:10,981 - octoprint.plugin - ERROR - Error while calling plugin enclosure
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/plugin/__init__.py", line 271, in call_plugin
    result = getattr(plugin, method)(*args, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/__init__.py", line 1941, in wrapper
    return f(*args, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_enclosure/__init__.py", line 1803, in on_event
    file_name = os.path.basename(payload["file"])
KeyError: 'file'

To Reproduce

See above error

Can it be that the enclosure plugin is causing Octoprint to hang momentarily?

Link to original post on Octoprint forums https://community.octoprint.org/t/octoprint-often-hangs-at-99-but-print-is-always-finished/40526/3

Ohmarinus commented 2 years ago

It seems the fix is discussed here: https://github.com/vitormhenrique/OctoPrint-Enclosure/issues/339

I can confirm this fixed the issue. Thanks!