puppetlabs/puppet · error · Puppet::DataBinding::LookupError

Environment ' ', cannot find module

Error message

Environment '%{env}', cannot find module '%{module_name}'

What it means

ModuleDataProvider#provider_root: the module named in the module's hiera/data configuration was not found in the environment's module path, so its data root cannot be located.

Solutions

  1. Install the module into the environment's modulepath
  2. Correct the module name in the module hiera.yaml
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at lib/puppet/pops/lookup/module_data_provider.rb:86 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21). Data as JSON: /api/errors/79346dd790f05985. Report an issue: GitHub.

Appendix: source

Thrown at lib/puppet/pops/lookup/module_data_provider.rb:86

      if Puppet[:strict] == :error
        config.fail(Issues::HIERA_VERSION_3_NOT_GLOBAL, :where => 'module')
      else
        Puppet.warn_once(:hiera_v3_at_module_root, config.config_path, _('hiera.yaml version 3 found at module root was ignored'), config.config_path)
      end
      nil
    end
  end

  # Return the root of the module with the name equal to the configured module name
  #
  # @param lookup_invocation [Invocation] The current lookup invocation
  # @return [Pathname] Path to root of the module
  # @raise [Puppet::DataBinding::LookupError] if the module can not be found
  #
  def provider_root(lookup_invocation)
    env = lookup_invocation.scope.environment
    mod = env.module(module_name)
    raise Puppet::DataBinding::LookupError, _("Environment '%{env}', cannot find module '%{module_name}'") % { env: env.name, module_name: module_name } unless mod

    Pathname.new(mod.path)
  end
end
end
end

View on GitHub (pinned to e227c27540)