| We noticed that under certain circumstances, catalogs with Deferred types were breaking - e.g. specifically if we used an inline_epp inside a deferred type, the file would mis-render:
--- /tmp/test.key 2022-02-02 04:34:40.045388413 -0500 |
+++ /tmp/puppet-file20220202-128374-86xb8b 2022-02-02 04:49:12.886008617 -0500 |
@@ -1 +1 @@ |
-hi |
\ No newline at end of file |
+Deferred({'name' => 'sprintf', 'arguments' => ['hi']}) |
\ No newline at end of file |
|
At the same time, running puppetserver with debug logging enabled yielded:
2022-02-02T04:49:08.814-05:00 DEBUG [qtp1187621108-381] [puppetserver] Puppet Could not render to Puppet::Network::Format[json]: source sequence is illegal/malformed utf-8 |
json/ext/GeneratorMethods.java:70:in `to_json' |
|
[snip] |
|
2022-02-02T04:49:08.866-05:00 WARN [qtp1187621108-381] [puppetserver] Puppet File[/tmp/test.key]['content'] contains a Deferred value. It will be converted to the String 'Deferred({'name' => 'sprintf', 'arguments' => ['hi']})' (file: /path/to/manifest.pp, line: 18) |
Sure enough - we had a binary file in the catalogue, which upon removal fixed both the JSON rendering error and rectified the deferred issue... This seems like a bug - somehow the rendering error was causing Deferreds to be handled badly... Thanks Nick |