Bug 487613

Summary: zypp-refresh.log grows without bounds
Product: [openSUSE] openSUSE 11.0 Reporter: Marcus Meissner <meissner>
Component: libzyppAssignee: Jan Kupec <jkupec>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P3 - Medium CC: dmacvicar, hmuelle, infonovell
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard: .
Found By: Customer Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Proposed patch for /etc/logrotate.d/zypper.lr

Description Marcus Meissner 2009-03-22 13:12:12 UTC
/var/log/zypp-refresh.log grows without bounds and being rotated.

ls -la zypp-refresh.log 
-rw-r----- 1 root root 37105638 21. Mär 23:05 zypp-refresh.log

and the first entry is:
2009-01-11 21:32:51 <1> galeere(14753) [zypp] ZYppFactory.cc(zyppLocked):269 no lockfile /var/run/zypp.pid found


it should have rotated the logfile, e.g. via logrotate snippet.
Comment 1 Rodney Baker 2009-03-22 20:43:53 UTC
Created attachment 281087 [details]
Proposed patch for /etc/logrotate.d/zypper.lr

The attached additions to /etc/logrotate.d/zypper.lr should ensure that the logfile gets rotated along with /var/log/zypper.log (credit to David Rankin drankinatty@suddenlinkmail.com for this).
Comment 2 Robert Williams 2009-03-24 11:07:24 UTC
This bug also affects openSUSE 11.1
Comment 3 Jan Kupec 2009-03-30 09:43:17 UTC
No wonder it does not work in 11.0 (zypp-refresh.lr was not there yet), but in 11.1 there is /etc/logrotate.d/zypp-refresh.lr with content as suggested by the patch in c#11. Robert, are you sure it does not work in 11.1?
Comment 5 Jan Kupec 2009-03-30 10:06:28 UTC
Robert: certainly works for me. Maybe you do not run logrotate from cron or something?

$ ll -h /var/log/zypp-refresh.log
-rw-r----- 1 root root 12M Mar 30 11:55 /var/log/zypp-refresh.log
$ /etc/cron.daily/logrotate
$ ll -h /var/log/zypp-refresh.log
ls: cannot access /var/log/zypp-refresh.log: No such file or directory
$ ll /var/log/zypp-refresh.log-20090330.bz2
-rw-r----- 1 root root 277413 Mar 30 12:03 /var/log/zypp-refresh.log-20090330.bz2
Comment 6 Robert Williams 2009-03-31 09:40:40 UTC
We're now entering unknown waters, for me. Is running logrotate something the user should setup, or should it be setup automatically when the system is installed? I can't find anything to suggest it's scheduled in root's entry in KCron.

#ll -h /var/log/zypp-refresh.log
-rw-r----- 1 root root 2.1M Jan  7 20:14 /var/log/zypp-refresh.log
#/etc/cron.daily/logrotate
error: zypper.lr:13 duplicate log entry for /var/log/zypp-refresh.log
error: found error in /var/log/zypp-refresh.log , skipping

Before I read the thread on the opensuse mailing list, my zypp-refresh.log had grown to 9.2GB, leaving /var/log 'out of space'. Since applying David Rankin's fix, it has remained at 2.1MB. However, the lines I've pasted above seem to suggest the file is corrupted in some way.
Comment 7 Jan Kupec 2009-03-31 10:38:49 UTC
Thanx for the info, it's beginning to make sense.

(In reply to comment #6)
> We're now entering unknown waters, for me. Is running logrotate something the
> user should setup, or should it be setup automatically when the system is
> installed? I can't find anything to suggest it's scheduled in root's entry in
> KCron.

No, it should be set up automatically. You seem to have it in place (the script in cron.daily dir).

> #ll -h /var/log/zypp-refresh.log
> -rw-r----- 1 root root 2.1M Jan  7 20:14 /var/log/zypp-refresh.log
> #/etc/cron.daily/logrotate
> error: zypper.lr:13 duplicate log entry for /var/log/zypp-refresh.log
> error: found error in /var/log/zypp-refresh.log , skipping

This indicates that since applying David's fix you have two logrotate entries for zypp-refresh.log, thus _now_ is the log allowed to grow indefinitely.

> Before I read the thread on the opensuse mailing list, my zypp-refresh.log had
> grown to 9.2GB, leaving /var/log 'out of space'.

The size suggests that there was some kind of erroneous massive logging, i suspect bug 469872 (fixed, an update for 11.1 is pending). So the file has grown up in very short time, well before cron could execute logrotate.

> Since applying David Rankin's
> fix, it has remained at 2.1MB. However, the lines I've pasted above seem to
> suggest the file is corrupted in some way.

This is the only thing thing that still puzzles me :O) I guess you removed the huge file manually and the log did not grow too much since then?
Comment 8 Robert Williams 2009-03-31 10:46:52 UTC
Yes, I removed the huge file manually. Since then, it seems to stay constant at 2.1M. I shall now remove the Rankin fix, as it's duplicated.

Many thanks.
Comment 9 Jan Kupec 2009-03-31 11:19:00 UTC
OK, thanx. Note that until you apply the fix of bug 469872, which is yet to be released, the log can eventually grow again (it happens on network timeouts).

As for this bug report, it is fixed in 11.1, and i suggest to leave it unfixed for 11.0. As this is reported for 11.0, closing as WONTFIX.
Comment 13 Swamp Workflow Management 2009-04-03 16:22:56 UTC
The SWAMPID for this issue is 23697.
Please submit the patch and patchinfo file using this ID.
(https://swamp.suse.de/webswamp/wf/23697)
Comment 14 Harald Mueller-Ney 2009-04-03 16:32:44 UTC
Release needinfo
Comment 15 Jan Kupec 2009-04-07 17:07:48 UTC
package (zypper-0.11.11) and patchinfo submitted
Comment 16 Harald Mueller-Ney 2009-04-08 09:04:33 UTC
We rejected the patchinfo for now. 
With openSUSE 11.0 the complete update stack needs to be released. Duncan is coordinating this usually.

Duncan, do you we have more issue for openSUSE 11.0 update stack?
Comment 18 Harald Mueller-Ney 2009-04-09 09:14:51 UTC
Ask for a new SWAMP ID if you are ready for an openSUSE 11.0 update stack update.
Comment 21 Swamp Workflow Management 2009-04-15 12:12:45 UTC
The SWAMPID for this issue is 23903.
Please submit the patch and patchinfo file using this ID.
(https://swamp.suse.de/webswamp/wf/23903)
Comment 24 Swamp Workflow Management 2009-04-21 15:08:36 UTC
Update released for: zypper
Products:
openSUSE 11.0 (debug, i386, ppc, x86_64)
Comment 25 Jan Kupec 2009-04-22 07:36:33 UTC
Closing then.