puppet-puppetdbquery
puppet-puppetdbquery copied to clipboard
hiera 5 backend failing with "Recursive lookup detected"
Hello, I'm stuck with my hiera-puppetdb setup. All lookup requests are constantly failing in the "searching for lookup-options" sequence:
Hierarchy entry "Puppetdb Backend" Searching for "lookup_options" Recursive lookup detected in [lookup_options]
hiera.yaml:
version: 5
defaults: datadir: "/etc/puppetlabs/code/hiera/%{environment}/data"
hierarchy: - name: "Puppetdb Backend" lookup_key: puppetdb_lookup_key
Versions: Puppet 5.5.2 puppetdbquery 3.0.1 puppet-db 1.2.4 postgresql 9.6
Debug output looks good to me, no hints for any problems. Any ideas / suggestions where to look at?
Thanks in advance!
I have the same problem but I couldn't really figure out under which conditions it happens.
But the reason WHY it happens seems to be that the lookup in https://github.com/dalen/puppet-puppetdbquery/blob/master/lib/puppet/functions/puppetdb_lookup_key.rb is happening even when "lookup_options" is requested. Which causes puppet to lookup lookup_options and probably trying to lookup lookup_options implicitly again and again and again.
So the reason is probably to do something like
if key == "lookup_options"
context.not_found
end
in the function just before the lookup.