SUSE Manager schema-upgrade to susemanager-schema-3.0.19-21.2 fails after maintenance update
This document (7019020) is provided subject to the disclaimer at the end of this document.
Environment
Situation
# spacewalk-schema-upgrade
Schema upgrade: [susemanager-schema-3.0.18-18.2] -> [susemanager-schema-3.0.19-21.2]
Searching for upgrade path to: [susemanager-schema-3.0.19-21.2]
Searching for upgrade path to: [susemanager-schema-3.0.19]
Searching for start path: [susemanager-schema-3.0.18-18.2]
Searching for start path: [susemanager-schema-3.0.18]
The path: [susemanager-schema-3.0.18] -> [susemanager-schema-3.0.19]
Planning to run schema upgrade with dir '/var/log/spacewalk/schema-upgrade/schema-from-20170519-080042'
Hit Enter to continue or Ctrl+C to interrupt:
Executing spacewalk-sql, the log is in [/var/log/spacewalk/schema-upgrade/schema-from-20170519-080042-to-susemanager-schema-3.0.19.log].
(3/5) apply upgrade [susemanager-schema-3.0.18-to-susemanager-schema-3.0.19/001-give-minions-scap-capability.sql.postgresql]
Upgrade failed, please see log [/var/log/spacewalk/schema-upgrade/schema-from-20170519-080042-to-susemanager-schema-3.0.19.log].
You can fix the failed migration in [/var/log/spacewalk/schema-upgrade/schema-from-20170519-080042] and run spacewalk-schema-upgrade again
From the log:
SQL> select
'susemanager-schema-3.0.18-to-susemanager-schema-3.0.19/001-give-minions-sc
ap-capability.sql.postgresql' from dual; INSERT INTO
rhnClientCapability(server_id, capability_name_id, version) SELECT s.id,
(SELECT id FROM rhnClientCapabilityName WHERE name='scap.xccdf_eval'), 1
FROM rhnServer s, suseminioninfo mi WHERE s.id=mi.server_id AND NOT EXISTS
(select 1 from rhnClientCapability c where c.capability_name_id=(SELECT id
FROM rhnClientCapabilityName WHERE name='scap.xccdf_eval') and
c.server_id=s.id);
commit;
?column?
----------------------------------------------------------------------------
----------------------------
susemanager-schema-3.0.18-to-susemanager-schema-3.0.19/001-give-minions-sca
p-capability.sql.postgresql (1 row)
psql:<stdin>:2: ERROR: null value in column "capability_name_id" violates
not-null constraint DETAIL: Failing row contains (1000010270, null, 1,
2017-05-19 08:00:44.539642+02, 2017-05-19 08:00:44.539642+02).
Resolution
SQL> select lookup_client_capability('scap.xccdf_eval') from dual;
SQL> \q
$> spacewalk-schema-upgrade
Cause
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:7019020
- Creation Date: 19-May-2017
- Modified Date:03-Mar-2020
-
- SUSE Manager
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com