Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hiera 5 backend failing with "Recursive lookup detected" #115

Open
tikafn opened this issue Jul 13, 2018 · 1 comment
Open

hiera 5 backend failing with "Recursive lookup detected" #115

tikafn opened this issue Jul 13, 2018 · 1 comment

Comments

@tikafn
Copy link

tikafn commented Jul 13, 2018

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!

@aptituz
Copy link

aptituz commented May 16, 2019

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.

irregulator added a commit to exoscale/puppet-puppetdbquery that referenced this issue Jun 26, 2023
Prevent recursive queries for `lookup_options`; idea stolen from
dalen#115.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants