I am migrating from puppet 7 to puppet 8 by first updating servers in a staging environment (which is operating puppet version 8.1.0). While debugging hiera, I notice the following unusual behavior with the puppet lookup command.
In the production environment running puppet 7.25.0, the following two commands produce the same correct output:
[1] puppet lookup sshd::config --environment production --node 'puppet.datacenter' --explain --verbose --hiera_config=/etc/puppetlabs/code/environments/production/hiera.yaml
[2] puppet lookup sshd::config --environment production --explain --verbose --hiera_config=/etc/puppetlabs/code/environments/production/hiera.yaml
Both commands are run on the puppet master. Command [2] omits the --node option. Both commands produce the correct lookup.
In the staging environment that was generated by branching production->staging, a newly-created puppet master fails when the -node option is specified. Specifically,
[3] puppet lookup sshd::config --environment staging --node 'puppet.staging' --explain --verbose --hiera_conf
ig=/etc/puppetlabs/code/environments/staging/hiera.yaml
Error: Could not run: No facts available for target node: puppet.staging
but the following command (which omits the -node option) produces the correct lookup
[4]puppet lookup sshd::config --environment staging --explain --verbose --hiera_config=/etc/puppetlabs/code/
environments/staging/hiera.yaml
There are no warnings or other debug messages. The structure of the data directory and manifests is exactly the same. The production environment has puppetDB operating, but the staging environment was newly created and only has puppetserver.
Any suggestions on how to debug this would be appreciated.
Thank you,
Jon