centospuppettheforeman

Could not parse for environment production: no 'environments'


I have already installed puppet-server 3.7.5 and foreman. But when I am running this command I am getting below error.

~]# foreman-installer --foreman-db-type mysql

Error: 
/usr/lib/ruby/site_ruby/1.8/puppet/context.rb:54:in `lookup': Could not parse for environment production: no 'environments' in {:root_environment=>#<Puppet::Node::Environment:0x7fe3646d9620 @modulepath=[], @watching=true, @config_version=nil, @manifest=:no_manifest, @name=:"*root*">, :current_environment=>#<Puppet::Node::Environment:0x7fe3646d9620 @modulepath=[], @watching=true, @config_version=nil, @manifest=:no_manifest, @name=:"*root*">} at top of [[0, nil, nil]] (Puppet::Error)
    from /usr/lib/ruby/site_ruby/1.8/puppet.rb:236:in `lookup'
    from /usr/lib/ruby/site_ruby/1.8/puppet.rb:264:in `future_parser?'
    from /usr/lib/ruby/site_ruby/1.8/puppet/parser/parser_factory.rb:12:in `parser'
    from /usr/lib/ruby/site_ruby/1.8/puppet/node/environment.rb:541:in `perform_initial_import'
    from /usr/lib/ruby/site_ruby/1.8/puppet/node/environment.rb:276:in `known_resource_types'
    from /usr/lib/ruby/site_ruby/1.8/puppet/resource/type_collection_helper.rb:5:in `known_resource_types'
    from /usr/lib/ruby/site_ruby/1.8/puppet/parser/parser_support.rb:120:in `import'
    from /usr/lib/ruby/gems/1.8/gems/kafo_parsers-0.0.3/lib/kafo_parsers/puppet_module_parser.rb:38:in `initialize'
    from /usr/lib/ruby/gems/1.8/gems/kafo_parsers-0.0.3/lib/kafo_parsers/puppet_module_parser.rb:16:in `new'
    from /usr/lib/ruby/gems/1.8/gems/kafo_parsers-0.0.3/lib/kafo_parsers/puppet_module_parser.rb:16:in `parse'
    from /usr/lib/ruby/gems/1.8/gems/kafo-0.6.5/lib/kafo/puppet_module.rb:44:in `parse'
    from /usr/lib/ruby/gems/1.8/gems/kafo-0.6.5/lib/kafo/configuration.rb:84:in `modules'
    from /usr/lib/ruby/gems/1.8/gems/kafo-0.6.5/lib/kafo/configuration.rb:84:in `map'
    from /usr/lib/ruby/gems/1.8/gems/kafo-0.6.5/lib/kafo/configuration.rb:84:in `modules'
    from /usr/lib/ruby/gems/1.8/gems/kafo-0.6.5/lib/kafo/kafo_configure.rb:170:in `modules'
    from /usr/lib/ruby/gems/1.8/gems/kafo-0.6.5/lib/kafo/kafo_configure.rb:152:in `params'
    from /usr/lib/ruby/gems/1.8/gems/kafo-0.6.5/lib/kafo/kafo_configure.rb:185:in `set_parameters'
    from /usr/lib/ruby/gems/1.8/gems/kafo-0.6.5/lib/kafo/kafo_configure.rb:66:in `initialize'
    from /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:126:in `new'
    from /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:126:in `run'
    from /usr/lib/ruby/gems/1.8/gems/kafo-0.6.5/lib/kafo/kafo_configure.rb:116:in `run'
    from /usr/sbin/foreman-installer:58

Solution

  • Looks like this is a bug introduced due to some changes in the way environments work in Puppet 3.7 and is not compatible with previous version. Based on bug filed here you will need to supply arguments to foreman installer.