[Spacewalk-list] Upgrading Spacewalk Server

Wojtak, Greg GregWojtak at quickenloans.com
Tue Oct 11 15:43:53 UTC 2011


Thank you for these tips.  I was able to build out a new server and
migrate everything over.  During the migration process and syncing up my
channels, I ended up hitting the 4 GB data limit of Oracle XE.  I followed
the steps to migrate to PostgreSQL.

It looks like I missed a step (I'm presuming the rhn-ssl-dbstore step)
before I moved to PGSQL - I did a search for the old host name in a
database dump and found it the rhncryptokey table.  Looks like the old
cert is still in there and rhn-ssl-dbstore -vvv
--ca-cert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT gives the following
traceback:

Public CA SSL certificate:  /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT

ERROR: no organization ID!?!

Exception reported from ql1spacewalk1
Time: Tue Oct 11 11:38:19 2011
Exception type <class
'spacewalk.satellite_tools.satCerts.CaCertInsertionError'>

Exception Handler Information
Traceback (most recent call last):
  File 
"/usr/lib/python2.6/site-packages/spacewalk/satellite_tools/rhn_ssl_dbstore
.py", line 89, in main
    satCerts.store_rhnCryptoKey(values.label, values.ca_cert,
verbosity=values.verbose)
  File 
"/usr/lib/python2.6/site-packages/spacewalk/satellite_tools/satCerts.py",
line 496, in store_rhnCryptoKey
    "...the traceback: %s" % fetchTraceback())
CaCertInsertionError: ...the traceback: Exception reported from
ql1spacewalk1
Time: Tue Oct 11 11:38:19 2011
Exception type <class
'spacewalk.server.rhnSQL.sql_base.SQLStatementPrepareError'>

Exception Handler Information
Traceback (most recent call last):
  File 
"/usr/lib/python2.6/site-packages/spacewalk/satellite_tools/satCerts.py",
line 483, in store_rhnCryptoKey
    verbosity=verbosity)
  File 
"/usr/lib/python2.6/site-packages/spacewalk/satellite_tools/satCerts.py",
line 424, in _checkCertMatch_rhnCryptoKey
    h.execute(rhn_cryptokey_id=rhn_cryptokey_id)
  File 
"/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/sql_base.py",
line 163, in execute
    return apply(self._execute_wrapper, (self._execute, ) + p, kw)
  File 
"/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/driver_postgresql
.py", line 269, in _execute_wrapper
    raise rhnSQL.SQLStatementPrepareError(0, str(e), self.sql)
SQLStatementPrepareError: ('syntax error at or near "rhnCryptoKey"\nLINE
1: delete rhnCryptoKey where id=1\n               ^\n', 0, 'delete
rhnCryptoKey where id=%(rhn_cryptokey_id)s')



Looks like a variable is not being interpreted properly?  I'm not sure,
I'm not very proficient with python.

Any ideas or tips?  I would simply insert the new cert manually with psql,
but I'm not sure how to properly encode the contents of the certificate
file to fit in the database.

Thanks!

Greg

On 2011-10-05 7:22 AM, "Milan Zazrivec" <mzazrivec at redhat.com> wrote:

>> > I'm planning on upgrading our Spacewalk server from CentOS 5 to
>>CentOS 6
>> > and updating from spacewalk 1.4 to 1.5 (maybe 1.6 by the time I get
>> > around to this).  My plan is to build a new CentOS 6 server and
>>install
>> > whichever version of Spacewalk I end up using and then just copying
>>over
>> > database, config files, and /var/satellite from the old server.  I'll
>> > also have to be sure the hostname is the same for SSL purposes.  Is
>> > there a quick laundry list of things that will need to be brought
>>over? 
>> > Is this a sound approach?
>> 
>> Yes, this approach is sound.
>> 
>> Appart from database and /var/satellite from the old server, you should
>> also backup & restore ~nocpulse/.ssh/nocpulse-identity* files and
>>content
>> of /root/ssl-build directory.
>> 
>> In short, during your upgrade, you will:
>> 
>> 1. Install a new CentOS 6 and new Spacewalk (this may or may not
>> be done on a new hostname, both will work)
>> 2. Restore and upgrade the db schema
>> 3. Resotore /var/satellite & ~nocpulse/.ssh/nocpulse-identity*
>> 4a. If you're keeping your original hostname:
>> 
>> * Restore content of /root/ssl-build
>> * cd /root
>> * rhn-ssl-tool --gen-server --rpm-only
>> * rpm -Uvh /root/ssl-build/<MACHINE_NAME>/rhn-org-httpd-ssl-key-pair-
>> <VERSION>.noarch.rpm
>> * rhn-deploy-ca-cert.pl \
>>         --source-dir=/root/ssl-build \
>>         --target-dir=/var/www/html/pub/
>> 
>> 
>> 4b. If you're switching to a new hostname:
>> 
>> * rhn-ssl-dbstore -vvv
>>--ca-cert=/root/ssl-build/RHN-ORG-TRUSTED-SSL-CERT
>> * spacewalk-hostname-rename <NEW-IP-ADDRESS>
>
>I forgot to add that you won't be restoring any configuration files from
>the previous installation.
>
>-MZ
>
>_______________________________________________
>Spacewalk-list mailing list
>Spacewalk-list at redhat.com
>https://www.redhat.com/mailman/listinfo/spacewalk-list





More information about the Spacewalk-list mailing list