-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config_report hook generates log warning #56
Comments
Same issue here. Foreman |
Still getting these on 2.1.1, would be nice if it could be resolved since it clutters the log file. |
Show me the whole transaction, grep request id e.g. |
In my foreman 2.1.3 install:
I only have one hook script:
|
@ehelms does this trigger something for you? I mean, we have just identified a similar problem (with the root node) and I am seeing the same warning here: "Unable to render server01.fqdn / 2020-10-19 21:39:06 UTC (ConfigReport) using RABL: Cannot find rabl template 'api/v2/configreports/show' within registered". But why it tries to find "api/v2/configreports/show" and not "api/v2/config_report"? Also the Does this connect for you with anything you were researching while working on that root JSON issue the other day? |
The source of the problem is a chunk of Foreman hooks code. The code attempts to use the show RABL template as part of the rendering output and calculates what the path should be: foreman_hooks/lib/foreman_hooks/util.rb Line 20 in 4fc1977
However, this is incorrectly calculating it and leads to the warning we see:
There is no need to
|
Thank you! Could you guys file a PR and I will happily merge the fix for the problem @ehelms analyzed. |
This fixes theforeman#56 by removing the downcase call. Because of this call the tableize function got `configreport` which then got transformed to `configreports`. Instead it should have been `config_reports`.
This still happens in 3.2.x:
The problem here seems to be triggered somehwere in https://github.com/theforeman/foreman/blob/9c94e1a062c9356cda0ee313ec867af1c9b7c31e/app/services/report_importer.rb#L164 |
I created a hook script for the 'config_report' object:
config/hooks/config_report/after_create/10-test.sh
The hook script works (check report status and sends update to our monitoring system via REST api), but in the foreman log (production.log) I get a warning for every host:
2018-06-20 07:58:49 a742dbf8 [app] [W] Unable to render lxserv1330.example.com / 2018-06-20 07:58:21 UTC (ConfigReport) using RABL: Cannot find rabl template 'api/v2/configreports/show' within registered (["/usr/share/foreman/app/views", "/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_snapshot_management-1.1.0/app/views", "/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.4/app/views", "/usr/share/foreman/app/views"]) view paths!
I also noticed that the second argument to the hook script ($2), which should be hostname, in fact is:
lxserv1330.example.com / 2018-06-20 07:58:21 UTC
(for the host in the log output above)
which seems wrong to me. As I said, the script works, I get the config report json data correctly, but the warning messages in the log is worrying.
The text was updated successfully, but these errors were encountered: