Bug 1539095 - spacecmd softwarechannel_clonetree aborts with duplicate key value violates unique constraint "rhn_ce_ce_uq"
Summary: spacecmd softwarechannel_clonetree aborts with duplicate key value violates u...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 2.7
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Tomáš Kašpárek
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space29
TreeView+ depends on / blocked
 
Reported: 2018-01-26 16:00 UTC by Ben Roberts
Modified: 2021-06-10 14:21 UTC (History)
1 user (show)

Fixed In Version: spacewalk-java-2.9.23-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-01-15 07:59:27 UTC
Embargoed:


Attachments (Terms of Use)

Description Ben Roberts 2018-01-26 16:00:38 UTC
Description of problem:
spacecmd softwarechannel_clonetree aborts part way through the tree with error:

ERROR: redstone.xmlrpc.XmlRpcFault: unhandled internal exception: ERROR: duplicate key value violates unique constraint "rhn_ce_ce_uq"
  Detail: Key (channel_id, errata_id)=(1731, 25865) already exists.

Here, channel_id=1731 is the channel in the process of being cloned, and I suspect this is done inside a transaction which is rolled back after this error is encountered since there is no channel with that ID visible through the webui).
errata_id refers to a cloned errata, present in two children (fedora-26-updates and fedora26-updates-testing) of the base channel. In this case, the channel tree being cloned is already a clone of the "head" tree, i.e. head-fedora -(already cloned to)-> 201801-fedora -(being cloned to)-> qa-fedora.

Version-Release number of selected component (if applicable):
spacecmd-2.7.16-1.el7.noarch
spacewalk-backend-server-2.7.139-1.el7.noarch

How reproducible:
Every time this base channel is cloned


Steps to Reproduce:
1. spacecmd softwarechannel_clonetree -s '201801-fedora' -x '/^201801-/qa-/' --gpg-copy
2. 
3.

Actual results:
Child channels that are before the failing channel are cloned. The failing channel and subsequent channels are not cloned. The above error is printed

Expected results:
The full tree of channels should be cloned without error

Additional info:

Comment 1 michele.bologna 2018-07-31 15:55:00 UTC
Workaround/fix: https://github.com/spacewalkproject/spacewalk/pull/666

Comment 2 Tomáš Kašpárek 2018-07-31 19:26:38 UTC
spacewalk.git(master): d4b470419df236abb61f9e5689d828923abc9a33

Comment 3 Michael Mráka 2018-11-26 09:44:03 UTC
Move Spacewalk 2.9 bugs ON_QA.

Comment 4 Michael Mráka 2019-01-15 07:59:27 UTC
Spacewalk 2.9 has been released.
https://github.com/spacewalkproject/spacewalk/wiki/ReleaseNotes29


Note You need to log in before you can comment on or make changes to this bug.