Bug 1288197 - RHEV engine-log-collector with --local-tmp=PATH option deletes PATH once command is executed
Summary: RHEV engine-log-collector with --local-tmp=PATH option deletes PATH once comm...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-log-collector
Version: 3.5.4
Hardware: All
OS: Linux
high
urgent
Target Milestone: ovirt-3.6.3
: 3.6.3
Assignee: Rafael Martins
QA Contact: Gonza
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-12-03 19:20 UTC by Ameya Charekar
Modified: 2019-09-12 09:30 UTC (History)
13 users (show)

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.
Clone Of:
Environment:
Last Closed: 2016-03-09 20:00:53 UTC
oVirt Team: Integration
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2016:0392 0 normal SHIPPED_LIVE rhevm-log-collector bug fix and enhancement update 2016-03-10 00:19:00 UTC
oVirt gerrit 52480 0 master MERGED engine-log-collector: abort if --local-tmp is not empty 2016-01-22 11:56:49 UTC
oVirt gerrit 52609 0 ovirt-log-collector-3.6 MERGED engine-log-collector: abort if --local-tmp is not empty 2016-01-22 16:44:32 UTC

Description Ameya Charekar 2015-12-03 19:20:56 UTC
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:
Always


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 Allie DeVolder 2015-12-03 19:23:24 UTC
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 08:20:38 UTC
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 09:27:02 UTC
Verified with:
rhevm-log-collector-3.6.1-1.el6ev.noarch

# 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 20:00:53 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://rhn.redhat.com/errata/RHEA-2016-0392.html


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