PDA

View Full Version : SM 3.1 to SM3.2 spacewalk-schema-upgrade failure



johngoutbeck
21-Jul-2018, 01:40
SM 3.1 to SM3.2

nss-mgmt02:~ # cat /etc/*release
SUSE Linux Enterprise Server 12 (x86_64)
VERSION = 12
PATCHLEVEL = 3
# This file is deprecated and will be removed in a future service pack or release.
# Please check /etc/os-release for details about this release.
NAME="SLES"
VERSION="12-SP3"
VERSION_ID="12.3"
PRETTY_NAME="SUSE Linux Enterprise Server 12 SP3"
ID="sles"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sles:12:sp3"
Spacewalk release 2.8 (Smile)

nss-mgmt02:~ # rpm -qa | grep manager
susemanager-build-keys-web-12.0.1-7.3.noarch
susemanager-tftpsync-3.2.3-6.2.x86_64
susemanager-best-practices_en-pdf-3.2-10.21.1.noarch
susemanager-schema-3.2.11-2.23.1.noarch
susemanager-sync-data-3.2.7-2.19.1.noarch
susemanager-frontend-libs-3.2.1-5.1.noarch
gnome-power-manager-3.20.0-6.3.x86_64
susemanager-tools-3.2.10-2.21.2.x86_64
susemanager-reference_en-pdf-3.2-10.21.1.noarch
supportutils-plugin-susemanager-3.2.1-2.6.3.noarch
susemanager-getting-started_en-pdf-3.2-10.21.1.noarch
gnome-power-manager-lang-3.20.0-6.3.noarch
release-notes-susemanager-3.2.0-5.23.1.x86_64
susemanager-docs_en-3.2-10.21.1.noarch
vncmanager-greeter-1.0.0-1.5.x86_64
susemanager-advanced-topics_en-pdf-3.2-10.21.1.noarch
yast2-services-manager-3.2.2-2.4.3.noarch
susemanager-sls-3.2.14-2.27.1.noarch
susemanager-branding-oss-3.2.3-6.1.noarch
susemanager-nagios-plugin-3.2.2-5.3.noarch
vncmanager-controller-1.0.0-3.6.x86_64
susemanager-3.2.10-2.21.2.x86_64
vncmanager-1.0.0-5.3.6.x86_64
vncmanager-controller-gnome-1.0.0-3.6.x86_64
susemanager-build-keys-12.0.1-7.3.noarch
susemanager-jsp_en-3.2-10.21.1.noarch
nss-mgmt02:~ #


following the upgrade instructions, I'm stopped at the section of the spacewalk schema upgrade.

---
nss-mgmt02:~ # 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-20180702-203134'
Hit Enter to continue or Ctrl+C to interrupt:

Executing spacewalk-sql, the log is in [/var/log/spacewalk/schema-upgrade/schema-from-20180702-203134-to-susemanager-schema-3.1.17.log].

(1/24) apply upgrade [susemanager-schema-3.1.15-to-susemanager-schema-3.1.16/100-lookup_package_capability.sql.postgresql]

Upgrade failed, please see log [/var/log/spacewalk/schema-upgrade/schema-from-20180702-203134-to-susemanager-schema-3.1.17.log].

You can fix the failed migration in [/var/log/spacewalk/schema-upgrade/schema-from-20180702-203134]
and run spacewalk-schema-upgrade again
---
I've run the spacewalk-schema-upgrade several times with the same results.

directory contents
nss-mgmt02:~ # l /var/log/spacewalk/schema-upgrade
total 164
drwxr-xr-x 1 root root 414 Jul 2 20:31 ./
drwxr-xr-x 1 root root 28 Jan 2 2018 ../
-rw-r--r-- 1 root root 38466 Jan 2 2018 schema-from-20180102-193909-to-susemanager-schema-3.1.13.log
-rw-r--r-- 1 root root 100520 Apr 27 06:46 schema-from-20180427-064636-to-susemanager-schema-3.1.15.log
drwxr-xr-x 1 root root 1960 Jul 2 20:31 schema-from-20180702-203134/
-rw-r--r-- 1 root root 24440 Jul 20 18:32 schema-from-20180702-203134-to-susemanager-schema-3.1.17.log


nss-mgmt02:~ # cat /var/log/spacewalk/schema-upgrade/schema-from-20180702-203134-to-susemanager-schema-3.1.17.log
================== started: 2018-07-02 20:31:39 ==================
SQL> select 'schema-from-20180702-203134/00_0000-upgrade-start.sql' from dual;
update rhnVersionInfo
.
.
.
language plpgsql;
commit;

?column?
-----------------------------------------------------------------------------------------------------
susemanager-schema-3.1.15-to-susemanager-schema-3.1.16/100-lookup_package_capability.sql.postgresql
(1 row)

psql:<stdin>:46: ERROR: syntax error at or near "on"
LINE 27: on conflict do nothing;
^
---

OK whats the issue
Whats the next step? To get past this and finish the schema upgrade?

kwk
23-Jul-2018, 07:12
Please upgrade to PostgreSQL 9.6 as advised in the release notes.

johngoutbeck
24-Jul-2018, 18:29
Please upgrade to PostgreSQL 9.6 as advised in the release notes.

Hello;

Reran the PostgreSQL update with
/usr/lib/susemanager/bin/pg-migrate.sh

Then the next commands
spacewalk-service stop
zypper patch
rcpostgresql start
spacewalk-schema-upgrade
--
nss-mgmt02:~ # 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-20180702-203134'
Hit Enter to continue or Ctrl+C to interrupt:
Executing spacewalk-sql, the log is in [/var/log/spacewalk/schema-upgrade/schema-from-20180702-203134-to-susemanager-schema-3.1.17.log].
(1/24) apply upgrade [susemanager-schema-3.1.15-to-susemanager-schema-3.1.16/100-lookup_package_capability.sql.postgresql] (16/24) apply upgrade [susemanager-schema-3.1.15-to-susemanager-schema-3.1.16/115-lookup_transaction_package.sql.postgresql] (22/24) apply upgrade [susemanager-schema-3.1.16-to-susemanager-schema-3.1.17/003-add-sles15-KSInstallType.sql.postgresql] (23/24) apply upgrade [susemanager-schema-3.1.16-to-susemanager-schema-3.1.17/201-add-root_pdid-to-suseProductExtensions.sql.post(24/24) apply upgrade [schema-from-20180702-203134/99_9999-upgrade-end.sql]
Upgrade seems to have run OK yet new schema version is
[susemanager-schema-3.1.17-2.23.3], not [susemanager-schema-3.2.11-2.23.1].
Please run schema upgrade again.

nss-mgmt02:~ # spacewalk-schema-upgrade
Schema upgrade: [susemanager-schema-3.1.17-2.23.3] -> [susemanager-schema-3.2.11-2.23.1]
Searching for upgrade path to: [susemanager-schema-3.2.11-2.23.1]
Searching for upgrade path to: [susemanager-schema-3.2.11]
Searching for start path: [susemanager-schema-3.1.17-2.23.3]
Searching for start path: [susemanager-schema-3.1.17]
The path: [susemanager-schema-3.1.17] -> [susemanager-schema-3.1.18] -> [susemanager-schema-3.2.0] -> [susemanager-schema-3.2.1] -> [susemanager-schema-3.2.2] -> [susemanager-schema-3.2.3] -> [susemanager-schema-3.2.4] -> [susemanager-schema-3.2.5] -> [susemanager-schema-3.2.6] -> [susemanager-schema-3.2.7] -> [susemanager-schema-3.2.8] -> [susemanager-schema-3.2.9] -> [susemanager-schema-3.2.10] -> [susemanager-schema-3.2.11]
Planning to run schema upgrade with dir '/var/log/spacewalk/schema-upgrade/schema-from-20180724-064010'
Hit Enter to continue or Ctrl+C to interrupt:
Executing spacewalk-sql, the log is in [/var/log/spacewalk/schema-upgrade/schema-from-20180724-064010-to-susemanager-schema-3.2.11.log].
(1/38) apply upgrade [susemanager-schema-3.1.17-to-susemanager-schema-3.1.18/000-fix-suse_img_repodigest_idx.sql.postgresql] (5/38) apply upgrade [susemanager-schema-3.2.0-to-susemanager-schema-3.2.1/0201-add-root_pdid-to-suseProductExtensions.sql.postgr(6/38) apply upgrade [susemanager-schema-3.2.0-to-susemanager-schema-3.2.1/1001-rhnpackageevr-rhn_pe_v_r_e_uq.sql.postgresql] (11/38) apply upgrade [susemanager-schema-3.2.0-to-susemanager-schema-3.2.1/1010-rhnerratatmp-add_severity_id.sql.postgresql] (13/38) apply upgrade [susemanager-schema-3.2.7-to-susemanager-schema-3.2.8/002-clean-up-studio-credentials.sql.postgresql] (31/38) apply upgrade [susemanager-schema-3.2.7-to-susemanager-schema-3.2.8/115-lookup_transaction_package.sql.postgresql] (36/38) apply upgrade [susemanager-schema-3.2.9-to-susemanager-schema-3.2.10/000-fix-suse_img_repodigest_idx.sql.postgresql] (38/38) apply upgrade [schema-from-20180724-064010/99_9999-upgrade-end.sql] efine-sle15-ostargets.sql.postgresql]
The database schema was upgraded to version [susemanager-schema-3.2.11-2.23.1].
nss-mgmt02:~ #

nss-mgmt02:~ # spacewalk-schema-upgrade
Schema upgrade: [susemanager-schema-3.2.11-2.23.1] -> [susemanager-schema-3.2.11-2.23.1]
Searching for upgrade path to: [susemanager-schema-3.2.11-2.23.1]
Searching for upgrade path to: [susemanager-schema-3.2.11]
Your database schema already matches the schema package version [susemanager-schema-3.2.11-2.23.1].
nss-mgmt02:~ #
---
So up[dating the PostgreSQL again and the spacewalk schema upgrade worked on this system

Thank you for your help

Have a good day.