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

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

Error message

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

What it means

Error "Environment '%{env}', cannot find module '%{module_name}'" thrown in puppetlabs/puppet.

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)

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.