[Pkg-puppet-devel] Bug#923976: Bug#923976: Bug#923976: puppet: Reports submitte

Kienan Stewart kienan at koumbit.org
Tue Mar 12 13:50:03 GMT 2019


On Tue, Mar 12, 2019 at 10:22:52AM +0200, Apollon Oikonomopoulos wrote:
> Control: tags -1 - moreinfo + patch pending
> Control: severity -1 serious
> 
> OK, thanks for confirming this and thanks for the detailed report, it's 
> very helpful!
> 
> I'm bumping this bug to RC, as I don't think Puppet report storage 
> should break merely by installing an unrelated Ruby package.  
> Additionally this is a regression from Puppet 4.x.
> 
> So, here's what's happening:
> 
>  - Puppet 5 switched from a custom wire format (PSON) to JSON for 
>    transmitting facts and reports.
>  - There is no issue when using the ruby-json JSON library to parse 
>    reports.
>  - Some JSON libraries (Oj and JrJackson) de-serialize floats with many 
>    decimal digits - such as the timing metrics found in a Puppet agent 
>    report - as BigDecimal.
>  - When BigDecimal's are serialized again to JSON, they are serialized 
>    as Strings (and not floats), causing PuppetDB's schema validation to 
>    fail.
>  - This path is only triggered when ruby-oj and ruby-multi-json are 
>    installed, enabling Puppet to use Oj via multi-json. (JrJackson is 
>    Jruby-only, and there are provisions upstream handling BigDecimal 
>    conversion in this case).
> 
> Your patch fixes the issue, but it does so right before the report is 
> transmitted to PuppetDB. I think it's best to instruct Oj to never 
> deserialize floats as BigDecimals and avoid having to do any conversions 
> in the first place. Additionally, this will guard all other report 
> processors (e.g. store) which might want to handle metrics against 
> similar issues.
> 
> Can you test the attached patch and confirm that it works?
>

Hi,

I applied the patch (reloaded apache2 afterwards) and runs are able to store reports now.
(I did confirm before the patch was applied that the reports were not being stored).

Thanks for the great explanation, your effort and time, and the patch!

Thanks,
Kienan

> Regards,
> Apollon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-puppet-devel/attachments/20190312/eba8358a/attachment.sig>


More information about the Pkg-puppet-devel mailing list