YAML data from /usr/bin/foreman-node failed to parse

Anytime a salt-call or remote salt script is ran, and the minion checks in to the master, I get the following error:

2024-01-29 14:12:25,127 [salt.loaded.int.pillar.puppet:27  ][CRITICAL][740617] YAML data from /usr/bin/foreman-node failed to parse
2024-01-29 14:12:26,475 [salt.state       :321 ][ERROR   ][740500] No changes made for test-event/custom/event
2024-01-29 14:12:28,316 [salt.loaded.int.pillar.puppet:27  ][CRITICAL][740606] YAML data from /usr/bin/foreman-node failed to parse

Expected outcome:
No critical errors, yaml parses correctly.

Foreman and Proxy versions:
Foreman - 3.9.1
Proxy - 3.8.0

Foreman and Proxy plugin versions:

Distribution and version:

[root@10-222-76-237 jsparrow]# cat /etc/*re
cat: '/etc/*re': No such file or directory
[root@10-222-76-237 jsparrow]# cat /etc/*release
AlmaLinux release 8.9 (Midnight Oncilla)
AlmaLinux release 8.9 (Midnight Oncilla)
VERSION="8.9 (Midnight Oncilla)"
ID_LIKE="rhel centos fedora"
PRETTY_NAME="AlmaLinux 8.9 (Midnight Oncilla)"

AlmaLinux release 8.9 (Midnight Oncilla)
AlmaLinux release 8.9 (Midnight Oncilla)

Nothing eh?

bump. Im still looking for a solution to this. Hoping someone has hit this before.

The major issue here is that because of this, parameters are not available from foreman/salt enc into pillar data.

Still am not able to figure out what the issue is here.

I should note, when running /usr/bin/foreman-node <minion> I do indeed see the parameter. I am just not sure how I actually use it within Salt as the docs are severely lacking.
While calling salt <minion> pillar.items I see in the salt master logs: 2024-02-23 15:18:11,445 [salt.loaded.int.pillar.puppet:27 ][CRITICAL][1169831] YAML data from /usr/bin/foreman-node failed to parse

The solution to this is to use salt.pillar.foreman - I have no idea why Foreman themselves are not suggesting to use this. It took 15 mins to setup and works out of the box, vs. the puppet ext_pillar.

Nevermind. This only somewhat works. It doesnt provide the salt information like: salt_env, salt_master or salt_states. Back to the drawing board. The issue is the data provided by /usr/bin/foreman-node is not valid yaml. Something is wrong with the script.

Solution: Im an idiot. I had edited the foreman-node script many weeks back, with additional puts in it to see what it was doing. I didnt realize that the ext_pillar system for salt/puppet was literally reading the exact output of the script. I changed the file back, and all works now. But hey, I sure learned a lot!

1 Like