Bug 628963

Summary: /var/cache/yum periodically filling up
Product: Red Hat Enterprise Linux 5 Reporter: Dennis Ortsen <dortsen>
Component: yumAssignee: James Antill <james.antill>
Status: CLOSED ERRATA QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 5.5CC: anshockm, cww, ddumas, dgregor, ebenes, inode0, jhutar, ksrot, ldelhage, mosvald, ndevos, plancashire, plyons, seekalprashu, syamasundar.bupur, tao
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 632391 (view as bug list) Environment:
Last Closed: 2011-01-13 22:12:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 646982    

Description Dennis Ortsen 2010-08-31 14:26:48 UTC
Description of problem:
on all our RHEL5 servers, /var/cache/yum fills up with sqlite files. We haven't performed any recent yum request or command, by hand or automatically (cron for example). On every day, two sqlite files are added, around 25 MB in size. the filenames are unique. An example:

/var/cache/yum/rhel-i386-server-5# ls -ltrh
total 246M
drwxr-xr-x 2 root root 1.0K Jun 27  2008 headers
-rw-r--r-- 1 root root  25M Aug 11 17:24 884e1ab88b7ff9d73cb753b0ecf8a6b64d186f0d-primary.xml.gz.sqlite
-rw-r--r-- 1 root root  25M Aug 12 01:24 c0177689c2bd3e5f4d7d0bb83dbe6d1ff85a78e7-primary.xml.gz.sqlite
-rw-r--r-- 1 root root  25M Aug 12 09:24 87b643feda4ecb2501a148be00b8ca898fa5e61a-primary.xml.gz.sqlite
-rw-r--r-- 1 root root  25M Aug 13 17:02 4e16200c14addb78d8a990ab72451bf6e7dbb04e-primary.xml.gz.sqlite
-rw-r--r-- 1 root root  25M Aug 23 10:20 c06e93c323308c3b5eec5a2ece6f0e2d0282e5cf-primary.xml.gz.sqlite
-rw-r--r-- 1 root root  25M Aug 24 02:20 b0dedffd33caaad5db7489e97f3a286bdf7a4b7d-primary.xml.gz.sqlite
-rw-r--r-- 1 root root  25M Aug 24 10:20 4c16cc09c7cce4d0a6cdd4616483bce69f0058a1-primary.xml.gz.sqlite
-rw-r--r-- 1 root root  25M Aug 25 03:09 e4d34c13365eb035521e63bbb74a7d8b0540b875-primary.xml.gz.sqlite
-rw-r--r-- 1 root root  25M Aug 25 19:10 4bde5ac9c9c5c1e2a0e96d5a97b7672ab75d436b-primary.xml.gz.sqlite
drwxr-xr-x 2 root root 6.0K Aug 30 10:42 packages
-rw-r--r-- 1 root root 1.5K Aug 30 15:38 repomd.xml
-rw-r--r-- 1 root root 3.0M Aug 30 15:38 4686da25d73a218058eaf57d81acfdeb22a27de1-primary.xml.gz
-rw-r--r-- 1 root root  25M Aug 30 18:54 4686da25d73a218058eaf57d81acfdeb22a27de1-primary.xml.gz.sqlite
-rw-r--r-- 1 root root    0 Aug 31 10:54 cachecookie

This happens on both recently updated and newly installed servers, as on servers that haven't been updated a while ago. This behaviour makes me wonder whether it's a local yum or yum plugin-problem, or something that is initiated from the RHN, through yum-updatesd since a few weeks.

Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux Server release 5.5 (Tikanga)

How reproducible:
on all servers, just sit and wait and you should see about 1, 2 or more unique xml.gz.sqlite files appear on every day.

Steps to Reproduce:
1. Install a new RHEL5.5 or take any existing RHEL 5.5 or RHEL5.4 installation
2. register at RHN
3. sit back and look in /var/cache/yum after a few days
Actual results:
unique -primary.xml.gz.sqlite files (around 25 MB) appear every day in /var/cache/yum, sometimes 1, 2 or more per day.

Expected results:
I don't know the previous behaviour, but no more than two of those primary.xml.gz.sqlite files should be present. The previous one and the one that is being updated before the previous one is replaced.

Additional info:
if needed, contact me by e-mail.

Comment 1 seth vidal 2010-08-31 14:51:05 UTC
Do you have yum-updatesd running? and/or the rhn auto-check?

B/c that would cause it to grab a new one each time the repo updates.

if you run: yum clean metadata

does it clean them all up?

Comment 2 Pete Lancashire 2010-08-31 20:10:27 UTC
This issue has just started on one of my RHEL5 boxes. Will be checking the others.

A clean metadata works for me


Comment 3 John T. Rose 2010-08-31 21:16:38 UTC
I believe this started when the CDN support was added. clean dbcache takes care of it but otherwise they seem to just accumulate now. If I remember correctly before the CDN changes the sqlite files were updated in place (using the same filename anyway). Thanks for looking into it.

Comment 4 Dennis Ortsen 2010-09-01 07:33:28 UTC
@ seth vidal:

both services (yum-updatesd and rhnsd) are running:

# chkconfig --list yum-updatesd
yum-updatesd   	0:off	1:off	2:off	3:on	4:on	5:on	6:off
# chkconfig --list rhnsd
rhnsd          	0:off	1:off	2:on	3:on	4:on	5:on	6:off

and the command: yum clean metadata does indeed clean all the sqlite files up:


/var/cache/yum/rhel-i386-server-5# ls -l

/var/cache/yum/rhel-i386-server-5# yum clean metadata
Loaded plugins: rhnplugin
8 metadata files removed
30 sqlite files removed
0 metadata files removed
/var/cache/yum/rhel-i386-server-5# ls -l
total 4
drwxr-xr-x 2 root root 4096 Aug 30 10:38 packages


Comment 5 James Antill 2010-09-08 17:33:03 UTC
Yes, this appears to be a bug even in the latest upstream yum. With XML only repodata + unique filenames, yum doesn't delete the generated .sqlite.

Comment 6 James Antill 2010-09-09 20:05:28 UTC
Ok, I have a patch for this ... much simpler than I feared.

Comment 7 James Antill 2010-09-09 20:45:56 UTC
This is the upstream patch:


...it will probably even apply to RHEL-5.

Comment 8 Dennis Ortsen 2010-09-10 12:33:35 UTC
(In reply to comment #7)
> This is the upstream patch:
> http://yum.baseurl.org/gitweb?p=yum.git;a=commitdiff;h=a98056413cb52dee8f9bb41bb14b9b708866a349
> ...it will probably even apply to RHEL-5.

I have applied the patch to several RHEL5 machines, I will keep you posted about the results. 

Thank you.

Comment 14 Dennis Ortsen 2010-09-17 07:14:48 UTC
I can confirm the patch works on several machines.

Comment 17 James Antill 2010-10-25 13:04:47 UTC
*** Bug 635010 has been marked as a duplicate of this bug. ***

Comment 24 errata-xmlrpc 2011-01-13 22:12:41 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Comment 25 Prashanth 2016-10-21 08:26:18 UTC
Hi All ,

Though i run the upstream patch above , the var directory is getting filled again with sqllite files.

Any advice please


Comment 26 Karel Srot 2016-10-21 08:33:34 UTC
This bug is supposed to be fixed for 5 years already. If you are encountering the issue on any recent RHEL release please open a new bug report providing the release & package versions. Even better would be to escalate the problem through the customer support.