Bug 1411355 - install.pl cannot activate satellite during managed-and-os-upgrade
Summary: install.pl cannot activate satellite during managed-and-os-upgrade
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Upgrades
Version: 580
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Tomáš Kašpárek
QA Contact: Ales Dujicek
Depends On:
Blocks: sat580-upgrades 1400201
TreeView+ depends on / blocked
Reported: 2017-01-09 14:39 UTC by Ales Dujicek
Modified: 2017-06-21 12:14 UTC (History)
4 users (show)

Fixed In Version: spacewalk-setup-2.5.1-14-sat rhn-upgrade-
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2017-06-21 12:14:05 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Ales Dujicek 2017-01-09 14:39:44 UTC
Description of problem:

I tried to upgrade Sat 5.6 on RHEL 5 with managed db to Sat 5.8 on RHEL 6 with managed db

I followed instructions to install new 5.8 Sat
./install.pl --external-postgresql
I pointed it to upgraded managed db:
** Database: Setting up database connection for PostgreSQL backend.
Hostname (leave empty for local)? managed.db.example.com
Port [5432]? 
Database? rhnmandb
Username? rhnuser
I did not want to clear schema:
The Database has schema.  Would you like to clear the database [Y]? N
* Activating Red Hat Satellite.
Where is your satellite manifest file? /root/580-manifest.zip
** Loading Red Hat Satellite Manifest.
** Verifying manifest locally.
** Activating Red Hat Satellite.
There was a problem activating the satellite: Local activation failure.

problem is that I had 5.6 schema in the database, certificate is 5.8 and spacewalk-setup did not provide --ignore-version-mismatch


ERROR: RHN Entitlement Certificate cannot be imported - the versions of current and new certificate do not match, [5.6] vs. [5.8]
If you are trying to upgrade the Satellite server, please see the upgrade documentation located here /etc/sysconfig/rhn/satellite-upgrade/README  (as part of the rhn-upgrade package).  WARNING: If you want to skip this check, please use --ignore-version-mismatch, but doing so may cause issues (including malfunction of the Satellite software).  Only skip the test if instructed to do so by a support technician.

then I tried to activate it manually but I it did not work
# rhn-satellite-activate --manifest ~/580-manifest.zip --ignore-version-mismatch
Populating channel families...
Channel families in cert: 1141
ERROR: Channel family 'rhel-devsuite-staging' was not found in mapping
ERROR: Channel family 'solaris-rhcmsys-beta' was not found in mapping
Updating certificates...

ERROR: unhandled exception occurred:
Traceback (most recent call last):
  File "/usr/bin/rhn-satellite-activate", line 38, in <module>
    sys.exit(abs(mod.main() or 0))
  File "/usr/lib/python2.6/site-packages/spacewalk/satellite_tools/rhn_satellite_activate.py", line 463, in main
  File "/usr/lib/python2.6/site-packages/spacewalk/cdn_tools/activation.py", line 166, in activate
  File "/usr/lib/python2.6/site-packages/spacewalk/cdn_tools/activation.py", line 74, in _update_certificates
    constants.CA_CERT_NAME, ca_cert, None)
  File "/usr/lib/python2.6/site-packages/spacewalk/satellite_tools/satCerts.py", line 687, in store_rhnCryptoKey
    description, org_id)
  File "/usr/lib/python2.6/site-packages/spacewalk/satellite_tools/satCerts.py", line 636, in _insertPrep_rhnCryptoKey
    description=description, org_id=org_id)
  File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/sql_base.py", line 151, in execute
    return self._execute_wrapper(self._execute, *p, **kw)
  File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py", line 296, in _execute_wrapper
    retval = function(*p, **kw)
  File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/sql_base.py", line 205, in _execute
    return self._execute_(args, kwargs)
  File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py", line 318, in _execute_
    self._real_cursor.execute(self.sql, params)
psycopg2.IntegrityError: null value in column "org_id" violates not-null constraint
DETAIL:  Failing row contains (7, null, CDN-CA-CERT, 2, ).

first, I had to upgrade schema and then it was possible to activate Satellite

Version-Release number of selected component (if applicable):

Comment 16 Radovan Drazny 2017-06-07 09:37:19 UTC
Re-verified on Satellite-5.8-RHEL-6-20170606.n.0, rhn-upgrade-

Note You need to log in before you can comment on or make changes to this bug.