PrintDone event: WARNING - There was an error processing one or more placeholders

What is the problem?

I am following this cookbook article. I used the Event Manager interface to enter the details, rather than editing the config.yaml file. After doing that, and restarting the server, the config.yaml file contains this:

<snip>
events:
  subscriptions:
  - command: curl -o /tmp/printDone.jpg "http://localhost:8081/?action=snapshot" &&
      mpack -s "Print of {file} finished" /tmp/printDone.jpg ian@pickworth.me.uk
    debug: false
    enabled: true
    event: PrintDone
    type: system
  - command: curl -o /tmp/printDone.jpg "http://localhost:8081/?action=snapshot" &&
      mpack -s "Print of {file} failed" /tmp/printDone.jpg ian@pickworth.me.uk
    debug: false
    enabled: true
    event: PrintFailed
    type: system
feature:
<snip>

I tested the commands from the command line, and they resulted in an email being sent correctly - with {file} in the title, obviously.

However, when the print ends, this is logged by Octoprint, and no email sent:

2022-10-04 14:14:12,811 - octoprint.util.comm - INFO - Changing monitoring state from "Printing" to "Finishing"
2022-10-04 14:14:12,824 - octoprint.printer.standard.job - INFO - Print job done - origin: local, path: Fridge_Shelf_V3_Ridge_Insets_0.6n_0.35mm_PETG_MINI_19m.gcode, owner: pi
2022-10-04 14:14:12,826 - octoprint.events - WARNING - There was an error processing one or more placeholders in the following command: curl -o /tmp/printDone.jpg "http://localhost:8081/?action=snapshot" && mpack -s "Print of {file} finished" /tmp/printDone.jpg ian@pickworth.me.uk
2022-10-04 14:14:12,883 - octoprint.util.comm - INFO - Changing monitoring state from "Finishing" to "Operational"

Unless I'm missing something, I've followed the cookbook article exactly.
Can anyone help?

What did you already try to solve it?

I looked up the message in the forums, but all examples I found are of use of curly braces for linux commands - not what is happening here.

Have you tried running in safe mode?

No - doesn't seem relevant since no plug in involved

Systeminfo Bundle

octoprint-systeminfo-20221004145743.zip (20.5 KB)

the cookbook articles are pretty old and I suspect the issue is that {file} is no longer valid placeholder. Try with {name} or {path}. You can find current payload options here: Events β€” OctoPrint master documentation you'll notice that {file} was removed in version 1.4.0.

Thanks.
The documentation for events also uses "file", this from the Example:

command: python ~/growl.py -t mygrowlserver -d "Starting {file}" -a OctoPrint -i http://raspi/Octoprint_

..and the cookbook is by Gina, so, you know, gospel.

Is there a way to fix the incorrect documentation?

You can file a PR against the OctoPrint GitHub repo to update the docs.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.