Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1994978

Summary: Targeted "must-gather" log collection creates empty files for irrelevant logs
Product: Migration Toolkit for Virtualization Reporter: Maayan Hadasi <mguetta>
Component: Must-GatherAssignee: Fabien Dupont <fdupont>
Status: CLOSED ERRATA QA Contact: Maayan Hadasi <mguetta>
Severity: medium Docs Contact: Avital Pinnick <apinnick>
Priority: medium    
Version: 2.1.0CC: apinnick, fdupont, istein, maufart
Target Milestone: ---   
Target Release: 2.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-12-09 19:20:56 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 Maayan Hadasi 2021-08-18 08:55:42 UTC
Description of problem:
When running 'oc adm must-gather' with forklift image --image=quay.io/konveyor/forklift-must-gather:latest,
the log files created under /must-gather/namespaces/openshift-cnv/logs and /must-gather/namespaces/openshift-mtv/logs are empty

oc command that was used: $ oc adm must-gather --image=quay.io/konveyor/forklift-must-gather:latest -- PLAN=mguetta-test /usr/bin/targeted

$ tree -d must-gather/ 
must-gather/
└── namespaces
    ├── mguetta
    │   └── crs
    │       ├── datavolume
    │       ├── virtualmachine
    │       └── virtualmachineimport
    ├── openshift-cnv
    │   └── logs
    │       ├── cdi-apiserver-8649f9764b-9rrkh
    │       ├── cdi-deployment-54b56d9fbf-2bbkv
    │       ├── cdi-operator-759f4977cd-hfdzf
    │       ├── cdi-uploadproxy-8f9c6b68b-jw99z
    │       ├── vm-import-controller-7567c7b868-xhcz9
    │       └── vm-import-operator-7d555df844-5tb97
    └── openshift-mtv
        ├── crs
        │   └── plan
        └── logs
            ├── forklift-controller-7fdf79598d-58hrq
            ├── forklift-operator-5c594c977b-wc8m6
            ├── forklift-ui-564b5649c-xrsdm
            ├── forklift-validation-7d7d47bc9-xw2zm
            ├── virt-launcher-v2v-migration-rhel8-2disks2nics-p7ktv
            └── virt-launcher-v2v-migration-win2019-p4hfv



Version-Release number of selected component (if applicable):
mtv-operator-bundle-container-2.1.0-52 iib 98758


How reproducible:
100%


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Marek Aufart 2021-08-18 11:58:02 UTC
Thanks for reporting and also providing environment for debugging!

The empty logs are caused by targeted gathering logs filtering where not relevant lines were found in such log files. When using must-gather without targeted command, logs files look well to me.

I'd suggest re-test this without targeted command.

Comment 2 Marek Aufart 2021-08-18 11:58:32 UTC
E.g. oc adm must-gather --image=quay.io/konveyor/forklift-must-gather:latest

Comment 3 Maayan Hadasi 2021-08-18 14:15:05 UTC
(In reply to Marek Aufart from comment #2)
> E.g. oc adm must-gather --image=quay.io/konveyor/forklift-must-gather:latest

Using this command, the collected files under must-gather/namespaces/openshift-cnv/logs/ and must-gather/namespaces/openshift-mtv/logs/ look fine

$ tree -s must-gather/namespaces/openshift-mtv/logs/
must-gather/namespaces/openshift-mtv/logs/
├── [         45]  forklift-controller-7fdf79598d-58hrq
│   ├── [     299354]  current.log
│   └── [        131]  previous.log
├── [         45]  forklift-operator-5c594c977b-wc8m6
│   ├── [     134335]  current.log
│   └── [        136]  previous.log
├── [         45]  forklift-ui-564b5649c-xrsdm
│   ├── [       1336]  current.log
│   └── [        123]  previous.log
├── [         45]  forklift-validation-7d7d47bc9-xw2zm
│   ├── [    3863051]  current.log
│   └── [        139]  previous.log
├── [         45]  virt-launcher-v2v-migration-rhel8-2disks2nics-p7ktv
│   ├── [      37933]  current.log
│   └── [        143]  previous.log
└── [         45]  virt-launcher-v2v-migration-win2019-p4hfv
    ├── [     188567]  current.log
    └── [        133]  previous.log

Comment 4 Fabien Dupont 2021-10-12 11:37:49 UTC
@mguetta, is there anything else expected?

Comment 5 Maayan Hadasi 2021-10-13 07:29:50 UTC
(In reply to Fabien Dupont from comment #4)
> @mguetta, is there anything else expected?

This issue is relevant for must-gather targeted version

Comment 6 Marek Aufart 2021-10-21 13:00:05 UTC
Empty files are caused by targeted filtering conditions when the file didn't contain lines matching to given target.

Added automatic empty files&directories removal in https://github.com/konveyor/forklift-must-gather/pull/14 (merged and backported)

Comment 7 Fabien Dupont 2021-10-22 07:08:40 UTC
Please verify with mtv-operator-bundle-2.2.0-63 / iib:127756, or later.

Comment 8 Maayan Hadasi 2021-11-01 15:05:18 UTC
The issue was tested and reproduced with MTV 2.2.0-69 / iib:130005
According to maufart, the fix was not included in this version

Comment 9 Marek Aufart 2021-11-02 06:20:29 UTC
The forklift-must-gather image has been rebuilt for release-2.2.0 branch, ready for test now. Thanks Franco!

Comment 10 Maayan Hadasi 2021-11-08 11:09:54 UTC
Verified as fixed.

Versions:
MTV 2.2.0-80 / iib:132252
CNV 4.9.1-11 / iib:131992

Comment 13 errata-xmlrpc 2021-12-09 19:20:56 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 (MTV 2.2.0 Images), 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/RHEA-2021:5066