Jira (PUP-11445) Catalogs that aren't renderable as JSON break Deferred types

8 views
Skip to first unread message

Nick Hall (Jira)

unread,
Feb 2, 2022, 5:05:01 AM2/2/22
to puppe...@googlegroups.com
Nick Hall created an issue
 
Puppet / Bug PUP-11445
Catalogs that aren't renderable as JSON break Deferred types
Issue Type: Bug Bug
Affects Versions: PUP 6.15.0
Assignee: Unassigned
Created: 2022/02/02 2:04 AM
Priority: Normal Normal
Reporter: Nick Hall

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

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo

Josh Cooper (Jira)

unread,
Feb 8, 2022, 12:07:03 AM2/8/22
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-11445
 
Re: Catalogs that aren't renderable as JSON break Deferred types

This is filed as PUP-10928, so I'm going to close this as a dup.

Reply all
Reply to author
Forward
0 new messages