Bug 1318995

Summary: foreman-debug does not collect /var/log/foreman-proxy/proxy.log
Product: Red Hat Satellite Reporter: Pavel Moravec <pmoravec>
Component: Foreman DebugAssignee: Lukas Zapletal <lzap>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1.6   
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-18 14:45:05 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:

Description Pavel Moravec 2016-03-18 11:15:56 UTC
Description of problem:
foreman-debug does not collect /var/log/foreman-proxy/proxy.log but just *gz files from that directory. While usually proxy.log capturing the recent capsule activity is of the most interest.

Please collect also proxy.log.


Version-Release number of selected component (if applicable):
foreman-debug-1.7.2.53-1.el7sat.noarch
(Sat6.1.7)


How reproducible:
100%


Steps to Reproduce:
rm -rf /tmp/foreman-debug-*
foreman-debug
tar xJvf /tmp/foreman-debug-* | grep var/log/foreman-proxy/proxy.log


Actual results:
tar output is empty


Expected results:
tar output to print:
foreman-debug-z4UXA/var/log/foreman-proxy/proxy.log


Additional info:

Comment 2 Pavel Moravec 2016-03-18 14:45:05 UTC
foreman-debug does collect /var/log/foreman-proxy/proxy.log by default. It does not collect empty files, though:

add_files() {
  for FILE in $*; do
    if [ \( -f "$FILE" -o -h "$FILE" \) -a \( -r "$FILE" -a -s "$FILE" \) ]; then
      printv " - $FILE"
      SUBDIR=$(dirname $FILE)
      [ ! -d "$DIR$SUBDIR" ] && mkdir -p "$DIR$SUBDIR"
      tail -n "$MAXLINES" "$FILE" | sed -r "$FILTER" > "$DIR$FILE"
      [ $PRINTPASS -eq 1 ] && grep -E "($FILTER_WORDS_STR)" "$DIR$FILE"
    fi
  done
}

See -s (a size greater than zero) test.

Confirmed when proxy.log is not empty, it is collected.