Undefined method `downcase' for nil:NilClass

Hi @all,

I got the following error, anyone a clue how to fix?

rake --trace puppet:migrate:populate_hosts RAILS_ENV=production
(in /usr/share/foreman)
** Invoke puppet:migrate:populate_hosts (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute puppet:migrate:populate_hosts
rake aborted!
undefined method downcase' for nil:NilClass /usr/share/foreman/app/models/host.rb:319:inpopulateFieldsFromFacts'
/usr/share/foreman/lib/tasks/puppet.rake:36
/usr/share/foreman/vendor/rails/activerecord/lib/active_record/batches.rb:26:in
find_each' /usr/share/foreman/vendor/rails/activerecord/lib/active_record/batches.rb:26:ineach'
/usr/share/foreman/vendor/rails/activerecord/lib/active_record/batches.rb:26:in
find_each' /usr/share/foreman/vendor/rails/activerecord/lib/active_record/batches.rb:66:infind_in_batches'
/usr/share/foreman/vendor/rails/activerecord/lib/active_record/base.rb:2143:in
with_scope' /usr/share/foreman/vendor/rails/activerecord/lib/active_record/batches.rb:62:infind_in_batches'
/usr/share/foreman/vendor/rails/activerecord/lib/active_record/batches.rb:25:in
find_each' /usr/share/foreman/lib/tasks/puppet.rake:30 /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:635:incall'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:635:in execute' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:630:ineach'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:630:in execute' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:ininvoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:238:in synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:589:ininvoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:582:in invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2050:ininvoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2028:in top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2028:ineach'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2028:in top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2067:instandard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2022:in top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2000:inrun'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2067:in
standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1997:inrun'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19

Regards, Thomas

> Hi @all,
>
> I got the following error, anyone a clue how to fix?
>
> this was solved a while ago, Bug #759: populate hosts fails if the host has no mac-address - Foreman

best would probably to upgrade your foreman host, or try to apply the patch.

Ohad

··· On Wed, Jul 13, 2011 at 12:35 PM, Thomas Bendler wrote:

rake --trace puppet:migrate:populate_hosts RAILS_ENV=production
(in /usr/share/foreman)
** Invoke puppet:migrate:populate_hosts (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute puppet:migrate:populate_hosts
rake aborted!
undefined method downcase' for nil:NilClass /usr/share/foreman/app/models/host.rb:319:inpopulateFieldsFromFacts’
/usr/share/foreman/lib/tasks/puppet.rake:36
/usr/share/foreman/vendor/rails/activerecord/lib/active_record/batches.rb:26:in
find_each' /usr/share/foreman/vendor/rails/activerecord/lib/active_record/batches.rb:26:ineach’
/usr/share/foreman/vendor/rails/activerecord/lib/active_record/batches.rb:26:in
find_each' /usr/share/foreman/vendor/rails/activerecord/lib/active_record/batches.rb:66:infind_in_batches’
/usr/share/foreman/vendor/rails/activerecord/lib/active_record/base.rb:2143:in
with_scope' /usr/share/foreman/vendor/rails/activerecord/lib/active_record/batches.rb:62:infind_in_batches’
/usr/share/foreman/vendor/rails/activerecord/lib/active_record/batches.rb:25:in
find_each' /usr/share/foreman/lib/tasks/puppet.rake:30 /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:635:incall’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:635:in execute' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:630:ineach’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:630:in execute' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:ininvoke_with_call_chain’
/usr/lib/ruby/1.8/monitor.rb:238:in synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:589:ininvoke_with_call_chain’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:582:in invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2050:ininvoke_task’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2028:in top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2028:ineach’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2028:in top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2067:instandard_exception_handling’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2022:in top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2000:inrun’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2067:in
standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1997:inrun’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load’
/usr/bin/rake:19

Regards, Thomas


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.

Hi Ohad,

··· 2011/7/13 Ohad Levy

[…]
this was solved a while ago, Bug #759: populate hosts fails if the host has no mac-address - Foreman
best would probably to upgrade your foreman host, or try to apply the
patch.
[…]

thanks a lot, this explain a lot, just recognized that my foreman repository
was out of sync. Upgraded and problem is solved.

Regards, Thomas