Description of problem: Disabling "logs" feature in foreman-proxy of Satellite or a Capsule, API request: /api/statuses returns 500 error. The reason is evident from source code: https://github.com/theforeman/foreman/blob/develop/app/services/ping.rb#L66 : def statuses_smart_proxies results = [] SmartProxy.all.includes(:features).map do |proxy| start = Time.now begin version = proxy.statuses[:version].version['version'] features = proxy.statuses[:version].version['modules'] failed_features = proxy.statuses[:logs].logs.failed_modules .. The proxy without logs feature has proxy.statuses without :logs :-/ The line should be like: failed_features = (proxy.statuses[:logs].nil? ? {} : proxy.statuses[:logs].logs.failed_modules) Version-Release number of selected component (if applicable): Sat6.7 How reproducible: 100% Steps to Reproduce: 1. Have an external Capsule 2. On the Capsule, disable "logs" feature: satellite-installer --scenario=capsule --foreman-proxy-logs=false 3. Check statuses API call on Satellite: curl -L -u admin:mysecret007 http://$(hostname -f)/api/statuses Actual results: { "error": {"message":"Internal Server Error: the server was unable to finish the request. This may be caused by unavailability of some required service, incorrect API call or a server-side bug. There may be more information in the server's logs."} } Expected results: {"results":{ ... (some usual output) Additional info:
Upstream bug assigned to pmoravec
The foreman-proxy "logs" feature was added in 6.4-ish release. Any newer Satellite deployment (not upgraded from that version) should have the feature enabled by default and work well. BUT any Satellite upgraded from 6.4ish version will have the feature _disabled_ by default, causing "hammer status" (that calls the API request) to fail - by default..
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/30205 has been resolved.
Fix is in Satellite 6.9 SNAP 1 with foreman-2.3.0-0.7.rc1.el7sat.noarch
Verified On Sat 6.9 snap 15.0 Disabled logging on internal and external capsules. Either way didn't cause any problems, I could access the api and get the status, this time without the "logs" feature listed, as expected.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: Satellite 6.9 Release), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2021:1313