When multiple subscriptions are removed from a host in a single api call, each of those subs are sent individually to candlepin for removal. This potentially can cause race conditions if those removals are parallelized by foreman tasks. This code should make sure the plan_actions are sequential and not parallel: https://github.com/Katello/katello/blob/master/app/lib/actions/katello/host/remove_subscriptions.rb#L18-L22
Created from redmine issue http://projects.theforeman.org/issues/19158
Upstream bug assigned to tomckay
I suggest this be considered for backport to Sat-6.2.z. The issue was encountered when using hammer csv to remove attached subscriptions prior to adding new ones. The removal would not always work and so the host was left in an inconsistent state. Any calls to this api with multiple subs to remove (bulk actions in the ui, etc.) has the potential to encounter this.
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/19158 has been resolved.
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, 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-2018:0336