Closed egburr closed 4 years ago
From an older octoprint.log priot to the 1.4.0 update: (SMS text through twilio was successful)
2020-03-10 03:27:56,167 - octoprint.server - INFO - OctoPrint 1.3.12
2020-03-10 03:27:56,190 - octoprint.plugin.core - INFO - 18 plugin(s) registered with the system:
| Action Command Prompt Support (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/action_command_prompt
| python:
| pip: 19.3.1
| version: 2.7.16
2020-03-10 22:00:49,021 - octoprint.printer.standard.job - INFO - Print job done - origin: local, path: monsterHP_tray_0.2mm_PLA_MK3S_2h59m.gcode, owner: egburr
2020-03-10 22:00:49,224 - octoprint.util.comm - INFO - Changing monitoring state from "Finishing" to "Operational"
2020-03-10 22:00:51,252 - octoprint.plugins.tracking - INFO - Sent tracking event print_done, payload: {'origin': 'local', 'file': 'c9f8039062370471f012bd9b8a6dd87a05618acc', 'elapsed': 10784}
2020-03-10 22:00:53,149 - octoprint.plugins.smsnotifier - INFO - Print notification sent to +1XXXXXXXXXX
Before 1.4.0 update:
payload: {'origin': 'local', 'file': 'c9f8039062370471f012bd9b8a6dd87a05618acc', 'elapsed': 10784}
After 1.4.0 update:
payload: {'origin': u'local', 'file': '532dbb377e1da30167b8740fba4ef38c1df74e52', u'elapsed': 9493}
Notice the "u" in the local and elapsed keys, but not in the file key? But the error seems to be complaining about the file key. And this is what the server is sending to the plug-in if I understand it correctly.
Unfortunately, I don't know python, so don't know what this means, but it's an obvious before/after difference I can see.
The problem is actually that this plugin is using an event payload key for PrintDone
that has been marked as deprecated since 1.3.0 (as released on December 8th 2016) and was finally removed three years later in 1.4.0:
Easy fix would be to replace
filename = os.path.basename(payload["file"])
with
filename = payload["name"]
Yep, that fixes it on mine. Thanks! (had to wait for a 5 hour print that was in progress to complete before I could make the change to see)
@egburr any chance you could submit a PR with that fix? I don't use the plugin anymore, but I can review and merge a pull request if you can tell me you've tested it
I have tested it such that I successfully installed my fork with the change, ran a print, and received the text notification that it completed. I have, hopefully correctly, submitted the PR for you.
@foosel thanks so much for your help!
PR was #19; linking.
After update to OctoPrint 1.4.0, OctoPrint-Twilio fails to notify.
From octoprint.log
I suspect the cause is related to this note in the changelog: https://octoprint.org/blog/2020/03/04/new-release-candidate-1.4.0/