Duplicate entries of ListenOnCandlepinEvents task in Red Hat Satellite 6.
Environment
- Red Hat Satellite 6.x
Issue
- Red Hat Satellite task queue shows double entries of Actions::Candlepin::ListenOnCandlepinEvents task one in
paused stateand other inrunning state.
Resolution
-
Login to Red Hat Satellite CLI clean the paused task with specific label and state, using the below command as the paused task does not have any impact in the functioning of Red Hat Satellite.
# foreman-rake foreman_tasks:cleanup TASK_SEARCH='label = Actions::Candlepin::ListenOnCandlepinEvents' STATES='paused' VERBOSE=true- NOTE: Actions::Candlepin::ListenOnCandlepinEvents task should always be in running state which is recommended for smooth functioning of Red Hat Satellite 6.
For more KB articles/solutions related to Red Hat Satellite 6.x Candlepin Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x Candlepin Issues
Root Cause
-
Check the status of the task queue by executing the below command on Red Hat Satellite CLI.
# sudo su - postgres -c "psql -d foreman -c 'select label,count(label),state,result from foreman_tasks_tasks where state <> '\''stopped'\'' group by label,state,result ORDER BY label;'"
Diagnostic Steps
-
At the following path
Red Hat Satellite Web UI >> Monitor >> Taskssearch for: label = Actions::Candlepin::ListenOnCandlepinEvents. Click on the task which shows the below message.{"messages"=>"9d7a8d35-92a9-361c-8538-8b5b34e029ca", "last_message"=>"9d7a8d35-92a9-361c-8538-8b5b34e029ca - compliance.created", "error"=>nil, "connection"=>"Connected", "last_message_time"=>"2019-03-15 16:14:16 -0500", "last_event_error"=> "PG::ForeignKeyViolation: ERROR: insert or update on table \"katello_compliance_reasons\" violates foreign key constraint \"katello_compliance_reasons_facet_id\"\n" + "DETAIL: Key (subscription_facet_id)=(1671) is not present in table \"katello_subscription_facets\".\n" + ": INSERT INTO \"katello_compliance_reasons\" (\"reason\", \"subscription_facet_id\") VALUES ($1, $2) RETURNING \"id\""} Errors: Action Actions::Candlepin::ListenOnCandlepinEvents is already active
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.