Error when sending report

22 views
Skip to first unread message

PEB

unread,
Oct 25, 2023, 2:48:57 PM10/25/23
to Puppet Users
Hello,

When using puppet 7 (via the Debian package provided by puppetlabs) on a client, at the end of the agent call, I get an error while sending the report:

```
Notice: Applied catalog in 9.54 seconds
Error: Could not send report: undefined method `split' for :file:Symbol
```

After plenty digging, it seems that the error occurs in Psych 2.7.0, more specifically in the accept function defined in psych/visitors/yaml_tree.rb . When calling `send(@dispatch_cache[target.class], target)`, the dispatch_cache hash executes this snippet of code :

```
method = "visit_#{(klass.name || '').split('::').join('_')}"
```

The thing is, sometimes, klass is a Puppet type, eg "Puppet::Type::File". In that case, klass.name is a Symbol ("file") and not a String. Therefore "split" isn't defined and the code crashes.

Looking at the code in recent puppet releases I can't find significant changes.

My question is therefore, is it normal that send_report sends elements that provide "Puppet::Type" classes to outside modules? If not, why is it happening?

Happy to provide more intel and debug.

Cheers!
Reply all
Reply to author
Forward
0 new messages