Registering failed: No module named rhn.connections

We’re currently updating our SLES systems to SLES12SP4, and in that process the system gets reregistered with Suse Manager.
We’re running Suse Manager 3.1.

But I’ve got a bunch of systems that don’t like to be registered/bootstraped with Suse manager (as traditional clients).
These are SLES12SP4 systems, that were updated from SLES11SP4.
Other systems that have been upgraded from SLES12SP3 to SLES12SP4 don’t have that problem.

Bootstrapping ends with this error:

[CODE]UPDATING RHN_REGISTER/UP2DATE CONFIGURATION FILES

PREPARE GPG KEYS AND CORPORATE PUBLIC CA CERT

  • no organizational GPG keys to import

  • attempting to install corporate public CA cert
    2019-01-11 09:14:50 URL:https://vissuma01.nb.edeka.net/pub/rhn-org-trusted-ssl-cert-1.0-1.noarch.rpm [4696/4696] → “rhn-org-trusted-ssl-cert-1.0-1.noarch.rpm” [1]
    FINISHED --2019-01-11 09:14:50–
    Total wall clock time: 0.01s
    Downloaded: 1 files, 4.6K in 0s (449 MB/s)
    Preparing… ################################# [100%]
    Updating / installing…
    1:rhn-org-trusted-ssl-cert-1.0-1 ################################# [100%]

CLEANING UP OLD SUSE MANAGER REPOSITORIES

CHECKING THE REGISTRATION STACK

The following 13 NEW packages are going to be installed:
hwdata newt python-newt python2-hwdata python2-spacewalk-check python2-spacewalk-client-setup python2-spacewalk-client-tools python2-zypp-plugin-spacewalk spacewalk-check spacewalk-client-setup
spacewalk-client-tools spacewalksd zypp-plugin-spacewalk

The following package is going to be upgraded:
libnewt0_52

The following 14 packages have no support information from their vendor:
hwdata libnewt0_52 newt python-newt python2-hwdata python2-spacewalk-check python2-spacewalk-client-setup python2-spacewalk-client-tools python2-zypp-plugin-spacewalk spacewalk-check spacewalk-client-setup
spacewalk-client-tools spacewalksd zypp-plugin-spacewalk

1 package to upgrade, 13 new.
Overall download size: 2.0 MiB. Already cached: 0 B. After the operation, additional 10.2 MiB will be used.
Continue? [y/n/…? shows all options] (y): y
Retrieving package hwdata-0.314-10.9.1.noarch (1/14), 1.3 MiB ( 7.0 MiB unpacked)
Retrieving: hwdata-0.314-10.9.1.noarch.rpm …[done]
Retrieving package libnewt0_52-0.52.16-1.83.x86_64 (2/14), 41.3 KiB ( 87.8 KiB unpacked)
Retrieving: libnewt0_52-0.52.16-1.83.x86_64.rpm …[done]
Retrieving package python2-hwdata-2.3.5-12.3.1.noarch (3/14), 31.0 KiB (176.5 KiB unpacked)
Retrieving: python2-hwdata-2.3.5-12.3.1.noarch.rpm …[done]
Retrieving package newt-0.52.16-1.83.x86_64 (4/14), 43.9 KiB ( 87.3 KiB unpacked)
Retrieving: newt-0.52.16-1.83.x86_64.rpm …[done]
Retrieving package python-newt-0.52.16-1.83.x86_64 (5/14), 25.4 KiB ( 72.5 KiB unpacked)
Retrieving: python-newt-0.52.16-1.83.x86_64.rpm …[done]
Retrieving package python2-spacewalk-client-tools-2.8.22.3-52.9.1.noarch (6/14), 92.7 KiB (465.7 KiB unpacked)
Retrieving: python2-spacewalk-client-tools-2.8.22.3-52.9.1.noarch.rpm …[done]
Retrieving package spacewalk-client-tools-2.8.22.3-52.9.1.noarch (7/14), 313.6 KiB ( 2.0 MiB unpacked)
Retrieving: spacewalk-client-tools-2.8.22.3-52.9.1.noarch.rpm …[done]
Retrieving package zypp-plugin-spacewalk-1.0.4-30.12.1.noarch (8/14), 12.8 KiB ( 11.1 KiB unpacked)
Retrieving: zypp-plugin-spacewalk-1.0.4-30.12.1.noarch.rpm …[done]
Retrieving package python2-zypp-plugin-spacewalk-1.0.4-30.12.1.noarch (9/14), 22.2 KiB ( 51.4 KiB unpacked)
Retrieving: python2-zypp-plugin-spacewalk-1.0.4-30.12.1.noarch.rpm …[done]
Retrieving package python2-spacewalk-check-2.8.22.3-52.9.1.noarch (10/14), 26.4 KiB ( 46.6 KiB unpacked)
Retrieving: python2-spacewalk-check-2.8.22.3-52.9.1.noarch.rpm …[done]
Retrieving package spacewalk-check-2.8.22.3-52.9.1.noarch (11/14), 15.8 KiB ( 2.6 KiB unpacked)
Retrieving: spacewalk-check-2.8.22.3-52.9.1.noarch.rpm …[done]
Retrieving package spacewalksd-5.0.37.1-24.9.1.x86_64 (12/14), 44.0 KiB ( 87.1 KiB unpacked)
Retrieving: spacewalksd-5.0.37.1-24.9.1.x86_64.rpm …[done]
Retrieving package python2-spacewalk-client-setup-2.8.22.3-52.9.1.noarch (13/14), 54.9 KiB (268.2 KiB unpacked)
Retrieving: python2-spacewalk-client-setup-2.8.22.3-52.9.1.noarch.rpm …[done]
Retrieving package spacewalk-client-setup-2.8.22.3-52.9.1.noarch (14/14), 17.4 KiB ( 3.3 KiB unpacked)
Retrieving: spacewalk-client-setup-2.8.22.3-52.9.1.noarch.rpm …[done]
Checking for file conflicts: …[done]
( 1/14) Installing: hwdata-0.314-10.9.1.noarch …[done]
( 2/14) Installing: libnewt0_52-0.52.16-1.83.x86_64 …[done]
( 3/14) Installing: python2-hwdata-2.3.5-12.3.1.noarch …[done]
( 4/14) Installing: newt-0.52.16-1.83.x86_64 …[done]
( 5/14) Installing: python-newt-0.52.16-1.83.x86_64 …[done]
( 6/14) Installing: python2-spacewalk-client-tools-2.8.22.3-52.9.1.noarch …[done]
( 7/14) Installing: spacewalk-client-tools-2.8.22.3-52.9.1.noarch …[done]
( 8/14) Installing: zypp-plugin-spacewalk-1.0.4-30.12.1.noarch …[done]
( 9/14) Installing: python2-zypp-plugin-spacewalk-1.0.4-30.12.1.noarch …[done]
(10/14) Installing: python2-spacewalk-check-2.8.22.3-52.9.1.noarch …[done]
(11/14) Installing: spacewalk-check-2.8.22.3-52.9.1.noarch …[done]
(12/14) Installing: spacewalksd-5.0.37.1-24.9.1.x86_64 …[done]
(13/14) Installing: python2-spacewalk-client-setup-2.8.22.3-52.9.1.noarch …[done]
(14/14) Installing: spacewalk-client-setup-2.8.22.3-52.9.1.noarch …[done]
spacewalk-check-2.8.22.3-52.9.1.noarch
spacewalk-client-setup-2.8.22.3-52.9.1.noarch
spacewalk-client-tools-2.8.22.3-52.9.1.noarch
zypp-plugin-spacewalk-1.0.4-30.12.1.noarch
Refreshing service ‘spacewalk’.
Problem retrieving the repository index file for service ‘spacewalk’:
[spacewalk|file:/usr/lib/zypp/plugins/services/spacewalk] This system is not registered to any spacewalk server. If the system is not intended to be managed with spacewalk, please uninstall the zypp-plugin-spacewalk package.

Warning: Skipping service ‘spacewalk’ because of the above error.
Loading repository data…
Reading installed packages…
No update candidate for ‘openssl-1.0.2p-1.13.noarch’. The highest available version is already installed.
No update candidate for ‘zypper-1.13.45-21.23.4.x86_64’. The highest available version is already installed.
No update candidate for ‘spacewalk-client-tools-2.8.22.3-52.9.1.noarch’. The highest available version is already installed.
No update candidate for ‘zypp-plugin-spacewalk-1.0.4-30.12.1.noarch’. The highest available version is already installed.
No update candidate for ‘spacewalk-check-2.8.22.3-52.9.1.noarch’. The highest available version is already installed.
No update candidate for ‘spacewalk-client-setup-2.8.22.3-52.9.1.noarch’. The highest available version is already installed.
‘python2-rhnlib’ is already installed.
Package ‘python2-rhnlib’ is not available in your repositories. Cannot reinstall, upgrade, or downgrade.
Resolving package dependencies…

Nothing to do.

  • running the update scripts
    . up2date config file
  • /etc/sysconfig/rhn/up2date written

REGISTRATION

  • registering
    Traceback (most recent call last):
    File “/usr/sbin/rhnreg_ks”, line 25, in
    from rhn.connections import idn_puny_to_unicode
    ImportError: No module named rhn.connections

*** Error: Registering the system failed.[/CODE]

What did I try to solve this problem?:

  • updated SuMa from 3.1.9 to 3.1.10
  • recreated bootstrap repos
  • recreated bootstrap file
  • before upgrading from SLES11SP4 to SLES12SP4, fully patch the SLES11SP4 system
  • before upgrading from SLES11SP4 to SLES12SP4, unregister the system from SuMa like described here: https://www.suse.com/support/kb/doc/?id=7013242
  • manually updating ‘python2-rhnlib’ from python2-rhnlib-2.8.11.1-12.6.1 to python2-rhnlib-2.8.11.1-21.6.1, after that the error changes to:

[CODE]REGISTRATION

  • registering
    Traceback (most recent call last):
    File “/usr/sbin/rhnreg_ks”, line 35, in
    from up2date_client import rhnreg
    File “/usr/lib/python2.7/site-packages/up2date_client/rhnreg.py”, line 17, in
    from up2date_client import pkgUtils
    File “/usr/lib/python2.7/site-packages/up2date_client/pkgUtils.py”, line 11, in
    from up2date_client.rpmUtils import *
    File “/usr/lib/python2.7/site-packages/up2date_client/rpmUtils.py”, line 23, in
    from spacewalk.common.usix import StringType, UnicodeType
    ImportError: No module named spacewalk.common.usix

*** Error: Registering the system failed.[/CODE]

any ideas somebody ?

Check if you have “spacewalk-usix” installed. I wonder a bit as python2-spacewalk-client-tools has a dependency to it and your log show that it got installed.

yes, spacewalk-usix-2.8.3.1-3.3.1.x86_64 is installed on this upgraded SLES12SP4 machine.
I can see in the bootstrap repos that with SLES11SP4 it’s for arch x86_64, whereas for SLES12SP4 it’s for noarch.

find / -name ‘spacewalk-usix*’
/srv/www/htdocs/pub/repositories/sle/11/3/bootstrap/x86_64/spacewalk-usix-2.8.3.1-3.3.1.x86_64.rpm
/srv/www/htdocs/pub/repositories/sle/11/4/bootstrap/x86_64/spacewalk-usix-2.8.3.1-3.3.1.x86_64.rpm
/srv/www/htdocs/pub/repositories/sle/12/3/bootstrap/noarch/spacewalk-usix-2.8.3.1-3.3.1.noarch.rpm
/srv/www/htdocs/pub/repositories/sle/12/2/bootstrap/noarch/spacewalk-usix-2.8.3.1-3.3.1.noarch.rpm
/srv/www/htdocs/pub/repositories/sle/12/4/bootstrap/noarch/spacewalk-usix-2.8.3.1-3.3.1.noarch.rpm

So maybe the package for x86_64 should be uninstalled, and norarch installed ?
I tried it and it didn’t help.

Nevertheless I 've uninstalled all relevant packages with:
rpm -e spacewalk-check spacewalksd python2-zypp-plugin-spacewalk zypp-plugin-spacewalk spacewalk-client-tools spacewalk-usix python2-spacewalk-check python2-spacewalk-client-tools spacewalk-client-setup python2-spacewalk-client-setup rhnlib python2-rhnlib

…and ran the bootstrap script again.

Now the output is as follows:

[CODE]UPDATING RHN_REGISTER/UP2DATE CONFIGURATION FILES

PREPARE GPG KEYS AND CORPORATE PUBLIC CA CERT

  • no organizational GPG keys to import

  • attempting to install corporate public CA cert
    2019-01-14 13:58:29 URL:https://vissuma01.nb.edeka.net/pub/rhn-org-trusted-ssl-cert-1.0-1.noarch.rpm [9492/9492] → “rhn-org-trusted-ssl-cert-1.0-1.noarch.rpm” [1]
    FINISHED --2019-01-14 13:58:29–
    Total wall clock time: 0.009s
    Downloaded: 1 files, 9.3K in 0s (242 MB/s)
    Preparing… ################################# [100%]
    Updating / installing…
    1:rhn-org-trusted-ssl-cert-1.0-1 ################################# [100%]

CLEANING UP OLD SUSE MANAGER REPOSITORIES

CHECKING THE REGISTRATION STACK

The following 11 NEW packages are going to be installed:
python2-spacewalk-check python2-spacewalk-client-setup python2-spacewalk-client-tools python2-zypp-plugin-spacewalk rhnlib spacewalk-check spacewalk-client-setup spacewalk-client-tools spacewalk-usix
spacewalksd zypp-plugin-spacewalk

The following 11 packages have no support information from their vendor:
python2-spacewalk-check python2-spacewalk-client-setup python2-spacewalk-client-tools python2-zypp-plugin-spacewalk rhnlib spacewalk-check spacewalk-client-setup spacewalk-client-tools spacewalk-usix
spacewalksd zypp-plugin-spacewalk

11 new packages to install.
Overall download size: 664.2 KiB. Already cached: 0 B. After the operation, additional 3.1 MiB will be used.
Continue? [y/n/…? shows all options] (y): y
Retrieving package rhnlib-2.7.2.2-21.3.1.noarch (1/11), 58.4 KiB (265.3 KiB unpacked)
Retrieving: rhnlib-2.7.2.2-21.3.1.noarch.rpm …[done]
Retrieving package spacewalk-usix-2.8.3.1-3.3.1.noarch (2/11), 6.1 KiB ( 6.6 KiB unpacked)
Retrieving: spacewalk-usix-2.8.3.1-3.3.1.noarch.rpm …[done]
Retrieving package python2-spacewalk-client-tools-2.8.22.3-52.9.1.noarch (3/11), 92.7 KiB (465.7 KiB unpacked)
Retrieving: python2-spacewalk-client-tools-2.8.22.3-52.9.1.noarch.rpm …[done]
Retrieving package spacewalk-client-tools-2.8.22.3-52.9.1.noarch (4/11), 313.6 KiB ( 2.0 MiB unpacked)
Retrieving: spacewalk-client-tools-2.8.22.3-52.9.1.noarch.rpm …[done]
Retrieving package zypp-plugin-spacewalk-1.0.4-30.12.1.noarch (5/11), 12.8 KiB ( 11.1 KiB unpacked)
Retrieving: zypp-plugin-spacewalk-1.0.4-30.12.1.noarch.rpm …[done]
Retrieving package python2-zypp-plugin-spacewalk-1.0.4-30.12.1.noarch (6/11), 22.2 KiB ( 51.4 KiB unpacked)
Retrieving: python2-zypp-plugin-spacewalk-1.0.4-30.12.1.noarch.rpm …[done]
Retrieving package python2-spacewalk-check-2.8.22.3-52.9.1.noarch (7/11), 26.4 KiB ( 46.6 KiB unpacked)
Retrieving: python2-spacewalk-check-2.8.22.3-52.9.1.noarch.rpm …[done]
Retrieving package spacewalk-check-2.8.22.3-52.9.1.noarch (8/11), 15.8 KiB ( 2.6 KiB unpacked)
Retrieving: spacewalk-check-2.8.22.3-52.9.1.noarch.rpm …[done]
Retrieving package spacewalksd-5.0.37.1-24.9.1.x86_64 (9/11), 44.0 KiB ( 87.1 KiB unpacked)
Retrieving: spacewalksd-5.0.37.1-24.9.1.x86_64.rpm …[done]
Retrieving package python2-spacewalk-client-setup-2.8.22.3-52.9.1.noarch (10/11), 54.9 KiB (268.2 KiB unpacked)
Retrieving: python2-spacewalk-client-setup-2.8.22.3-52.9.1.noarch.rpm …[done]
Retrieving package spacewalk-client-setup-2.8.22.3-52.9.1.noarch (11/11), 17.4 KiB ( 3.3 KiB unpacked)
Retrieving: spacewalk-client-setup-2.8.22.3-52.9.1.noarch.rpm …[done]
Checking for file conflicts: …[done]
( 1/11) Installing: rhnlib-2.7.2.2-21.3.1.noarch …[done]
( 2/11) Installing: spacewalk-usix-2.8.3.1-3.3.1.noarch …[done]
( 3/11) Installing: python2-spacewalk-client-tools-2.8.22.3-52.9.1.noarch …[done]
( 4/11) Installing: spacewalk-client-tools-2.8.22.3-52.9.1.noarch …[done]
( 5/11) Installing: zypp-plugin-spacewalk-1.0.4-30.12.1.noarch …[done]
( 6/11) Installing: python2-zypp-plugin-spacewalk-1.0.4-30.12.1.noarch …[done]
( 7/11) Installing: python2-spacewalk-check-2.8.22.3-52.9.1.noarch …[done]
( 8/11) Installing: spacewalk-check-2.8.22.3-52.9.1.noarch …[done]
( 9/11) Installing: spacewalksd-5.0.37.1-24.9.1.x86_64 …[done]
(10/11) Installing: python2-spacewalk-client-setup-2.8.22.3-52.9.1.noarch …[done]
(11/11) Installing: spacewalk-client-setup-2.8.22.3-52.9.1.noarch …[done]
spacewalk-check-2.8.22.3-52.9.1.noarch
spacewalk-client-setup-2.8.22.3-52.9.1.noarch
spacewalk-client-tools-2.8.22.3-52.9.1.noarch
zypp-plugin-spacewalk-1.0.4-30.12.1.noarch
Refreshing service ‘spacewalk’.
Problem retrieving the repository index file for service ‘spacewalk’:
[spacewalk|file:/usr/lib/zypp/plugins/services/spacewalk] This system is not registered to any spacewalk server. If the system is not intended to be managed with spacewalk, please uninstall the zypp-plugin-spacewalk package.

Warning: Skipping service ‘spacewalk’ because of the above error.
Loading repository data…
Reading installed packages…
No update candidate for ‘openssl-1.0.2p-1.13.noarch’. The highest available version is already installed.
No update candidate for ‘zypper-1.13.45-21.23.4.x86_64’. The highest available version is already installed.
No update candidate for ‘spacewalk-client-tools-2.8.22.3-52.9.1.noarch’. The highest available version is already installed.
No update candidate for ‘zypp-plugin-spacewalk-1.0.4-30.12.1.noarch’. The highest available version is already installed.
No update candidate for ‘rhnlib-2.7.2.2-21.3.1.noarch’. The highest available version is already installed.
No update candidate for ‘spacewalk-check-2.8.22.3-52.9.1.noarch’. The highest available version is already installed.
No update candidate for ‘spacewalk-client-setup-2.8.22.3-52.9.1.noarch’. The highest available version is already installed.
Resolving package dependencies…

Nothing to do.

  • running the update scripts
    . up2date config file
  • /etc/sysconfig/rhn/up2date written

REGISTRATION

  • registering
    Traceback (most recent call last):
    File “/usr/sbin/rhnreg_ks”, line 35, in
    from up2date_client import rhnreg
    File “/usr/lib/python2.7/site-packages/up2date_client/rhnreg.py”, line 21, in
    from up2date_client.rhnPackageInfo import convertPackagesFromHashToList
    File “/usr/lib/python2.7/site-packages/up2date_client/rhnPackageInfo.py”, line 17, in
    from suseRegister.info import getProductProfile
    ImportError: No module named suseRegister.info

*** Error: Registering the system failed.[/CODE]

I’ve got bootrapping working now! Hooray :slight_smile:

I did not uninstall enough packages (like described in previous post)

What I did was uninstalling these packages again:

rpm -e spacewalk-check spacewalksd python2-zypp-plugin-spacewalk zypp-plugin-spacewalk spacewalk-client-tools spacewalk-usix python2-spacewalk-check python2-spacewalk-client-tools spacewalk-client-setup python2-spacewalk-client-setup rhnlib python2-rhnlib

And also those two packages:

python2-suseRegisterInfo-3.2.2-6.3.1.x86_64
suseRegisterInfo-3.2.2-6.3.1.x86_64

Then bootrapping … and it worked.

I can see afterwards that both packages are newer and “noarch” now:

python2-suseRegisterInfo-3.2.2-25.3.1.noarch
suseRegisterInfo-3.2.2-25.3.1.noarch

So maybe the whole problem is that systems that got upgraded from SLES11 to SLES12 there are still some x86_64 packages installed, that have no update candidate in SLES12 bootstrap repositories (because of change to noarch architecture) !?

Yes it was because of the architecture change. We had to do it because of the python3 port and this cause some problems as we do not update all the packages.

So does it make sense that the bootstrap script itself uninstalls those x86_64 packages, when there are newer noarch packages available ?