Bug 1688481 - Traceback IsADirectoryError on vdo create --logfile=$directory
Summary: Traceback IsADirectoryError on vdo create --logfile=$directory
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: vdo
Version: 7.7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: John Wiele
QA Contact: Jakub Krysl
URL:
Whiteboard:
Depends On: 1679224
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-13 19:54 UTC by John Wiele
Modified: 2019-08-06 13:08 UTC (History)
5 users (show)

Fixed In Version: 6.1.2.41
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1679224
Environment:
Last Closed: 2019-08-06 13:08:20 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:2233 None None None 2019-08-06 13:08:25 UTC

Description John Wiele 2019-03-13 19:54:58 UTC
+++ This bug was initially created as a clone of Bug #1679224 +++

Description of problem:
Using --logfile with existing directory as value produces uncaught traceback.

Version-Release number of selected component (if applicable):
vdo-6.2.0.293-10.el8.x86_64

How reproducible:
100%

Steps to Reproduce:
1.vdo create --logfile='/mnt/vdo_test' --device='/dev/mapper/vg-lv' --name='vdo_test'

Actual results:
Traceback (most recent call last):                                                            
  File "/usr/bin/vdo", line 150, in <module>
    main()                                                                                    
  File "/usr/bin/vdo", line 115, in main                                                     
    arguments.logfile, arguments.debug)                                                      
  File "/usr/bin/vdo", line 70, in configureLogger                                           
    handler = logging.FileHandler(logfile)                                                   
  File "/usr/lib64/python3.6/logging/__init__.py", line 1032, in __init__                    
    StreamHandler.__init__(self, self._open())                                                                                                                                                                    
  File "/usr/lib64/python3.6/logging/__init__.py", line 1061, in _open                                                                                                                                            
    return open(self.baseFilename, self.mode, encoding=self.encoding)
IsADirectoryError: [Errno 21] Is a directory: '/mnt/vdo_test'

Expected results:
vdo: ERROR - [Errno 21] Is a directory: '/mnt/vdo_test' 

Additional info:

--- Additional comment from Dennis Keefe on 2019-02-20 19:24:13 UTC ---

I was able to reproduce this issue.  The open --logfile works fine, but if you create a directory with the same path and name, then create the vdo volume a traceback is seen.

Comment 3 Jakub Krysl 2019-05-27 11:08:01 UTC
# rpm -qa vdo
vdo-6.1.2.41-4.el7.x86_64

# vdo create --logfile='/mnt/vdo_test' --device='/dev/sda' --name='vdo_test'
usage: vdo create [-h] -n <volume> --device <devicepath>
                  [--activate {disabled,enabled}]
                  [--blockMapCacheSize <megabytes>]
                  [--blockMapPeriod <period>]
                  [--compression {disabled,enabled}]
                  [--deduplication {disabled,enabled}]
                  [--emulate512 {disabled,enabled}] [--force]
                  [--indexMem <gigabytes>] [--readCache {disabled,enabled}]
                  [--readCacheSize <megabytes>]
                  [--sparseIndex {disabled,enabled}]
                  [--vdoAckThreads <threadCount>]
                  [--vdoBioRotationInterval <ioCount>]
                  [--vdoBioThreads <threadCount>]
                  [--vdoCpuThreads <threadCount>]
                  [--vdoHashZoneThreads <threadCount>]
                  [--vdoLogicalSize <megabytes>]
                  [--vdoLogicalThreads <threadCount>]
                  [--vdoLogLevel {critical,error,warning,notice,info,debug}]
                  [--vdoPhysicalThreads <threadCount>]
                  [--vdoSlabSize <megabytes>]
                  [--writePolicy {async,sync,auto}] [-f <file>]
                  [--logfile <pathname>] [--verbose]
vdo create: error: argument --logfile: /mnt/vdo_test is a directory

Comment 5 errata-xmlrpc 2019-08-06 13:08:20 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://access.redhat.com/errata/RHBA-2019:2233


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