Hi Tim,
From your trace, I can see two issues:
- it looks like your db was not migrated, try running again rake
db:migrate RAILS_ENV=production
- you have some modified files there (orig_host.rb?)
Ohad
···
On Thu, Jan 12, 2012 at 7:58 PM, Tim Lank wrote:
> Ohad,
>
> I'm now seeing the following when clicking on the Dashboard and Hosts
> menu items at the top
>
> NoMethodError
> undefined method `+' for nil:NilClass
> /usr/share/foreman/app/models/orig-host.rb:17
> /usr/share/foreman/app/controllers/dashboard_controller.rb:19:in
> `prefetch_data'
>
>
> Also I'm now seeing the following when clicking on the Statistics menu item....
>
> ActiveRecord::StatementInvalid
> Mysql::Error: Table 'puppet.hosts_puppetclasses' doesn't exist: SELECT
> count(DISTINCT `hosts`.id) AS count_all, puppetclass_id AS
> puppetclass_id FROM `hosts` LEFT OUTER JOIN `hosts_puppetclasses` ON
> `hosts_puppetclasses`.host_id = `hosts`.id LEFT OUTER JOIN
> `puppetclasses` ON `puppetclasses`.id =
> `hosts_puppetclasses`.puppetclass_id GROUP BY puppetclass_id
> /usr/share/foreman/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:227:in
> `log'
> /usr/share/foreman/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:324:in
> `execute'
> /usr/share/foreman/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:639:in
> `select'
> /usr/share/foreman/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in
> `select_all_without_query_cache'
> /usr/share/foreman/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:60:in
> `select_all'
> /usr/share/foreman/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:81:in
> `cache_sql'
> /usr/share/foreman/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:60:in
> `select_all'
> /usr/share/foreman/vendor/rails/activerecord/lib/active_record/calculations.rb:255:in
> `execute_grouped_calculation'
> /usr/share/foreman/vendor/rails/activerecord/lib/active_record/calculations.rb:132:in
> `calculate'
> /usr/share/foreman/vendor/rails/activerecord/lib/active_record/calculations.rb:130:in
> `catch'
> /usr/share/foreman/vendor/rails/activerecord/lib/active_record/calculations.rb:130:in
> `calculate'
> /usr/share/foreman/vendor/rails/activerecord/lib/active_record/calculations.rb:48:in
> `count'
> /usr/share/foreman/app/models/orig-host.rb:361:in `count_habtm'
> /usr/share/foreman/app/controllers/statistics_controller.rb:7:in `index'
>
> Any help would be appreciated. When I look in the mysql puppet
> database I don't see a tables named "hosts_puppetclasses"
>
> Thanks,
> Tim