Yum : AttributeError: 'NoneType' object has no attribute 'groups'

Issues related to applications and software problems
Post Reply
Lokylax
Posts: 3
Joined: 2018/10/29 09:53:52

Yum : AttributeError: 'NoneType' object has no attribute 'groups'

Post by Lokylax » 2018/10/29 10:02:53

Hi readers,

I work on a virtual machine through a proxy. When I want to use yum to update or install new packages I have the following error :

Code: Select all

yum update
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
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 375, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 184, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 584, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
  File "/usr/share/yum-cli/yumcommands.py", line 505, in doCommand
    ret = base.updatePkgs(extcmds, update_to=(basecmd == 'update-to'))
  File "/usr/share/yum-cli/cli.py", line 1068, in updatePkgs
    self.update()
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 5126, in update
    updates = self.up.getUpdatesTuples()
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1093, in <lambda>
    up = property(fget=lambda self: self._getUpdates(),
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 838, in _getUpdates
    self._up = rpmUtils.updates.Updates(self.rpmdb.simplePkgList(), self.pkgSack.simplePkgList())
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1074, in <lambda>
    pkgSack = property(fget=lambda self: self._getSacks(),
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 778, in _getSacks
    self.repos.populateSack(which=repos)
  File "/usr/lib/python2.7/site-packages/yum/repos.py", line 347, in populateSack
    self.doSetup()
  File "/usr/lib/python2.7/site-packages/yum/repos.py", line 157, in doSetup
    self.retrieveAllMD()
  File "/usr/lib/python2.7/site-packages/yum/repos.py", line 88, in retrieveAllMD
    dl = repo._async and repo._commonLoadRepoXML(repo)
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 1482, in _commonLoadRepoXML
    result = self._getFileRepoXML(local, text)
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 1259, in _getFileRepoXML
    size=102400) # setting max size as 100K
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 1025, in _getFile
    result = self.grab.urlgrab(misc.to_utf8(relative), local,
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 703, in <lambda>
    grab = property(lambda self: self._getgrab())
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 698, in _getgrab
    self._setupGrab()
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 614, in _setupGrab
    ugopts = self._default_grabopts()
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 687, in _default_grabopts
    opts['proxies'] = self.proxy_dict
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 453, in __getProxyDict
    self.doProxyDict()
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 581, in doProxyDict
    proto, rest = re.match('(\w+://)(.+)', proxy_string).groups()
AttributeError: 'NoneType' object has no attribute 'groups'
I have no clue where this is from and I have been testing fixes from internet without success. Can you please help me to solve this ?

Thanks.

User avatar
TrevorH
Site Admin
Posts: 33221
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Yum : AttributeError: 'NoneType' object has no attribute 'groups'

Post by TrevorH » 2018/10/29 10:17:19

Post /etc/yum.conf
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Lokylax
Posts: 3
Joined: 2018/10/29 09:53:52

Re: Yum : AttributeError: 'NoneType' object has no attribute 'groups'

Post by Lokylax » 2018/10/29 10:24:54

I'm not sure I'm allowed to show you the proxy settings so I removed them.

Code: Select all

[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release

#  This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
#  It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: Yum : AttributeError: 'NoneType' object has no attribute 'groups'

Post by avij » 2018/10/29 13:21:18

Lokylax wrote:
2018/10/29 10:24:54
I'm not sure I'm allowed to show you the proxy settings so I removed them.
Well, the error message seems to be related to proxy. Try commenting out the proxy settings in /etc/yum.conf and see if the error message changes. It's possible that your proxy config string is invalid.

Lokylax
Posts: 3
Joined: 2018/10/29 09:53:52

Re: Yum : AttributeError: 'NoneType' object has no attribute 'groups'

Post by Lokylax » 2018/10/29 13:27:59

I tried and now I have an error 407

Code: Select all

[Errno 14] HTTP Error 407 - Proxy Authentication Required

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: Yum : AttributeError: 'NoneType' object has no attribute 'groups'

Post by avij » 2018/10/29 13:57:30

The correct syntax is:

Code: Select all

proxy=http://yourproxy.example.com:3128
proxy_username=yourusername
proxy_password=SomethingSecret
where yourproxy.example.com is your proxy's hostname and 3128 is the port (it can also be something else, like 8000 or 8080).

Does your username or password contain special characters such as backslashes, \ ? You may need to escape those, so change any \ to \\.

Post Reply