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.

On Fri, Mar 3, 2017 at 10:18 AM Adam Mercer <[email protected]> wrote:

> On Wed, Mar 1, 2017 at 6:50 PM, Adam Mercer <[email protected]> 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
>
> --
> 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 [email protected].
> 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.
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CADWDnrmsJ7O0VSkHypLe5OUXTFOZmGt3c64T%2B%2BsBQmwVnBYLcQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to