SUSE Support

Here When You Need Us

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

SUSE Manager 4.1

Situation

When synchronizing a debian-10-amd64-main-security channel on SUSE Manager the following error could occur:
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

The recommended way to solve the issue is to update SUSE Manager to version 4.1.5. Moreover, Debian clients handling was marked as "experimental" before 4.1.5 and not officially supported. See documentation about it:
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

New version compare handling was introduced in 4.1.5, separating the cases in OS families using RPM or DEB packages.

Status

Reported to Engineering

Additional Information

Customer should keep in mind that the database schema upgrade during the update from 4.1.X to 4.1.5 can take up to several hours, in order to plan that update accordingly. Please refer to the release notes of 4.1.5 for further reference.

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

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.