Bug 1318995 - foreman-debug does not collect /var/log/foreman-proxy/proxy.log
Summary: foreman-debug does not collect /var/log/foreman-proxy/proxy.log
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Foreman Debug
Version: 6.1.6
Hardware: x86_64
OS: Linux
medium
medium vote
Target Milestone: Unspecified
Assignee: Lukas Zapletal
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-18 11:15 UTC by Pavel Moravec
Modified: 2019-10-10 11:36 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-03-18 14:45:05 UTC
Target Upstream Version:


Attachments (Terms of Use)

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.


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