Capsule auto-synchronization fails with an error 'PLP0034' (Katello::Errors::PulpError ) after publishing content view on satellite 6.2.0
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1365952
Description of problem:
Since upgrading to Satelite 6.2 from 6.1, when we add a new version of a puppet module, then publish a new content view (and promote it), the puppet repo sync fails to capsule servers (pulp nodes). The error includes "PLP0034" and "pulp.server.controllers.repository:INFO: duplicate unit names".
PLP0034: The distributor RedHat-Library-RHEL7Base indicated a failed response when publishing repository RedHat-Library-RHEL7Base.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.Sync/upload puppet a module with multiple versions.(Eg : motd 1.2.0 and motd 1.2.1)
2.Associate a environment to the capsule.
3.Publish a content view with motd-1.2.0 and promote it to the capsule associated environment.
4.Let the auto-synchronization complete.
5.Now, add motd 1.2.1 module to the same content view and perform the publish-promote task.
6.This time auto-sync will fail with 'PLP0034' error.
Auto-capsule-sync fails with an error 'PLP0034'
It should not fail and complete the action.
Digging further into the problem, customer found that on the capsule servers that the previous version of the puppet module is still included in the puppet repo to be sync'd, in addition to the new version of the puppet module. Since there are 2 versions of the same module in the repo, the sync fails.
When syncing a capsule, if there is a change in versions of a unit
in a repo (like puppet module versions), pulp will try to sync
both and publish, which results in an error. This can be avoided
by first unassociating all units from non-yum repos and then
kicking off the sync.