OctoPrint-PrintTimeGenius icon indicating copy to clipboard operation
OctoPrint-PrintTimeGenius copied to clipboard

Error when fetching print history in `self.onBeforeBinding`

Open Nesciosquid opened this issue 3 years ago • 6 comments

Before reporting, check if your problem is here: https://github.com/eyal0/OctoPrint-PrintTimeGenius/wiki/Common-problems

Describe the bug Looks like PTG is hitting a null reference error when fetching print history on my Octoprint instance. (I've used PTG successfully on other instances, but this is a fresh install!)

It's failing to analyze (either automatically on uploads or when selecting files manually in the plugin settings), and there's almost nothing in the log, presumably because logging is being interrupted by the NPE.

PTG_error_block

Running the same command from the Chrome console causes the same error, and printing the value passed to Octoprint.get().done() shows that the response is null.

PTG_Manual

I've included PTG and Octoprint logs, as well as a screenshot of my current PTG settings, though no amount of settings-tweaking fixed the issue.

Uninstall + clean didn't fix the issue either.

To Reproduce Steps to reproduce the behavior:

  1. Refresh page with PTG installed -- the error happens immediately on Octoprint page load.

Expected behavior PTG doesn't throw an error, and can analyze files. Secondarily, PTG should write to its log when it fails to fetch print history.

OctoPrint Version: OctoPrint: 1.5.3 (stable)

PrintTimeGenius Version (if you know): 2.2.7 (according to Plugin Manager)

If relevant, upload the PrintTimeGenius log and any problematic gcode files (you might need to rename the files). This is really important. I probably can't help you without this.

octoprint (3).log plugin_PrintTimeGenius_engine (4).log PTG_options

Nesciosquid avatar Apr 11 '21 02:04 Nesciosquid

Seems like maybe PTG is assuming that the print history has already been initialized -- maybe it behaves weirdly if you install it while a print job is actually running and it's failing to do its initial setup, or something like that?

Nesciosquid avatar Apr 11 '21 03:04 Nesciosquid

That sounds plausible, yeah. How to fix it... Hm...

eyal0 avatar Apr 11 '21 03:04 eyal0

Print just finished, so while the printer was idle, I tried:

  • Uninstall PTG (with the "clean" button)
  • Restart Octoprint
  • Install PTG
  • Restart Octoprint

Still no luck -- error immediately shows up again.

I think that means either my guess is wrong (i.e. installing while printing isn't the culprit) or whatever bad state I'm in isn't actually cleaned up when the plugin is uninstalled + cleaned.

Is there a way I can manually populate the print history, or maybe try a previous version of the plugin?

Nesciosquid avatar Apr 11 '21 06:04 Nesciosquid

Still can't get this to work. Any suggestions? :)

I could re-install Octoprint and try installing PTG as the first (and only) plugin, maybe?

Nesciosquid avatar Apr 14 '21 16:04 Nesciosquid

Want to try installing this and see if it is better?

https://github.com/eyal0/OctoPrint-PrintTimeGenius/archive/refs/heads/print_history_error.zip

eyal0 avatar Apr 14 '21 19:04 eyal0

Nope, still getting the same error. :(

On Wed, Apr 14, 2021 at 3:47 PM Eyal @.***> wrote:

Want to try installing this and see if it is better?

https://github.com/eyal0/OctoPrint-PrintTimeGenius/archive/refs/heads/print_history_error.zip

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/eyal0/OctoPrint-PrintTimeGenius/issues/249#issuecomment-819786674, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA627LD5FRKRFM4JB4Y47XTTIXWMHANCNFSM42XFFHCQ .

Nesciosquid avatar Apr 18 '21 02:04 Nesciosquid