On a clean puppet4 installation with CFacter, facter -p runs fine. When I run it against my existing puppet infrastructure, I get : 2017-10-03 11:33:47.023229 WARN puppetlabs.facter - Could not initialize locale, even with LC_* variables cleared. Continuing without localization support 2017-10-03 11:33:50.301838 FATAL puppetlabs.facter - unhandled exception: cxxrt::bad_alloc Deleting all my custom facts, solves the issue. But then if I do: export LC_CTYPE=en_US.UTF-8 and rerun facter -p, the command goes through and all my facts are reported correctly. Running only facter executes correctly. Attaching gdb with : (gdb) b 'std::bad_alloc::bad_alloc()' Function "std::bad_alloc::bad_alloc()" not defined. Make breakpoint pending on future shared library load? (y or [n]) n (gdb) run -p [New Thread 808216f00 (LWP 101455/ruby-timer-thr)] 2017-10-03 11:40:41.899334 FATAL puppetlabs.facter - unhandled exception: cxxrt::bad_alloc
I believe this is related to a locale issue, for which a patch has just been committed. Please test the new version of puppet4 and let me know if this is still a problem. I'll leave this ticket open for the moment, as this looks different than the other reports we had about the locale issue.
I guess it's a duplicate of bug 222125 regarding running Puppet in non-UTF-8 env. *** This bug has been marked as a duplicate of bug 222125 ***