Bug 1230137 - pool-build a nfs pool will prompt unclear error when target dir exists
Summary: pool-build a nfs pool will prompt unclear error when target dir exists
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.2
Hardware: x86_64
OS: Linux
Target Milestone: rc
: ---
Assignee: Erik Skultety
QA Contact: Virtualization Bugs
Depends On:
TreeView+ depends on / blocked
Reported: 2015-06-10 10:40 UTC by yisun
Modified: 2015-11-19 06:41 UTC (History)
6 users (show)

Fixed In Version: libvirt-1.2.17-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2015-11-19 06:41:14 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2202 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2015-11-19 08:17:58 UTC

Description yisun 2015-06-10 10:40:59 UTC
nfs pool-build prompts unclear error when target dir exists


How reproducible:


1.#mkdir /a
2.# cat nfs_pool.xml
<pool type='netfs'>
  <capacity unit='bytes'>322122547200</capacity>
  <allocation unit='bytes'>161484570624</allocation>
  <available unit='bytes'>160637976576</available>
    <host name='nfs.server.name'/>
    <dir path='/path/to/dir'/>
    <format type='nfs'/>

3.# virsh pool-define nfs_pool.xml
Pool nfs_pool defined from nfs_pool.xml

4. # virsh pool-build nfs_pool
error: Failed to build pool nfs_pool
error: An error occurred, but the cause is unknown

Expected result:
In step 4:# virsh pool-build nfs_pool
error: Failed to build pool nfs_pool
error: failed to create directory '/a': File exists

Actual result:
message is unclear in step 4

Additional info:
If remove following xml segment,  clear error message will be generated.

Comment 1 Erik Skultety 2015-06-16 14:32:27 UTC
fixed upstream:

commit e9478d9a8b8ab2e4ffe1d7ed06395dd721647d55
Author: Erik Skultety <eskultet@redhat.com>
Date:   Thu Jun 11 10:51:23 2015 +0200

    util: virfile: Fix 'unknown cause' error if NFS mount point creation fails
    This happens if user requires creation of a directory with specified
    UID/GID permissions. To accomplish this, we use fork approach and
    set particular UID/GID permissions in child process. However, child
    process doesn't have a valid descriptor to a logfile (this is prohibited
    explicitly) and since parent process doesn't handle negative exit codes from
    child in any way, 'uknown cause' error is returned to the user.
    Commit 92d9114e tweaked the way we handle child errors when using fork
    approach to set specific permissions (features originally introduced
    by 98f6f381). The same logic should be used to create directories with
    specified permissions as well.


Comment 3 Yang Yang 2015-07-07 06:05:54 UTC
I can reproduce it.
Verified with libvirt-1.2.17-1.el7.x86_64

1.# virsh pool-dumpxml netfs
<pool type='netfs'>
  <capacity unit='bytes'>0</capacity>
  <allocation unit='bytes'>0</allocation>
  <available unit='bytes'>0</available>
    <host name=''/>
    <dir path='/var/lib/libvirt/images'/>
    <format type='auto'/>

2. # ll /tmp/nfs
total 0

3. # virsh pool-build netfs
error: Failed to build pool netfs
error: internal error: child failed to create '/tmp/nfs': exit status 17

Comment 5 errata-xmlrpc 2015-11-19 06:41:14 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.


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