Syncing debian-10-amd64-main-security channel on SUSE Manager throws an error: "Debian SQLSchemaError: (99999, 'ERROR: duplicate key value violates unique constraint "rhn_cnp_cid_nid_uq")"
This document (000019869) is provided subject to the disclaimer at the end of this document.
Environment
Situation
Debian SQLSchemaError: (99999, 'ERROR: duplicate key value violates unique constraint "rhn_cnp_cid_nid_uq")
Error exist in the synchronization of some of the Debian channels. In the case reported, the affected channel was debian-10-amd64-main-security, but others could be affected as well. Error exist no matter whether the sync is performed manually or automatically. Removing the channel and adding it again in order to recreate it, won't help either.
Traces in the logs similar to this one might exist:
Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py", line 85, in __call__ ret = self.cursor.execute(query, args) psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "rhn_cnp_cid_nid_uq" DETAIL: Key (channel_id, name_id, package_arch_id)=(835, 55922, 145) already exists. CONTEXT: SQL statement "insert into rhnChannelNewestPackage (channel_id, name_id, evr_id, package_id, package_arch_id) (select channel_id, name_id, evr_id, package_id, package_arch_id from rhnChannelNewestPackageView where channel_id = channel_id_in and (package_name_id_in is null or name_id = package_name_id_in) )"
Resolution
https://documentation.suse.com/external-tree/en-us/suma/4.1/suse-manager/client-configuration/clients-debian.html
Release notes for 4.1.5 include further information regarding the support status of Debian clients.
Other solutions reported to have worked, such as adding the uyuni parent and child channels (debian-10-pool-amd64-uyuni and debian-10-amd64-uyuni-client) should be considered as workarounds and even if reported to have bypassed the problem, should not be considered.
Cause
Status
Additional Information
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000019869
- Creation Date: 10-Feb-2021
- Modified Date:12-Feb-2021
-
- SUSE Manager Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com