Project

General

Profile

Actions

Bug #1166

closed

Statistics - No Inventory data has been found

Added by Trey Dockendorf over 12 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Facts
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

I'm having an issue with specific facts causing the statistics page to fail rendering. This has happened on both 0.3 and the Sept 7th nightly. This is the error I get...

"No Inventory data has been found - add some hosts and facts and try again" 

Follow the advice in a previous thread, I found in the debug output which facts were problemtic, in my case it was "swapsize" and "swapfree". By commenting out those entries I was able to get Foreman to load the statistics page...

Comments added to app/controllers/statistics_controller.rb
-------------

    #@swap_size   = FactValue.mem_average "swapsize" 
    #@swap_free   = FactValue.mem_average "swapfree" 
... 
#:model_count => @model_count, :mem_size => @mem_size, :mem_free => 
@mem_free, :swap_size => @swap_size, 
:model_count => @model_count, :mem_size => @mem_size, :mem_free => 
@mem_free, 
#:swap_free   => @swap_free, :mem_totsize => 
@mem_totsize, :mem_totfree => @mem_totfree } } 
:mem_totsize => @mem_totsize, :mem_totfree => @mem_totfree } }

Removed these lines in app/views/statistics/index.html.erb
--------------

    <td> 
      <%= pie_chart("swap_usage" ,"Average swap usage", [["free swap 
(GB)",@swap_free],["used swap (GB)",@swap_size-@swap_free]]) %> 
    </td>

Here's the error when page fails to load...

  FactValue Load (0.6ms)   SELECT value FROM 'fact_values' INNER JOIN 
'fact_names' ON 'fact_names'.id = 'fact_values'.fact_name_id WHERE 
'fact_names'.'name' = 'swapsize') ORDER BY LOWER(fact_values.value) 
Unknown string

And these are the two tables with the swap space data...

mysql> select value from fact_values inner join fact_names on fact_names.id=fact_values.fact_name_id where fact_names.name="swapsize" order by lower(fact_values.value); 
+----------+ 
| value    | 
+----------+ 
| 1.50 GB  | 
| 1.91 GB  | 
| 1.97 GB  | 
| 1.97 GB  | 
| 1.97 GB  | 
| 1.97 GB  | 
| 1.97 GB  | 
| 1.97 GB  | 
| 1.97 GB  | 
| 1.97 GB  | 
| 1.97 GB  | 
| 1.97 GB  | 
| 1.97 GB  | 
| 17.70 GB | 
| 3.84 GB  | 
| 3.84 GB  | 
| 3.91 GB  | 
| 3.91 GB  | 
| 3.91 GB  | 
| 3.91 GB  | 
| 3.91 GB  | 
| 64.00M   | 
+----------+ 
22 rows in set (0.00 sec)
mysql> select value from fact_values inner join fact_names on fact_names.id=fact_values.fact_name_id where fact_names.name="swapfree" order by lower(fact_values.value); 
+----------+ 
| value    | 
+----------+ 
| 1.50 GB  | 
| 1.85 GB  | 
| 1.86 GB  | 
| 1.91 GB  | 
| 1.95 GB  | 
| 1.96 GB  | 
| 1.97 GB  | 
| 1.97 GB  | 
| 1.97 GB  | 
| 1.97 GB  | 
| 1.97 GB  | 
| 1.97 GB  | 
| 1.97 GB  | 
| 17.69 GB | 
| 3.84 GB  | 
| 3.84 GB  | 
| 3.91 GB  | 
| 3.91 GB  | 
| 3.91 GB  | 
| 3.91 GB  | 
| 3.91 GB  | 
| 64.00M   | 
+----------+

Let me know what other data would be of use in troubleshooting this.

Thanks
- Trey

Actions

Also available in: Atom PDF