Bug 1034907 - production.log does not rotate
Summary: production.log does not rotate
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Subscription Asset Manager
Classification: Retired
Component: katello
Version: 1.3
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Katello Bug Bin
QA Contact: SAM QE List
URL:
Whiteboard:
Depends On:
Blocks: sam20-tracker
TreeView+ depends on / blocked
 
Reported: 2013-11-26 17:01 UTC by Chris Duryee
Modified: 2016-11-30 13:44 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-11-30 13:44:55 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 633103 0 None None None Never

Description Chris Duryee 2013-11-26 17:01:20 UTC
Description of problem:

If a user has a SAM instance that has been running for awhile (either 1 week or 2 weeks, not sure yet), proudction.log will not get rolled and will get stuck. Logs will look like this:

]# ls -ltrh /var/log/katello/production.log*
-rw-r--r--. 1 root    root     0 Nov 26 10:34 /var/log/katell/production.log.age
-rw-r-----. 1 katello katello 88 Nov 26 10:38 /var/log/katello/production.log._copy_
-rw-r-----. 1 katello katello  0 Nov 26 10:38 /var/log/katello/production.log

Note the zero-byte production.log

Version-Release number of selected component (if applicable): sam 1.3


How reproducible: every time

Steps to Reproduce:
1. set up sam
2. do something that causes output to production.log
3. wait for rotate to happen (1 week by default)
4. do something else to cause output to production.log

Actual results:

production.log will be zero-byte and will not get updates at this point. This makes it difficult to debug other issues, especially katello-debug output.

Expected results:

production.log gets rolled successfully


Additional info:

I suspect that when katello-configure runs, it creates a production.log.age file as root. However, katello runs as katello user, so it cannot clear out this file when performing a log rotation.

Here is a way to repro without waiting a week:

* set up SAM as usual, running katello-configure
* edit /usr/share/katello/config/katello_defaults.yml, change "age: 'weekly'" to "age: 30", which will rotate every 30 sec
* bounce katello
* start up rails console as katello user (sudo su - katello -s /bin/bash, then start console)
* Rails.logger.warn("foo")
* wait 30+ sec for log to rotate
* Rails.logger.warn("foofoo")
* quit console
* check production.log, foofoo message will not appear

This command appears to work around the issue:

chown katello.katello /var/log/katello/production.log.age

Comment 1 Xixi 2013-12-04 04:18:03 UTC
KCS solution in Knowledgebase: https://access.redhat.com/site/solutions/633103

Comment 2 Chris Duryee 2016-11-30 13:44:55 UTC
closing out older bug, any new implementation would very likely not hit this.

I am marking as closed/wontfix, but feel free to re-open if needed.


Note You need to log in before you can comment on or make changes to this bug.