fraschetti / Octoslack

OctoPrint plugin for Slack, Mattermost, Pushbullet, Pushover, Rocket.Chat, Discord, Riot/Matrix, & Microsoft Teams
MIT License
74 stars 34 forks source link

discord webhook stops working after Python 3 upgrade #128

Open sysop255 opened 2 years ago

sysop255 commented 2 years ago
2021-12-06 20:06:10,042 - octoprint.plugins.Octoslack - DEBUG - Event: Connected, NotificationEnabled: True, CommandEnabled: False, OverrideNotificationEnabledCheck: False, LastProcessedKey: Connected, LastProcessedTime: 0, MinNotificationInterval: 0, Payload: {'port': 'VIRTUAL', 'baudrate': 115200}
2021-12-06 20:06:10,043 - octoprint.plugins.Octoslack - DEBUG - Updating Event last processed time: Connected, LastProcessedKey: Connected, NewLastProcessedTime: 1638839170.043059
2021-12-06 20:06:10,046 - octoprint.plugins.Octoslack - DEBUG - Printer data: {'state': {'text': 'Operational', 'flags': {'operational': True, 'printing': False, 'cancelling': False, 'pausing': False, 'resuming': False, 'finishing': False, 'closedOrError': False, 'error': False, 'paused': False, 'ready': True, 'sdReady': True}, 'error': ''}, 'job': {'file': {'name': None, 'path': None, 'display': None, 'origin': None, 'size': None, 'date': None}, 'estimatedPrintTime': None, 'averagePrintTime': None, 'lastPrintTime': None, 'filament': None, 'user': None}, 'currentZ': None, 'progress': {'completion': None, 'filepos': None, 'printTime': None, 'printTimeLeft': None, 'printTimeLeftOrigin': None}, 'offsets': {}, 'resends': {'count': 0, 'transmitted': 5, 'ratio': 0}}
2021-12-06 20:06:10,122 - octoprint.plugins.Octoslack - ERROR - Error processing event: Connected, Error: 'ValueError' object has no attribute 'message'
  File "/home/pi/OctoPrint/venv/lib/python3.7/site-packages/octoprint_Octoslack/__init__.py", line 1627, in process_slack_event
  File "/home/pi/OctoPrint/venv/lib/python3.7/site-packages/octoprint_Octoslack/__init__.py", line 1221, in handle_event
  File "/home/pi/OctoPrint/venv/lib/python3.7/site-packages/octoprint_Octoslack/__init__.py", line 1639, in process_slack_event
2021-12-06 20:06:10,159 - octoprint.plugin - DEBUG - Calling on_event on Octoslack
2021-12-06 20:06:10,412 - octoprint.plugin - DEBUG - Calling on_event on Octoslack
fraschetti commented 1 year ago

Thanks for reporting this issue. I'll take a look as time permits.

fraschetti commented 1 year ago

Hi @sysop255 There were two issues here not specific to Discord

  1. The latest OS images have moved the command we use to fetch the RasPi temp. I've put in a fix for this that will go out in the next release. Under the current version this triggers the exception logging logic for this flow that has a bug under Python3
  2. Python3 has swapped the message attribute on exceptions to just msg. The new code (staged for the next release) will handle this properly but right now it throws another exception that prevents the entire plugin from posting messages.

For now, if you disable the Raspberry Pi temperature, that will work around this issue until the next release goes out.

Thanks for reporting this issue!