SUSE Support

Here When You Need Us

Migration from SUSE Manager 4.1 to 4.2 fails in database schema upgrade with a psql error about "check constraint rhn_errata_adv_status_ck of relation rhnerrata is violated by some row"

This document (000020616) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Manager 4.2
SUSE Manager 4.1

Situation

After upgrading to SUSE Manager 4.2, spacewalk-schema upgrade fails. The error can be found in the logs (latest file in /var/log/spacewalk/schema-upgrade), or retrieved manually by running the schema upgrade again, which will show the following output:
# spacewalk-schema-upgrade

Found unfinished schema migration
Try to continue schema migration
Planning to run schema upgrade with dir '/var/log/spacewalk/schema-upgrade/schema-from-20220209-002047'
Hit Enter to continue or Ctrl+C to interrupt:
Executing spacewalk-sql, the log is in [/var/log/spacewalk/schema-upgrade/schema-from-20220209-002047-to-susemanager-schema-4.2.19.log].
(1/43) apply upgrade [susemanager-schema-4.2.9-to-susemanager-schema-4.2.10/010-errata-status.sql.postgresql]
Upgrade failed, please see log [/var/log/spacewalk/schema-upgrade/schema-from-20220209-002047-to-susemanager-schema-4.2.19.log].
You can fix the failed migration in [/var/log/spacewalk/schema-upgrade/schema-from-20220209-002047]
and run spacewalk-schema-upgrade again"

Resolution

The migration script which creates the problem should be removed.

This is only possible in this very special case as the same migration is executed later again with the correct values.

$> cd /var/log/spacewalk/schema-upgrade/schema-from-20220209-002047

there should be a symlink which has a name like the following one:

XXX_010-errata-status.sql.postgresql

It should be the first one in the list. The symlink should be removed:

$> rm <symlink name>

After this, running the schema migration again should work:

$> spacewalk-schema-upgrade

Cause

Latest 4.1 schema already supports advisory status "pending".
When a patch with status pending is synced and a migration from 4.1 to 4.2 happens, a check constraint violation will be triggered.

Status

Reported to Engineering

Additional Information

Fix not submitted to version 4.2.5, migrations from patched 4.1 servers to releases up to and including 4.2.5 will find this problem. Version 4.2.5 was released around early March 2022. As of mid-March 2022, version 4.2.6 has not been released.

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:000020616
  • Creation Date: 16-Mar-2022
  • Modified Date:16-Mar-2022
    • SUSE Manager Server

< Back to Support Search

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

SUSE Support Forums

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

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.

Open an Incident

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