Description of problem:
When you go to run an insights playbook, you get an error "Failed to create job. Ensure your systems are registered in Foreman"
Also, when you then go to look at the job_invocation, you get an error:
undefined method `input' for nil:NilClass
Output from
`foreman-rake errors:fetch_log request_id=2c9f9828`
is attached.
Version-Release number of selected component (if applicable):
6.9.0
How reproducible:
100%
Steps to Reproduce:
1. Register a system in insights
2. Have the system have something for insights to remediate with ansible. I like to demonstrate insights functionality with smbloris, but presumably any ansible playbook for insights would work.
3. Click "Run Playbook"
Actual results:
1. Popup error: "Failed to create job. Ensure your systems are registered in Foreman"
2. Go to view the job invocation, you get " Oops, we're sorry but something went wrong undefined method `input' for nil:NilClass"
Expected results:
Playbook to correctly run and not have queued jobs.
Additional info:
Logs like
2021-04-28T09:00:23 [I|app|e8b916c2] Started POST "/api/v2/job_invocations/" for 10.10.116.137 at 2021-04-28 09:00:23 -0400
2021-04-28T09:00:23 [I|app|e8b916c2] Processing by Api::V2::JobInvocationsController#create as JSON
2021-04-28T09:00:23 [I|app|e8b916c2] Parameters: {"job_invocation"=>{"feature"=>"ansible_run_insights_plan", "host_ids"=>"plan_id=53587", "inputs"=>{"organization_id"=>1, "plan_id"=>53587}}, "apiv"=>"v2"}
2021-04-28T09:00:23 [I|aud|e8b916c2] JobInvocation (275) create event on job_category Ansible Playbook
2021-04-28T09:00:23 [I|aud|e8b916c2] JobInvocation (275) create event on description Insights maintenance plan for host
2021-04-28T09:00:23 [I|aud|e8b916c2] JobInvocation (275) create event on concurrency_level
2021-04-28T09:00:23 [I|aud|e8b916c2] JobInvocation (275) create event on time_span
2021-04-28T09:00:23 [I|aud|e8b916c2] JobInvocation (275) create event on execution_timeout_interval
2021-04-28T09:00:23 [I|aud|e8b916c2] JobInvocation (275) create event on password [redacted]
2021-04-28T09:00:23 [I|aud|e8b916c2] JobInvocation (275) create event on key_passphrase
2021-04-28T09:00:23 [I|aud|e8b916c2] JobInvocation (275) create event on remote_execution_feature_id 12
2021-04-28T09:00:23 [I|aud|e8b916c2] JobInvocation (275) create event on effective_user_password
2021-04-28T09:00:23 [I|bac|e8b916c2] Task {label: Actions::RemoteExecution::RunHostsJob, id: d2061caf-d6a7-45bf-b5a2-d540877980a9, execution_plan_id: 0d6a79cc-6e31-47b9-90c3-8a9e1bc54ce1} state changed: planning
2021-04-28T09:00:24 [E|bac|] PG::FeatureNotSupported: ERROR: cross-database references are not implemented: ansibleclient.example.com
| LINE 1: ...D "hosts"."location_id" = $3 AND (( hosts.name IN(ansiblecli...
| ^
| (ActiveRecord::StatementInvalid)
Comment 4Lukáš Hellebrandt
2021-04-29 13:01:23 UTC
I've just tried applying a remediation (a playbook) through FiFi process (create a remediation in CRC and run it from there) and I was able to run it without any issues.
*** Satellite 6.9.2 Hotfix Available ***
1) Download tfm-rubygem-redhat_access-2.2.20-1.el7sat.noarch.rpm from this bugzilla to your Satellite
2) stop services:
satellite-maintain service stop
3) Install:
rpm -Uvh tfm-rubygem-redhat_access-2.2.20-1.el7sat.noarch.rpm
4) restart:
satellite-maintain service start
5) resume operations
Description of problem: When you go to run an insights playbook, you get an error "Failed to create job. Ensure your systems are registered in Foreman" Also, when you then go to look at the job_invocation, you get an error: undefined method `input' for nil:NilClass Output from `foreman-rake errors:fetch_log request_id=2c9f9828` is attached. Version-Release number of selected component (if applicable): 6.9.0 How reproducible: 100% Steps to Reproduce: 1. Register a system in insights 2. Have the system have something for insights to remediate with ansible. I like to demonstrate insights functionality with smbloris, but presumably any ansible playbook for insights would work. 3. Click "Run Playbook" Actual results: 1. Popup error: "Failed to create job. Ensure your systems are registered in Foreman" 2. Go to view the job invocation, you get " Oops, we're sorry but something went wrong undefined method `input' for nil:NilClass" Expected results: Playbook to correctly run and not have queued jobs. Additional info: Logs like 2021-04-28T09:00:23 [I|app|e8b916c2] Started POST "/api/v2/job_invocations/" for 10.10.116.137 at 2021-04-28 09:00:23 -0400 2021-04-28T09:00:23 [I|app|e8b916c2] Processing by Api::V2::JobInvocationsController#create as JSON 2021-04-28T09:00:23 [I|app|e8b916c2] Parameters: {"job_invocation"=>{"feature"=>"ansible_run_insights_plan", "host_ids"=>"plan_id=53587", "inputs"=>{"organization_id"=>1, "plan_id"=>53587}}, "apiv"=>"v2"} 2021-04-28T09:00:23 [I|aud|e8b916c2] JobInvocation (275) create event on job_category Ansible Playbook 2021-04-28T09:00:23 [I|aud|e8b916c2] JobInvocation (275) create event on description Insights maintenance plan for host 2021-04-28T09:00:23 [I|aud|e8b916c2] JobInvocation (275) create event on concurrency_level 2021-04-28T09:00:23 [I|aud|e8b916c2] JobInvocation (275) create event on time_span 2021-04-28T09:00:23 [I|aud|e8b916c2] JobInvocation (275) create event on execution_timeout_interval 2021-04-28T09:00:23 [I|aud|e8b916c2] JobInvocation (275) create event on password [redacted] 2021-04-28T09:00:23 [I|aud|e8b916c2] JobInvocation (275) create event on key_passphrase 2021-04-28T09:00:23 [I|aud|e8b916c2] JobInvocation (275) create event on remote_execution_feature_id 12 2021-04-28T09:00:23 [I|aud|e8b916c2] JobInvocation (275) create event on effective_user_password 2021-04-28T09:00:23 [I|bac|e8b916c2] Task {label: Actions::RemoteExecution::RunHostsJob, id: d2061caf-d6a7-45bf-b5a2-d540877980a9, execution_plan_id: 0d6a79cc-6e31-47b9-90c3-8a9e1bc54ce1} state changed: planning 2021-04-28T09:00:24 [E|bac|] PG::FeatureNotSupported: ERROR: cross-database references are not implemented: ansibleclient.example.com | LINE 1: ...D "hosts"."location_id" = $3 AND (( hosts.name IN(ansiblecli... | ^ | (ActiveRecord::StatementInvalid)