fraschetti/Octoslack

Error processing event: PrintStarted

exetico opened this issue · 3 comments

Hi,

I've just installed the plugin, and added the token, secured the right permissions, create the Slack-channel for it, and so on.

But after I started my printer, the following output showed up in the logs, and no info was sent to Slack:

2020-11-15 15:57:11,692 - octoprint.util.comm - INFO - Changing monitoring state from "Starting" to "Printing"
2020-11-15 15:57:11,742 - octoprint.plugins.Octoslack - ERROR - Error processing event: PrintStarted, Error: 'ValueError' object has no attribute 'message'
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/sarge/__init__.py", line 655, in run
    self.process = p = Popen(self.args, **self.kwargs)
  File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/opt/vc/bin/vcgencmd': '/opt/vc/bin/vcgencmd'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/mnt/dietpi_userdata/octoprint/.local/lib/python3.7/site-packages/octoprint_Octoslack/__init__.py", line 1631, in process_slack_event
    p = run("/opt/vc/bin/vcgencmd measure_temp", stdout=Capture())
  File "/usr/local/lib/python3.7/dist-packages/sarge/__init__.py", line 1462, in run
    p.run(input=input, async_=async_)
  File "/usr/local/lib/python3.7/dist-packages/sarge/__init__.py", line 1071, in run
    self.run_node(node, input=input, async_=False)
  File "/usr/local/lib/python3.7/dist-packages/sarge/__init__.py", line 1187, in run_node
    result = getattr(self, method)(node, input, async_)
  File "/usr/local/lib/python3.7/dist-packages/sarge/__init__.py", line 1333, in run_command_node
    node.cmd.run(input=input, async_=async_)
  File "/usr/local/lib/python3.7/dist-packages/sarge/__init__.py", line 658, in run
    raise ValueError('Command not found: %s' % self.args[0])
ValueError: Command not found: /opt/vc/bin/vcgencmd

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/mnt/dietpi_userdata/octoprint/.local/lib/python3.7/site-packages/octoprint_Octoslack/__init__.py", line 1225, in handle_event
    command_enabled,
  File "/mnt/dietpi_userdata/octoprint/.local/lib/python3.7/site-packages/octoprint_Octoslack/__init__.py", line 1643, in process_slack_event
    + e.message
AttributeError: 'ValueError' object has no attribute 'message'

I'm running on OctoPrint 1.4.2 with Python 3.7.3. Could it be anything related to the Python version?

Let me know if you need anything else. But I've just installed OctoPrint after updating Python, so.... There's nothing else in my installation - other than the default OctoPrint settings.

Or is it related to the vcgencmd error? My machine is a NUC, and not anything related to a Pi.

Maybe it's related to:
image
(Make sense....)

I'll try and disable it, and see how it goes. Maybe a logic for that part, could be included in the script?

Now I'm down to:

2020-11-16 06:59:51,482 - octoprint.plugins.Octoslack - ERROR - Slack API message send error: not_in_channel
Traceback (most recent call last):
  File "/mnt/dietpi_userdata/octoprint/.local/lib/python3.7/site-packages/octoprint_Octoslack/__init__.py", line 3908, in send_slack_message
    icon_emoji=slack_icon_emoji,
  File "/mnt/dietpi_userdata/octoprint/.local/lib/python3.7/site-packages/slacker/__init__.py", line 515, in post_message
    'mrkdwn': mrkdwn,
  File "/mnt/dietpi_userdata/octoprint/.local/lib/python3.7/site-packages/slacker/__init__.py", line 126, in post
    api, **kwargs
  File "/mnt/dietpi_userdata/octoprint/.local/lib/python3.7/site-packages/slacker/__init__.py", line 102, in _request
    raise Error(response.error)
slacker.Error: not_in_channel

Fixed with: /invite @octoprint

TL;DR: Maybe add a few notes about this? Maybe I just missed that in the documentation :-) (The first part with vcgencmd could be handled a bit better in the code)