Bug #27556

Uploading facts when host is in build mode does log error at info or higher

Added by Marek Hulán 11 months ago. Updated 10 months ago.

Unattended installations
Target version:
Bugzilla link:
Fixed in Releases:
Found in Releases:


Cloned from

Description of problem:
I had a problem to get facts uploaded in satellite. The request was not completed, but there is no reason written what is wrong.

[crash/LI] root@li-lc-2224:~# grep 4403a209 /var/log/foreman/production.log
2019-07-22T08:18:04 [I|app|4403a209] Processing by Api::V2::HostsController#facts as JSON
2019-07-22T08:18:04 [I|app|4403a209] Parameters: {"facts"=>"[FILTERED]", "name"=>"", "certname"=>"", "apiv"=>"v2", "host"=>{"certname"=>"", "name"=>""}}
2019-07-22T08:18:04 [I|app|4403a209] Completed 422 Unprocessable Entity in 23ms (Views: 0.3ms | ActiveRecord: 3.2ms)

Only when i enabled debug logging i was able to find the root cause (the system was in build mode and then it is not allowed):
[crash/LI] root@li-lc-2224:~# grep 2fead00e /var/log/foreman/production.log
2019-07-22T08:22:46 [I|app|2fead00e] Processing by Api::V2::HostsController#facts as JSON
2019-07-22T08:22:46 [I|app|2fead00e] Parameters: {"facts"=>"[FILTERED]", "name"=>"", "certname"=>"", "apiv"=>"v2", "host"=>{"certname"=>"", "name"=>""}}
2019-07-22T08:22:46 [D|app|2fead00e] Importer Katello::RhsmFactImporter does not implement authorized_smart_proxy_features.
2019-07-22T08:22:46 [D|app|2fead00e] Examining client certificate to extract dn and sans
2019-07-22T08:22:46 [D|app|2fead00e] Client sent certificate with subject '' and subject alt names '["", ""]'
2019-07-22T08:22:46 [D|app|2fead00e] Verifying request from ["", ""] against [""]
2019-07-22T08:22:47 [D|app|2fead00e] Body: {"message":"ERF42-9911 [Foreman::Exception]: Host is pending for Build"}
2019-07-22T08:22:47 [I|app|2fead00e] Completed 422 Unprocessable Entity in 244ms (Views: 0.6ms | ActiveRecord: 34.7ms)

Requiring debug mode to see the reason for an error is not good. It should always write the error at least at level info when returning '422 Unprocessable Entity'

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Set host to build=true
2. Upload facts
3. What the production.log at level INFO

Actual results:
No root cause why facts upload is failing

Expected results:
Root cause (host is in build mode) is written at least at level INFO

Additional info:

Associated revisions

Revision 82dc02f0 (diff)
Added by Lukas Zapletal 10 months ago

Fixes #27556 - API errors as warning or higher


#1 Updated by The Foreman Bot 11 months ago

  • Assignee set to Lukas Zapletal
  • Status changed from New to Ready For Testing
  • Pull request added

#2 Updated by The Foreman Bot 10 months ago

  • Fixed in Releases 1.24.0 added

#3 Updated by Lukas Zapletal 10 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF