Yum problem

General support questions including new installations
spottraining
Posts: 3
Joined: 2007/02/21 13:27:33

Yum problem

Post by spottraining » 2009/05/12 09:10:59

Hi

I today discovered problem in one my VPS servers. I can't use yum update or any yum commands. Hera is the error:

[root@portal log]# yum clean all
Loaded plugins: fastestmirror
error: no dbpath has been set
error: cannot open Packages database in /%{_dbpath}
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in ?
yummain.user_main(sys.argv[1:], exit_code=True)
File "/usr/share/yum-cli/yummain.py", line 229, in user_main
errcode = main(args)
File "/usr/share/yum-cli/yummain.py", line 84, in main
base.getOptionsConfig(args)
File "/usr/share/yum-cli/cli.py", line 184, in getOptionsConfig
enabled_plugins=self.optparser._splitArg(opts.enableplugins))
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 191, in _getConfig
self._conf = config.readMainConfig(startupconf)
File "/usr/lib/python2.4/site-packages/yum/config.py", line 754, in readMainConfig
yumvars['releasever'] = _getsysver(startupconf.installroot, startupconf.distroverpkg)
File "/usr/lib/python2.4/site-packages/yum/config.py", line 824, in _getsysver
idx = ts.dbMatch('provides', distroverpkg)
TypeError: rpmdb open failed


I found, that this can be for some external packages and mirrors. But how I know - I don't have any external installed package - all is default CentOS template, what is regulary updated.

Only what I can remember - problem start after VPS main server move to other location (datacenter move).

What can be the solution?
CentOS is 5.3

Thanks

glennzo
Posts: 54
Joined: 2005/03/06 19:44:55

Re: Yum problem

Post by glennzo » 2009/05/12 09:42:48

Try
yum clean all
rm -f /var/lib/rpm/__db*
rpm --rebuilddb
yum update

spottraining
Posts: 3
Joined: 2007/02/21 13:27:33

Re: Yum problem

Post by spottraining » 2009/05/12 12:55:06

Still the same:

[root@portal ~]# rm -f /var/lib/rpm/__db*
[root@portal ~]# rpm --rebuilddb
[root@portal ~]# yum update
Loaded plugins: fastestmirror
error: no dbpath has been set
error: cannot open Packages database in /%{_dbpath}
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in ?
yummain.user_main(sys.argv[1:], exit_code=True)
File "/usr/share/yum-cli/yummain.py", line 229, in user_main
errcode = main(args)
File "/usr/share/yum-cli/yummain.py", line 84, in main
base.getOptionsConfig(args)
File "/usr/share/yum-cli/cli.py", line 184, in getOptionsConfig
enabled_plugins=self.optparser._splitArg(opts.enableplugins))
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 191, in _getConfig
self._conf = config.readMainConfig(startupconf)
File "/usr/lib/python2.4/site-packages/yum/config.py", line 754, in readMainConfig
yumvars['releasever'] = _getsysver(startupconf.installroot, startupconf.distroverpkg)
File "/usr/lib/python2.4/site-packages/yum/config.py", line 824, in _getsysver
idx = ts.dbMatch('provides', distroverpkg)
TypeError: rpmdb open failed
[root@portal ~]#

Paparaciz
Posts: 5
Joined: 2009/05/12 20:39:38

Re: Yum problem

Post by Paparaciz » 2009/05/12 20:53:07

i had the same problem
i don't know what exactly makes a problem.I manage 12 vps servers, and only one had that problem
solution is simple:

#rm /dev/urandom
#mknod -m 644 /dev/urandom c 1 9

that should solve problem

until second VPS reboot...

i don't find exact link to http://forum.openvz.org, but I completly solved problem by doing this on HN:
stop VPS
mknod --mode 644 /vz/private/100/lib/udev/devices/urandom c 1 9
start VPS

spottraining
Posts: 3
Joined: 2007/02/21 13:27:33

Re: Yum problem

Post by spottraining » 2009/05/13 06:09:21

Thanks

It works :)

ralf
Posts: 132
Joined: 2005/11/25 20:10:20

Re: Yum problem CentOs 5.3

Post by ralf » 2009/05/17 10:14:46

Hi.
I have the same problem but on a normal workstation CentOs5.3 installation when running yum.

[root@ralf temp]# yum update
...... >> checking all the updates and settings the correct files for updating (no mirror problems!), then I get:
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in ?
yummain.user_main(sys.argv[1:], exit_code=True)
File "/usr/share/yum-cli/yummain.py", line 229, in user_main
errcode = main(args)
File "/usr/share/yum-cli/yummain.py", line 145, in main
(result, resultmsgs) = base.buildTransaction()
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 647, in buildTransaction
(rescode, restring) = self.resolveDeps()
File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 704, in resolveDeps
for po, dep in self._checkFileRequires():
File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 939, in _checkFileRequires
if not self.tsInfo.getOldProvides(filename) and not self.tsInfo.getNewProvides(filename):
File "/usr/lib/python2.4/site-packages/yum/transactioninfo.py", line 414, in getNewProvides
for pkg, hits in self.pkgSack.getProvides(name, flag, version).iteritems():
File "/usr/lib/python2.4/site-packages/yum/packageSack.py", line 300, in getProvides
return self._computeAggregateDictResult("getProvides", name, flags, version)
File "/usr/lib/python2.4/site-packages/yum/packageSack.py", line 470, in _computeAggregateDictResult
sackResult = apply(method, args)
File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 861, in getProvides
return self._search("provides", name, flags, version)
File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 43, in newFunc
return func(*args, **kwargs)
File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 837, in _search
for pkg in self.searchFiles(name, strict=True):
File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 43, in newFunc
return func(*args, **kwargs)
File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 586, in searchFiles
self._sql_pkgKey2po(rep, cur, pkgs)
File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 470, in _sql_pkgKey2po
pkg = self._packageByKey(repo, ob['pkgKey'])
File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 413, in _packageByKey
po = self.pc(repo, cur.fetchone())
File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 68, in __init__
self._read_db_obj(db_obj)
File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 94, in _read_db_obj
setattr(self, item, _share_data(db_obj[item]))
TypeError: unsubscriptable object
[root@ralf temp]#

I have the following yum programs installed:

[root@ralf ~]# rpm -qa|grep yum
yum-updatesd-0.9-2.el5
yum-allowdowngrade-1.1.16-13.el5.centos
yum-changelog-1.1.16-13.el5.centos
yum-protectbase-1.1.16-13.el5.centos
yum-utils-1.1.16-13.el5.centos
yumex-2.0.3-2.el5.centos
yum-fastestmirror-1.1.16-13.el5.centos
yum-priorities-1.1.16-13.el5.centos
yum-3.2.19-18.el5.centos
yum-metadata-parser-1.1.2-2.el5
[root@ralf ~]#

What is wrong here? I have rebuilt the rpm db (rpm --rebuilddb) and reinstalled yum-3.2.19-18.el5.centos (using --force), but no change.
Any comments?

Thanks!

Paparaciz
Posts: 5
Joined: 2009/05/12 20:39:38

Re: Yum problem CentOs 5.3

Post by Paparaciz » 2009/05/17 14:44:27

this is other issue
#yum clean all
should solve problem

ralf
Posts: 132
Joined: 2005/11/25 20:10:20

Re: Yum problem CentOs 5.3

Post by ralf » 2009/05/17 14:55:04

Thanks! This solved the problem. I don't understand though what caused my problem.

Ralf

Zatupitel
Posts: 3
Joined: 2008/09/11 21:43:59

Re: Yum problem

Post by Zatupitel » 2009/08/15 21:43:17

Thanks! This solved the problem!

hablutzel1
Posts: 2
Joined: 2010/01/04 13:54:04
Contact:

Re: Yum problem

Post by hablutzel1 » 2010/01/04 13:56:47

I experienced the same problem today... but believe the problem was really subtle, I?m behind a proxy thus, I setted the http_proxy variable to x.x.x.x:y this way

export http_proxy=x.x.x.x:y

but the right way is:

export http_proxy=http://x.x.x.x:y

Now it works :)

Post Reply