Permissions error when configuring nfs backend

Bug #1593622 reported by Ji.Wei
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Ji.Wei

Bug Description

When I configure NFS backend and restart the cinder-volume service

2016-06-17 23:58:01.659 ERROR cinder.volume.drivers.remotefs [req-8d66b4fb-3d13-433d-acfa-67a51c4b01ca None None] Exception during mounting Unexpected error while running command.
Command: sudo cinder-rootwrap /etc/cinder/rootwrap.conf mkdir -p /opt/stack/data/cinder/mnt/afb79698dbf2b2a015daacbc8330de97
Exit code: 99
Stdout: u''
Stderr: u'/usr/bin/cinder-rootwrap: Unauthorized command: mkdir -p /opt/stack/data/cinder/mnt/afb79698dbf2b2a015daacbc8330de97 (no filter matched)\n'
2016-06-17 23:58:01.780 ERROR oslo_service.service [req-8d66b4fb-3d13-433d-acfa-67a51c4b01ca None None] Error starting thread.
2016-06-17 23:58:01.780 TRACE oslo_service.service Traceback (most recent call last):
2016-06-17 23:58:01.780 TRACE oslo_service.service File "/usr/lib/python2.7/site-packages/oslo_service/service.py", line 708, in run_service
2016-06-17 23:58:01.780 TRACE oslo_service.service service.start()
2016-06-17 23:58:01.780 TRACE oslo_service.service File "/opt/stack/cinder/cinder/service.py", line 177, in start
2016-06-17 23:58:01.780 TRACE oslo_service.service self.manager.init_host_with_rpc()
2016-06-17 23:58:01.780 TRACE oslo_service.service File "/opt/stack/cinder/cinder/volume/manager.py", line 524, in init_host_with_rpc
2016-06-17 23:58:01.780 TRACE oslo_service.service stats = self.driver.get_volume_stats(refresh=True)
2016-06-17 23:58:01.780 TRACE oslo_service.service File "/opt/stack/cinder/cinder/volume/drivers/remotefs.py", line 504, in get_volume_stats
2016-06-17 23:58:01.780 TRACE oslo_service.service self._update_volume_stats()
2016-06-17 23:58:01.780 TRACE oslo_service.service File "/opt/stack/cinder/cinder/volume/drivers/nfs.py", line 432, in _update_volume_stats
2016-06-17 23:58:01.780 TRACE oslo_service.service provisioned_capacity = self._get_provisioned_capacity()
2016-06-17 23:58:01.780 TRACE oslo_service.service File "/opt/stack/cinder/cinder/volume/drivers/remotefs.py", line 206, in _get_provisioned_capacity
2016-06-17 23:58:01.780 TRACE oslo_service.service run_as_root=True)
2016-06-17 23:58:01.780 TRACE oslo_service.service File "/opt/stack/cinder/cinder/utils.py", line 148, in execute
2016-06-17 23:58:01.780 TRACE oslo_service.service return processutils.execute(*cmd, **kwargs)
2016-06-17 23:58:01.780 TRACE oslo_service.service File "/usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py", line 389, in execute
2016-06-17 23:58:01.780 TRACE oslo_service.service cmd=sanitized_cmd)
2016-06-17 23:58:01.780 TRACE oslo_service.service ProcessExecutionError: Unexpected error while running command.
2016-06-17 23:58:01.780 TRACE oslo_service.service Command: sudo cinder-rootwrap /etc/cinder/rootwrap.conf du --bytes /opt/stack/data/cinder/mnt/afb79698dbf2b2a015daacbc8330de97
2016-06-17 23:58:01.780 TRACE oslo_service.service Exit code: 1
2016-06-17 23:58:01.780 TRACE oslo_service.service Stdout: u''
2016-06-17 23:58:01.780 TRACE oslo_service.service Stderr: '/bin/du: cannot access \xe2\x80\x98/opt/stack/data/cinder/mnt/afb79698dbf2b2a015daacbc8330de97\xe2\x80\x99: No such file or directory\n'

Ji.Wei (jiwei)
Changed in cinder:
assignee: nobody → Ji.Wei (jiwei)
Revision history for this message
hongzhezheng (zheng-hongzhe32) wrote :

It seems you should add root right for mkdir command manual in volume.filters file.Just like this:

    mkdir: CommandFilter, mkdir, root

The root right for mkdir should be added acquiescently,i thinks it's a bug.

Ji.Wei (jiwei)
Changed in cinder:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/331390

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/331390
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=36ce6260b398ee2446e3ebef5fb55b1e21d0f4e3
Submitter: Jenkins
Branch: master

commit 36ce6260b398ee2446e3ebef5fb55b1e21d0f4e3
Author: Ji-Wei <email address hidden>
Date: Sat Jun 18 12:31:36 2016 +0800

    Fix permissions error when configuring nfs backend

    Configuring nfs backend will generate permission error :
    Stderr: u'/usr/bin/cinder-rootwrap: Unauthorized command: mkdir -p
    This modified will fix this bug

    Change-Id: I424a991daff9c1761afed86db61ca13941ffd5e6
    Close-bug: #1593622

Ji.Wei (jiwei)
Changed in cinder:
importance: Undecided → Medium
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.