LowellObservatory / Ultimonitor

A job/print monitor for the Ultimaker 3 Extended (or any printer supporting that style API), that takes snapshots and emails about them as well as manages statistics gathering
Mozilla Public License 2.0
1 stars 0 forks source link

Strange failure querying hotends while in progress #9

Open astrobokonon opened 1 year ago

astrobokonon commented 1 year ago

Not sure if this is just a "busy" sort of signal from the ultimaker API or something, but I am seeing more failures along these lines:

2023-06-13 18:31:02,406 INFO     Current Progress:
2023-06-13 18:31:02,406 INFO     67.66444792096257
2023-06-13 18:31:02,407 INFO     Sleeping for 30 seconds...
2023-06-13 18:31:32,954 ERROR    Traceback (most recent call last):
2023-06-13 18:31:32,954 ERROR      File "Printzini.py", line 93, in <module>
2023-06-13 18:31:32,967 ERROR    main(conffile)
2023-06-13 18:31:32,967 ERROR      File "Printzini.py", line 86, in main
2023-06-13 18:31:32,968 ERROR    squashUltiCam=squashUltiCam)
2023-06-13 18:31:32,968 ERROR      File "/home/lig/Ultimonitor/ultimonitor/monitoring.py", line 207, in monitorUltimaker
2023-06-13 18:31:32,971 ERROR    stats = printer.statusCheck(printerip)
2023-06-13 18:31:32,972 ERROR      File "/home/lig/Ultimonitor/ultimonitor/printer.py", line 234, in statusCheck
2023-06-13 18:31:32,974 ERROR    ext1temps = headinfo['extruders'][0]['hotend']['temperature']
2023-06-13 18:31:32,976 ERROR    KeyError
2023-06-13 18:31:32,977 ERROR    :
2023-06-13 18:31:32,977 ERROR    'extruders'
2023-06-13 18:31:56,861 INFO     flowState: printing
2023-06-13 18:31:56,863 INFO     /printer/state: printing
2023-06-13 18:31:56,864 INFO     /print_job/state: printing
2023-06-13 18:31:56,899 INFO     New job found!

Looking at the lines in question

https://github.com/LowellObservatory/Ultimonitor/blob/14afe43fd3bb492854f86d56df91157aed4444dc/ultimonitor/printer.py#L232-L238

I can just wrap them in a try...except block and see what comes out after that. Has happened once a day for the last 2-3 days now.

astrobokonon commented 1 year ago

A better fix it to adjust the api helper file to account for this sort of thing, but I'm curious if more stuff downstream will fail so I'm going to try this.