Bug 1651799

Summary: var/log/foreman/dynflow_executor.output should be rotated
Product: Red Hat Satellite Reporter: sthirugn <sthirugn>
Component: LoggingAssignee: Lukas Zapletal <lzap>
Status: CLOSED ERRATA QA Contact: Stephen Wadeley <swadeley>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.4CC: akarimi, andrew.schofield, ehelms, lzap, michael.vishchers.extern, pcreech, swadeley
Target Milestone: 6.7.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-tasks-0.15.0-3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-14 13:23:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description sthirugn@redhat.com 2018-11-20 21:20:45 UTC
Description of problem:
var/log/foreman/dynflow_executor.output should be rotated

Version-Release number of selected component (if applicable):
Satellite 6.3.5

How reproducible:
Always

Steps to Reproduce:
1. Go to /var/log/foreman/dynflow_executor.output for a long time running satellite with a lot of tasks.
2. I came across a customer who had dynflow_executor.output of 2.6GB
3. Check /etc/logrotate.d/foreman - it accounts for the files with extension .log only and not .output.

# Foreman logs:
/var/log/foreman/*.log {
  daily
  missingok
  rotate 14
  compress
  delaycompress
  notifempty
  copytruncate
}

Actual results:
As explained above - dynflow_executor.output gets too large over time

Expected results:
dynflow_executor.output should be rotated like other foreman log files.

Additional info:

Comment 2 sthirugn@redhat.com 2018-11-20 22:28:40 UTC
Workaround: /etc/logrotate.d/foreman -> Replace '/var/log/foreman/*.log{' with '/var/log/foreman/*.log /var/log/foreman/*.output{'

Comment 3 Lukas Zapletal 2018-11-21 15:41:11 UTC
Hello,

I can confirm the workaround will work as long as "copytruncate" option is provided. This file is created by dynlfow/foreman-tasks and the process does not accept log reopen signal, so the only way rotating it is to use "copytruncate".

Comment 5 sthirugn@redhat.com 2018-11-21 20:43:33 UTC
(In reply to Lukas Zapletal from comment #3)
> Hello,
> 
> I can confirm the workaround will work as long as "copytruncate" option is
> provided. This file is created by dynlfow/foreman-tasks and the process does
> not accept log reopen signal, so the only way rotating it is to use
> "copytruncate".

Yes, I believe we provide `copytruncate` option as default.  The installs I verified all had this.

Comment 6 Brad Buckingham 2018-11-29 16:33:18 UTC
Fixing github link.

Comment 9 Lukas Zapletal 2019-03-13 14:03:47 UTC
Stephen,

the change linked from this BZ shows that a new file was added:

https://gitlab.sat.engineering.redhat.com/satellite6/satellite-packaging/merge_requests/2538/diffs

It should be placed in /etc/logrotate.d/(tfm-?)rubygem-dynflow.logrotate with the following contents:

/var/log/foreman/dynflow_executor.output {
  daily
  missingok
  rotate 14
  compress
  delaycompress
  notifempty
  copytruncate
}


So this should work out of box.

Comment 13 Lukas Zapletal 2019-03-21 13:39:20 UTC
I can confirm it's incorrect. It's a bugt, the file lives under incorrect folder.

Filed upstream: https://github.com/theforeman/foreman-packaging/pull/3533

Leaving NEED INFO on me I will be busy next week so after I can fix that.

Comment 20 Lukas Zapletal 2019-08-12 13:24:04 UTC
I forgot to attach the other PR: https://github.com/theforeman/foreman-packaging/pull/3533

sorry about that.

Comment 24 errata-xmlrpc 2020-04-14 13:23:48 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:1454