Print History Plugin fails after 1.3.8


#1

Hi,

Is anyone else having a problem with the Print History plugin since upgrading to 1.3.8 ? I think that's when no more history entries were added. The display of existing entries still works fine, but new prints are not being added. I have found this in the logs..

2018-04-26 20:46:51,831 - octoprint.plugin - ERROR - Error while calling plugin printhistory
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/plugin/__init__.py", line 225, 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 28, in parse
    parameters = self.parser_factory.parse(self.file)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_printhistory/parser.py", line 41, in parse
    parameters.update(self.parse_bottom(gcode_file))
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_printhistory/parser.py", line 90, in parse_bottom
    config.readfp(io.BytesIO(settings))
  File "/usr/lib/python2.7/ConfigParser.py", line 324, in readfp
    self._read(fp, filename)
  File "/usr/lib/python2.7/ConfigParser.py", line 512, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
MissingSectionHeaderError: File contains no section headers.
file: <???>, line: 1
'{"extruder_quality": ["[general]\n'

Just in case it's relevant, I'm running OctoPrint on a Pi B+, from the OctoPi image 0.14.0.

Thanks.

Jovan


#2

I'm experiencing similar behavior running the latest plugin with 1.3.9 (pip 18, ocopi 15.1, and just ran apt dist-upgrade). However the issue occurs randomly. Some prints are showing up in history, but most are not. Most of the missing prints happen to be larger/longer ones. The past 2 days I've printed 6 items, and only 2 of the smallest ones showed up. I am giving plenty of time before/after prints for any processing.

An interesting perhaps relayed fact... my filament manager plugin seems to be updating it's remaining filament values correctly after every print.

Not sure this is related, but since adding the print_time_genius plugin, the printer stats plugin stopped working. I wonder if/how the genius plugin's "enable octoprint's built in analyzer" box being unchecked is affecting things. If the history and stats plugins rely on that "built in analyzer", I imagine that the default unchecked box might lead to problems. Unfortunately I'm a total n00b with python and octoprint so I don't understand how to troubleshoot this.

related octoprint log below:

2018-07-26 20:24:11,697 - octoprint.plugin - ERROR - Error while calling plugin printhistory
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/plugin/__init__.py", line 225, 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 28, in parse
    parameters = self.parser_factory.parse(self.file)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_printhistory/parser.py", line 41, in parse
    parameters.update(self.parse_bottom(gcode_file))
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_printhistory/parser.py", line 90, in parse_bottom
    config.readfp(io.BytesIO(settings))
  File "/usr/lib/python2.7/ConfigParser.py", line 324, in readfp
    self._read(fp, filename)
  File "/usr/lib/python2.7/ConfigParser.py", line 512, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
MissingSectionHeaderError: File contains no section headers.

[edit: A few days later and 5 prints complete... the missing history issue seems to be gone for me. For the sake of completeness, I was partaking in excessive plugin experimentation. It's likely my problem was user related.


#3

It seems the print_time_genius plugin is the source for various issues.
I had this one: Blobs
In that thread are links to further information of that plugin.


#4

Quick update... there is a known bug with the print history plugin when using files sliced with newer versions of cura. The problem is cura keeps changing header formats. There are 2 commits on github (patches for parser.py) that fix the issue. Cura may make another change that breaks it, but as of now the patches work fine for me with cura 3.4.1. Note the original dev in charge of the history plugin has not responded to any commits or pr's for a while. So the patches must be done manually.

Also @Ewald_Ikemann, the print time genius did have some issues that were fixed fairly quickly by the dev and added to the current release. For my last 5 prints in a row both plugins have had zero problems.