Bug 1288197 - RHEV engine-log-collector with --local-tmp=PATH option deletes PATH once command is executed
RHEV engine-log-collector with --local-tmp=PATH option deletes PATH once comm...
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-log-collector (Show other bugs)
All Linux
high Severity urgent
: ovirt-3.6.3
: 3.6.3
Assigned To: Rafael Martins
: Rebase
Depends On:
  Show dependency treegraph
Reported: 2015-12-03 14:20 EST by Ameya Charekar
Modified: 2016-03-09 15:00 EST (History)
13 users (show)

See Also:
Fixed In Version: rhevm-log-collector-3.6.1-1
Doc Type: Rebase: Bug Fixes and Enhancements
Doc Text:
The engine-log-collector command option --local-tmp has been updated. When using this option to point to a temporary directory, ensure the directory is empty before running the log collector. If the local temporary directory pointed by the --local-tmp option is not empty, the command will exit with an error.
Story Points: ---
Clone Of:
Last Closed: 2016-03-09 15:00:53 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: Integration
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 52480 master MERGED engine-log-collector: abort if --local-tmp is not empty 2016-01-22 06:56 EST
oVirt gerrit 52609 ovirt-log-collector-3.6 MERGED engine-log-collector: abort if --local-tmp is not empty 2016-01-22 11:44 EST
Red Hat Product Errata RHEA-2016:0392 normal SHIPPED_LIVE rhevm-log-collector bug fix and enhancement update 2016-03-09 19:19:00 EST

  None (edit)
Description Ameya Charekar 2015-12-03 14:20:56 EST
Description of problem:
When we are running engine-log-collector with option --local-tmp which is used for storing temporary reports gathered from hypervisors, the directory used --local-tmp is deleted with all data currently present in it.

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

How reproducible:

Steps to Reproduce:
1. Make a directory, add some test files in directory
e.g. mkdir /test; touch /test/file{1..10}.txt
2. Use above created directory while running engine-log-collector in option --local-tmp 
e.g. engine-log-collector --local-tmp=/test collect
3. After successful execution of command now /test directory is deleted

Actual results:
Directory is completely deleted 

Expected results:
Only files gathered from hypervisor should be deleted

Additional info:
If we are using --local-tmp=/test/tmp then only tmp directory with all of its content is deleted.
Comment 1 Allan Voss 2015-12-03 14:23:24 EST
If this behavior is intentional, than the -h output should be more clear. Currently, it states as follows:

 --local-tmp=PATH      directory to copy reports to locally. Please note that
                        the local-tmp directory is used only for storing
                        temporary reports gathered from hypervisors.(default
                        is randomly generated like: /tmp/logcollector-PelSIq)

If this directory will always be deleted, it should be clearly stated here that the directory will be removed upon completion, and that the directory should be empty.
Comment 3 Yedidyah Bar David 2016-01-20 03:20:38 EST
I think we should keep existing behavior, and:
1. Fix --help
2. Require the directory to be empty and abort otherwise
Comment 5 Gonza 2016-02-02 04:27:02 EST
Verified with:

# engine-log-collector collect --local-tmp=./tmp
This command will collect system configuration and diagnostic
information from this system.
The generated archive may contain data considered sensitive and its
content should be reviewed by the originating organization before
being passed to any third party.
No changes will be made to system configuration.
ERROR: ./tmp directory is not empty.
Use the -h option to see usage.
Comment 7 errata-xmlrpc 2016-03-09 15:00:53 EST
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.


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