imrahil / OctoPrint-PrintHistory

Plugin for OctoPrint - saves filename, print time and filament usage for each print
GNU Affero General Public License v3.0
64 stars 64 forks source link

printhistory failing with AttributeError: 'NoneType' object has no attribute 'parse' #48

Closed pdvorak57 closed 7 years ago

pdvorak57 commented 7 years ago

I installed printhistory plugin on octoprint 1.3.1, and I don't have any print history information, and I am getting the following error in the logs:

2017-03-03 00:26:21,166 - octoprint.plugins.detailedprogress - INFO - Printing stopped. Detailed progress stopped. 2017-03-03 00:26:21,222 - octoprint.plugin - ERROR - Error while calling plugin printhistory Traceback (most recent call last): File "/home/pi/oprint/local/lib/python2.7/site-packages/OctoPrint-1.3.1-py2.7.egg/octoprint/plugin/init.py", line 229, in call_plugin result = getattr(plugin, method)(*args, **kwargs) File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_printhistory/init.py", line 146, in on_event return eventHandler.eventHandler(self, event, payload) File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_printhistory/eventHandler.py", line 46, in eventHandler parameters = gcode_parser.parse() File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_printhistory/parser.py", line 25, in parse parameters = self.parser_factory.parse(self.file) AttributeError: 'NoneType' object has no attribute 'parse'

imrahil commented 7 years ago

what slicer did you use for that gcode file?

pdvorak57 commented 7 years ago

cura 2.3.1 on Mac. It fails for all the prints I am doing, do you need to see the gcode?

imrahil commented 7 years ago

do you need to see the gcode?

yes, please

pdvorak57 commented 7 years ago

WDI_elf_ranger_supports.gcode.gz

danielei commented 7 years ago

I have the same problem:

2017-03-04 07:41:29,925 - octoprint.plugin - ERROR - Error while calling plugin printhistory Traceback (most recent call last): File "/home/pi/oprint/local/lib/python2.7/site-packages/OctoPrint-1.3.1-py2.7.egg/octoprint/plugin/init.py", line 229, in call_plugin result = getattr(plugin, method)(*args, **kwargs) File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_printhistory/init.py", line 146, in on_event return eventHandler.eventHandler(self, event, payload) File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_printhistory/eventHandler.py", line 46, in eventHandler parameters = gcode_parser.parse() File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_printhistory/parser.py", line 25, in parse parameters = self.parser_factory.parse(self.file) AttributeError: 'NoneType' object has no attribute 'parse'

danielei commented 7 years ago

BTW - I have this problem when using Cura 15.02.1, when I use Simplyfi3d, it's ok.

danielei commented 7 years ago

but before I installed Octoprint 1.3.1 it used to work on Cura as well.

armicron commented 7 years ago

Parser searches for Cura_SteamEngine string on the first 3 lines. Increasing this constant to 10 should help. https://github.com/imrahil/OctoPrint-PrintHistory/blob/master/octoprint_printhistory/parser.py#L49 p.s. i will check