1

I've updated my Oracle Linux 6.4 server to Oracle Linux 6.8 which is registered to spacewalk server. But after update, yum commands are not working in server.

[root@j4server tmp]# yum update
Loaded plugins: aliases, changelog, kabi, presto, refresh-packagekit, rhnplugin, security, tmprepo, verify,
              : versionlock
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 298, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 115, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 229, in getOptionsConfig
    self.conf
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 911, in <lambda>
    conf = property(fget=lambda self: self._getConfig(),
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 363, in _getConfig
    self.plugins.run('init')
  File "/usr/lib/python2.6/site-packages/yum/plugins.py", line 184, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/share/yum-plugins/rhnplugin.py", line 115, in init_hook
    login_info = up2dateAuth.getLoginInfo()
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 219, in getLoginInfo
    login()
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 167, in login
    if readCachedLogin():
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 133, in readCachedLogin
    expireTime = float(li['X-RHN-Auth-Expiration'])
KeyError: 'X-RHN-Auth-Expiration'

It is throwing this output. When I try to disable rhn-plugin, yum commands works, list packages on spacewalk but as you guess can't install them.

Do you have any ideas about this situation? Thanks for any help!

1

I've found the solution, I'm posting here the solution in case of anyone meets the same situation. The reason of this fault is because when you update Oracle Linux server via spacewalk with "yum update" command, yum update replaces server spacewalk-enabled rhn plugin with a ULN-enabled plugin.

I've erased up2date packages with "yum erase up2date" and "yum erase pirut" after that I've mounted "RHEL 6.8" ISO to Oracle Linux server. After I've added this iso as local repo. I've installed rhn tools with "yum install rhn-client-tools rhn-check rhn-setup rhnsd m2crypto yum-rhn-plugin" and remove local repo file. Now all works fine!

0

I ran into this same error, tho for maybe a different reason. I registered my Oracle Linux 6.7 with a spacewalk server but neglected to update the spacewalk packages first. Lots of research didn't turn up much other than this is an issue. (I did try DNND's solution but rhn takes over yum. One of the commands below will work with his solution)

There's a known bug in a python script. Edit /usr/share/rhn/up2date_client/up2dateAuth.py and change 3 instances of :X-RHN-Auth-Expiration to X-RHN-Auth-Expire-Offset.

Either using the Linux ISO as DNND did or a modern repository use yum by disabling the rhn plugin:

yum --disableplugin=rhnplugin -y install rhn-client-tools rhn-check rhn-setup rhnsd m2crypto yum-rhn-plugin
0

Here is a simple fix for that. I figured out running the rhnreg command at the same time on multiple servers to register client on spacewalk/redhat satellite cause this issue. For example, I run this command on 4 of my servers and only one server got registered successfully.

3 of my servers are throwing the same error mentioned above. Here is what I did to resolve the issue.

Took a backup of my current up2dateAuth.py file

 cp /usr/share/rhn/up2date_client/up2dateAuth.py /usr/share/rhn/up2date_client/up2dateAuth.py_`date +%m_%d_%Y`

I did scp from the first server which is successfully registered with spacewalk server.

 scp /usr/share/rhn/up2date_client/up2dateAuth.py root@server2:/usr/share/rhn/up2date_client/
 ls -lrth /usr/share/rhn/up2date_client/up2dateAuth.py*

run

 yum repolist

 rhnreg_ks --sslCACert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT --serverUrl=https://myspacewalkserver-corp.com/XMLRPC  --activationkey=1-oraclelinux6-x86_64 --force

 yum repolist (it work like a charm)

P.S. don't forget to remove cd /etc/yum.repos.d/; rm -rf spacewalk26-client.repo before running the rhnreg command or else it will throw another error.

Disable access to the Spacewalk Client repository in the Oracle Linux Yum Server repository configuration file or delete /etc/yum.repos.d/spacewalk26-client.repo.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.