LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-08-2018, 07:24 AM   #1
pix9
Member
 
Registered: Jan 2010
Location: Mumbai, India
Distribution: ArchLinux, Fedora 24, Centos 7.0
Posts: 177

Rep: Reputation: 19
Question Broken yum on Centos 7


Hello folks,

Recently we observed broken yum one of our servers. yum commands doesn't seem to work specifically with root user of sudo privileges.

if I run it with sudo privileges or root user get given below error.
Code:
$ sudo yum repolist
Loaded plugins: fastestmirror, rhnplugin
Traceback (most recent call last):
  File "/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 370, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 165, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 261, in getOptionsConfig
    self.conf
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1078, in <lambda>
    conf = property(fget=lambda self: self._getConfig(),
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 420, in _getConfig
    self.plugins.run('init')
  File "/usr/lib/python2.7/site-packages/yum/plugins.py", line 188, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/share/yum-plugins/rhnplugin.py", line 121, in init_hook
    login_info = up2dateAuth.getLoginInfo(timeout=timeout)
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 229, in getLoginInfo
    login(timeout=timeout)
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 196, in login
    li = server.up2date.login(systemId)
  File "/usr/share/rhn/up2date_client/rhnserver.py", line 67, in __call__
    return rpcServer.doCall(method, *args, **kwargs)
  File "/usr/share/rhn/up2date_client/rpcServer.py", line 214, in doCall
    ret = method(*args, **kwargs)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1233, in __call__
    return self.__send(self.__name, args)
  File "/usr/share/rhn/up2date_client/rpcServer.py", line 48, in _request1
    ret = self._request(methodname, params)
  File "/usr/lib/python2.7/site-packages/rhn/rpclib.py", line 394, in _request
    self._handler, request, verbose=self._verbose)
  File "/usr/lib/python2.7/site-packages/rhn/transports.py", line 194, in request
    return self._process_response(fd, connection)
  File "/usr/lib/python2.7/site-packages/rhn/transports.py", line 222, in _process_response
    return self.parse_response(fd)
  File "/usr/lib/python2.7/site-packages/rhn/transports.py", line 242, in parse_response
    p.feed(response)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 558, in feed
    self._parser.Parse(data, 0)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 19, column 10
same is running without sudo.

Code:
$ yum repolist
Loaded plugins: fastestmirror, rhnplugin
*Note* Spacewalk repositories are not listed below. You must run this command as root to access Spacewalk repositories.
Loading mirror speeds from cached hostfile
 * base: mirror.dhakacom.com
 * epel: mirrors.tongji.edu.cn
 * extras: mirror.dhakacom.com
 * remi-safe: mirrors.tuna.tsinghua.edu.cn
 * updates: mirror.dhakacom.com
repo id                                                                              repo name                                                                                                               status
base/7/x86_64                                                                        CentOS-7 - Base                                                                                                          9,591
epel/x86_64                                                                          Extra Packages for Enterprise Linux 7 - x86_64                                                                          12,530
extras/7/x86_64                                                                      CentOS-7 - Extras                                                                                                          448
remi-safe                                                                            Safe Remi's RPM repository for Enterprise Linux 7 - x86_64                                                               2,662
spacewalk-client/x86_64                                                              Spacewalk Client Tools                                                                                                      25
updates/7/x86_64                                                                     CentOS-7 - Updates                                                                                                       2,416
repolist: 27,672
To fix this I've tried to reinstalling rpms for yum and python-libs
As dirty fix tried manually copying all the folders associated with files listed in error from working centos 7 machine having same version of packages.

same version of packages are working on other server.

How to reproduce :- don't know

kindly let me know if you are able to see further posiblities of debugging this and finding root cause for this.

I am trying to see if there is any issue with root account environment or any issue with sudo environment.

kindly guide me in finding root cause for this problem.

Regards
 
Old 05-08-2018, 09:16 AM   #2
pix9
Member
 
Registered: Jan 2010
Location: Mumbai, India
Distribution: ArchLinux, Fedora 24, Centos 7.0
Posts: 177

Original Poster
Rep: Reputation: 19
Hello folks,

I was able to solved this problem after disabling the rhn plugin. After googling for some time came across similar posts which pointed to issue with plugins so checked through logs once again and found rhnplugin was involved in my case.

Code:
  File "/usr/share/yum-plugins/rhnplugin.py", line 121, in init_hook
    login_info = up2dateAuth.getLoginInfo(timeout=timeout)
tried disabling rhnplugin
Code:
/etc/yum/pluginconf.d/rhnplugin.conf
After disabling "rhnplugin" yum commands are working properly.

Regards

Last edited by pix9; 05-08-2018 at 09:18 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
broken yum centos cpanel server nicksonrulez Linux - Server 2 10-14-2013 03:31 PM
[SOLVED] How to install Python2.4 on CentOS 6 when yum is broken? CelticFiddler Linux - Newbie 15 08-29-2012 06:15 PM
Yum on Centos 6.0 broken... IronTed Linux - General 3 04-26-2012 10:17 AM
centos broken yum after installing new python mad_penguin Linux - Newbie 2 11-17-2011 05:36 PM
Broken Yum while updating centos from 4.6 to 5.2 hoodedmanwithsythe Linux - Software 2 09-20-2008 02:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration