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]]) %>
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…
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)
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,
The better place for this kind of stuff is usually in a new issue on
the bug tracker 
thanks!
Ohad
···
On Fri, Sep 9, 2011 at 8:29 PM, treydock wrote:
> 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
> --------------
>
> <%= pie_chart("swap_usage" ,"Average swap usage", [["free swap
> (GB)",@swap_free],["used swap (GB)",@swap_size-@swap_free]]) %>
> |
>
>
> 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...
>
> > 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)
>
>
> > 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
>
> --
> 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.
>
>
Done, Bug #1166: Statistics - No Inventory data has been found - Foreman
···
On Sep 9, 12:52 pm, Ohad Levy wrote:
> Trey,
>
> The better place for this kind of stuff is usually in a new issue on
> the bug tracker :)
>
> thanks!
> Ohad
>
>
>
>
>
>
>
> On Fri, Sep 9, 2011 at 8:29 PM, treydock wrote:
> > 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
> > --------------
> >
> > <%= pie_chart("swap_usage" ,"Average swap usage", [["free swap
> > (GB)",@swap_free],["used swap (GB)",@swap_size-@swap_free]]) %>
> > |
>
> > 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...
>
> > > 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)
>
> > > 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
>
> > --
> > 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 athttp://groups.google.com/group/foreman-users?hl=en.