theforeman / foreman_statistics

Foreman plugin to present statistics and trends
https://theforeman.org/plugins/foreman_statistics/
GNU General Public License v3.0
0 stars 6 forks source link

problem with foreman 3.1.1 #39

Closed fred-lix closed 2 years ago

fred-lix commented 2 years ago

Bonjour,

When I access the statistics, I get an "Request failed with status code 500" for some distribution stats ( OS, Architecture, Host Group, Compute Resource, Location, Organization and Environment )

Class Distribution is working in 3.1.1 ( it was not in 3.0.1)

In the production.log, I have some warning like "undefined local variable or method `logger' for #"

Thank you

Regards,

Frederic.

ezr-ondrej commented 2 years ago

Could you please try applying https://github.com/theforeman/foreman_statistics/pull/40, bump the log level to debug and see if we can get bit more data what is going on?

fred-lix commented 2 years ago

the message in the gui now "is No data available"

please find enclosed the debug logs

production.log

Thank you once again for your help

ezr-ondrej commented 2 years ago

Right, I guess I've messed up while moving the method around and this https://github.com/theforeman/foreman_statistics/pull/40/files#diff-478ab00f7c2bd4347c1666fbcb01c865597d7b322ef8a03dfb22086b233066a0R23 seems to be the culprit (the where part)

ezr-ondrej commented 2 years ago

if you could try out it would be awesome. I'd release a new version for Foreman 3.1 and 3.2

fred-lix commented 2 years ago

I have replaced count_hosts.rb and it solves the problem

I am not sure to know where to put statistics_test.rb. I have no file with this name.

I can find two statistics.rb one in /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_statistics-2.0.0/app/services/foreman_statistics but the files are really differents

Thank you for solving again a problem ;-)

ezr-ondrej commented 2 years ago

I am not sure to know where to put statistics_test.rb. I have no file with this name.

Yeah, sorry for not mentioning, that file is just automated test to cover the fix, but in production environment those files are missing completely :)