Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
When using hammer command to get details about a job-invocation task, when using the organization flag, there is a 500 error thrown:
# hammer job-invocation output --id 1 --host ch1.ooo.mu --organization-id=1
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.
Without the flag, the job invocation returns normally:
# hammer job-invocation output --id 1 --host ch1.ooo.mu
PLAY [all] *********************************************************************
TASK [Gathering Facts] *********************************************************
fatal: [ch1.ooo.mu]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: Could not resolve hostname ch1.ooo.mu: Name or service not known", "unreachable": true}
PLAY RECAP *********************************************************************
ch1.ooo.mu : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
Exit status: 1
In the /var/log/foreman/production.log:
FAILED HAMMER COMMAND:
2020-11-11T00:16:49 [I|app|cdbf086d] Completed 200 OK in 188ms (Views: 34.1ms | ActiveRecord: 39.9ms)
2020-11-11T00:16:49 [I|app|971abc27] Started GET "/api/job_invocations/1/hosts/8?organization_id=1&since" for 192.168.0.24 at 2020-11-11 00:16:49 -0500
2020-11-11T00:16:49 [I|app|971abc27] Processing by Api::V2::JobInvocationsController#output as JSON
2020-11-11T00:16:49 [I|app|971abc27] Parameters: {"organization_id"=>"1", "since"=>nil, "apiv"=>"v2", "job_invocation_id"=>"1", "host_id"=>"8", "job_invocation"=>{}}
2020-11-11T00:16:49 [D|app|971abc27] Authenticated user admin against INTERNAL authentication source
2020-11-11T00:16:49 [I|app|971abc27] Authorized user admin(Admin User)
2020-11-11T00:16:49 [D|tax|971abc27] Current location set to none
2020-11-11T00:16:49 [D|tax|971abc27] Current organization set to Studio-14
2020-11-11T00:16:49 [D|tax|971abc27] Current location set to none
2020-11-11T00:16:49 [D|tax|971abc27] Current organization set to Studio-14
2020-11-11T00:16:49 [W|app|971abc27] Action failed
2020-11-11T00:16:49 [D|app|971abc27] Backtrace for 'Action failed' error (NoMethodError): undefined method `task' for #<Organization:0x00007f6e43f82f10>
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activemodel-5.2.1/lib/active_model/attribute_methods.rb:430:in `method_missing'
/opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.9.0/lib/audited/auditor.rb:99:in `method_missing'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-2.0.10.2/app/controllers/api/v2/job_invocations_controller.rb:81:in `output'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/abstract_controller/base.rb:194:in `process_action'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_controller/metal/rendering.rb:30:in `process_action'
< - - skipped - ->
/usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:140:in `accept_and_process_next_request'
/usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:108:in `main_loop'
/usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler.rb:441:in `block (3 levels) in start_threads'
/opt/theforeman/tfm/root/usr/share/gems/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2020-11-11T00:16:49 [I|app|971abc27] Rendering api/v2/errors/custom_error.json.rabl within api/v2/layouts/error_layout
2020-11-11T00:16:49 [I|app|971abc27] Rendered api/v2/errors/custom_error.json.rabl within api/v2/layouts/error_layout (0.7ms)
2020-11-11T00:16:49 [I|app|971abc27] Completed 500 Internal Server Error in 181ms (Views: 1.8ms | ActiveRecord: 31.2ms)
SUCCESSFUL HAMMER COMMAND:
2020-11-11T00:16:54 [I|app|5a6b1e37] Started GET "/api/hosts?search=name+%3D+%22ch1.ooo.mu%22&per_page=1000&page=1" for 192.168.0.24 at 2020-11-11 00:16:54 -0500
2020-11-11T00:16:54 [I|app|5a6b1e37] Processing by Api::V2::HostsController#index as JSON
2020-11-11T00:16:54 [I|app|5a6b1e37] Parameters: {"search"=>"name = \"ch1.ooo.mu\"", "per_page"=>"1000", "page"=>"1", "apiv"=>"v2", "host"=>{}}
2020-11-11T00:16:54 [I|app|5a6b1e37] Authorized user admin(Admin User)
2020-11-11T00:16:55 [I|app|5a6b1e37] Rendering api/v2/hosts/index.json.rabl within api/v2/layouts/index_layout
2020-11-11T00:16:55 [I|app|5a6b1e37] Rendered api/v2/hosts/index.json.rabl within api/v2/layouts/index_layout (38.8ms)
2020-11-11T00:16:55 [I|app|5a6b1e37] Completed 200 OK in 196ms (Views: 37.1ms | ActiveRecord: 44.0ms)
2020-11-11T00:16:55 [I|app|e086311a] Started GET "/api/job_invocations/1/hosts/8?since" for 192.168.0.24 at 2020-11-11 00:16:55 -0500
2020-11-11T00:16:55 [I|app|e086311a] Processing by Api::V2::JobInvocationsController#output as JSON
2020-11-11T00:16:55 [I|app|e086311a] Parameters: {"since"=>nil, "apiv"=>"v2", "job_invocation_id"=>"1", "host_id"=>"8", "job_invocation"=>{}}
2020-11-11T00:16:55 [I|app|e086311a] Authorized user admin(Admin User)
2020-11-11T00:16:55 [I|app|e086311a] Completed 200 OK in 195ms (Views: 0.6ms | ActiveRecord: 46.3ms)
Version-Release number of selected component (if applicable):
Satellite 6.8
How reproducible:
always
Steps to Reproduce:
1. Run a job invocation task on a host
2. Try to inspect the job invocation with hammer, while specifying an organization
3.
Actual results:
Hammer command fails with 500 internal error
Expected results:
Hammer command should succeed
Additional info:
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.11 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-2022:5498
Description of problem: When using hammer command to get details about a job-invocation task, when using the organization flag, there is a 500 error thrown: # hammer job-invocation output --id 1 --host ch1.ooo.mu --organization-id=1 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. Without the flag, the job invocation returns normally: # hammer job-invocation output --id 1 --host ch1.ooo.mu PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* fatal: [ch1.ooo.mu]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: Could not resolve hostname ch1.ooo.mu: Name or service not known", "unreachable": true} PLAY RECAP ********************************************************************* ch1.ooo.mu : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0 Exit status: 1 In the /var/log/foreman/production.log: FAILED HAMMER COMMAND: 2020-11-11T00:16:49 [I|app|cdbf086d] Completed 200 OK in 188ms (Views: 34.1ms | ActiveRecord: 39.9ms) 2020-11-11T00:16:49 [I|app|971abc27] Started GET "/api/job_invocations/1/hosts/8?organization_id=1&since" for 192.168.0.24 at 2020-11-11 00:16:49 -0500 2020-11-11T00:16:49 [I|app|971abc27] Processing by Api::V2::JobInvocationsController#output as JSON 2020-11-11T00:16:49 [I|app|971abc27] Parameters: {"organization_id"=>"1", "since"=>nil, "apiv"=>"v2", "job_invocation_id"=>"1", "host_id"=>"8", "job_invocation"=>{}} 2020-11-11T00:16:49 [D|app|971abc27] Authenticated user admin against INTERNAL authentication source 2020-11-11T00:16:49 [I|app|971abc27] Authorized user admin(Admin User) 2020-11-11T00:16:49 [D|tax|971abc27] Current location set to none 2020-11-11T00:16:49 [D|tax|971abc27] Current organization set to Studio-14 2020-11-11T00:16:49 [D|tax|971abc27] Current location set to none 2020-11-11T00:16:49 [D|tax|971abc27] Current organization set to Studio-14 2020-11-11T00:16:49 [W|app|971abc27] Action failed 2020-11-11T00:16:49 [D|app|971abc27] Backtrace for 'Action failed' error (NoMethodError): undefined method `task' for #<Organization:0x00007f6e43f82f10> /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activemodel-5.2.1/lib/active_model/attribute_methods.rb:430:in `method_missing' /opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.9.0/lib/audited/auditor.rb:99:in `method_missing' /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-2.0.10.2/app/controllers/api/v2/job_invocations_controller.rb:81:in `output' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/abstract_controller/base.rb:194:in `process_action' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_controller/metal/rendering.rb:30:in `process_action' < - - skipped - -> /usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:140:in `accept_and_process_next_request' /usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:108:in `main_loop' /usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler.rb:441:in `block (3 levels) in start_threads' /opt/theforeman/tfm/root/usr/share/gems/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context' 2020-11-11T00:16:49 [I|app|971abc27] Rendering api/v2/errors/custom_error.json.rabl within api/v2/layouts/error_layout 2020-11-11T00:16:49 [I|app|971abc27] Rendered api/v2/errors/custom_error.json.rabl within api/v2/layouts/error_layout (0.7ms) 2020-11-11T00:16:49 [I|app|971abc27] Completed 500 Internal Server Error in 181ms (Views: 1.8ms | ActiveRecord: 31.2ms) SUCCESSFUL HAMMER COMMAND: 2020-11-11T00:16:54 [I|app|5a6b1e37] Started GET "/api/hosts?search=name+%3D+%22ch1.ooo.mu%22&per_page=1000&page=1" for 192.168.0.24 at 2020-11-11 00:16:54 -0500 2020-11-11T00:16:54 [I|app|5a6b1e37] Processing by Api::V2::HostsController#index as JSON 2020-11-11T00:16:54 [I|app|5a6b1e37] Parameters: {"search"=>"name = \"ch1.ooo.mu\"", "per_page"=>"1000", "page"=>"1", "apiv"=>"v2", "host"=>{}} 2020-11-11T00:16:54 [I|app|5a6b1e37] Authorized user admin(Admin User) 2020-11-11T00:16:55 [I|app|5a6b1e37] Rendering api/v2/hosts/index.json.rabl within api/v2/layouts/index_layout 2020-11-11T00:16:55 [I|app|5a6b1e37] Rendered api/v2/hosts/index.json.rabl within api/v2/layouts/index_layout (38.8ms) 2020-11-11T00:16:55 [I|app|5a6b1e37] Completed 200 OK in 196ms (Views: 37.1ms | ActiveRecord: 44.0ms) 2020-11-11T00:16:55 [I|app|e086311a] Started GET "/api/job_invocations/1/hosts/8?since" for 192.168.0.24 at 2020-11-11 00:16:55 -0500 2020-11-11T00:16:55 [I|app|e086311a] Processing by Api::V2::JobInvocationsController#output as JSON 2020-11-11T00:16:55 [I|app|e086311a] Parameters: {"since"=>nil, "apiv"=>"v2", "job_invocation_id"=>"1", "host_id"=>"8", "job_invocation"=>{}} 2020-11-11T00:16:55 [I|app|e086311a] Authorized user admin(Admin User) 2020-11-11T00:16:55 [I|app|e086311a] Completed 200 OK in 195ms (Views: 0.6ms | ActiveRecord: 46.3ms) Version-Release number of selected component (if applicable): Satellite 6.8 How reproducible: always Steps to Reproduce: 1. Run a job invocation task on a host 2. Try to inspect the job invocation with hammer, while specifying an organization 3. Actual results: Hammer command fails with 500 internal error Expected results: Hammer command should succeed Additional info: