Facter error: empty packages.json

41 views
Skip to first unread message

Adam Mercer

unread,
Mar 2, 2017, 3:48:58 AM3/2/17
to puppet...@googlegroups.com
Hi

I've recently been using puppet-agent-1.9.2 on an Ubuntu-14.04 machine
and whenever I run puppet agent I receive the following error:

Error: Facter: error while processing
"/opt/puppetlabs/facter/facts.d/packages.json" for external facts: The
document is empty.

The file it refers to is indeed empty, apart from the above everything
seems to work correctly so I'm not too concerned but I'd like to
understand why I'm getting this error.

We have other machines running, Debian 7, Debian 8, Scientific Linux
7, and Ubuntu 16.04 and none of these exhibit this problem. Has anyone
seen something like this before ot have any suggestions on where to
start debugging this?

Cheers

Adam

Adam Mercer

unread,
Mar 3, 2017, 1:18:23 PM3/3/17
to puppet...@googlegroups.com
On Wed, Mar 1, 2017 at 6:50 PM, Adam Mercer <rame...@gmail.com> wrote:

> Error: Facter: error while processing
> "/opt/puppetlabs/facter/facts.d/packages.json" for external facts: The
> document is empty.

I have now started seeing this on both Debian 8 and Ubuntu 16.04. Any
ideas where to start debugging this?

Cheers

Adam

Branan Riley

unread,
Mar 6, 2017, 4:48:26 PM3/6/17
to puppet...@googlegroups.com
Hi Adam,

The related code in Facter is at https://github.com/puppetlabs/facter/blob/master/lib/src/facts/external/json_resolver.cc#L211-L214

It appears that the JSON library we use (RapidJSON) considers an empty file to be an error condition, and we just raise that up without introspecting it. The library provides enough information for us to detect this particular case and report it at a lower logging level than error (warning or info). The docs for the RapidJSON result type are at http://rapidjson.org/group___r_a_p_i_d_j_s_o_n___e_r_r_o_r_s.html#structrapidjson_1_1_parse_result

I've filed a ticket at https://tickets.puppetlabs.com/browse/FACT-1581 to track this. I can't speak to when we'll get around to it internally, but we will of course be happy to review a PR if you or somebody else tries to fix it before we do.



Branan Riley
Software Engineer, Puppet Inc.

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CA%2Bmfgz2EgPmddChypY38AWAMsq9XhUAGJ%3D5w_0CG--4iJRZQ6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages