Bug #12877
closedceph-disk activate calls ceph-osd with --setuser ceph and fails with Permission Denied
0%
Description
Steps to reproduce:¶
- ceph-disk prepare /dev/sdb
- ceph-disk activate /dev/sdb1
Original description¶
Ceph deploy version: 1.5.28
Test fails becuase its unable to umount the osd's, It seems the recent changes to ceph-disk might have fixed some previous issue, previously 'ceph-deploy osd prepare' was sufficient for OSD's to be "in' and 'up'
now maybe 'osd activate' is required, Need to check.
2015-08-31T05:13:09.146 INFO:teuthology.orchestra.run.burnupi19:Running: 'sudo ceph -s' 2015-08-31T05:13:09.394 INFO:teuthology.orchestra.run.burnupi19.stdout: cluster f63e827f-a9e3-43cb-bea9-5d301d657009 2015-08-31T05:13:09.395 INFO:teuthology.orchestra.run.burnupi19.stdout: health HEALTH_WARN 2015-08-31T05:13:09.395 INFO:teuthology.orchestra.run.burnupi19.stdout: 64 pgs stuck inactive 2015-08-31T05:13:09.395 INFO:teuthology.orchestra.run.burnupi19.stdout: 64 pgs stuck unclean 2015-08-31T05:13:09.396 INFO:teuthology.orchestra.run.burnupi19.stdout: monmap e1: 1 mons at {burnupi19=10.214.134.14:6789/0} 2015-08-31T05:13:09.396 INFO:teuthology.orchestra.run.burnupi19.stdout: election epoch 2, quorum 0 burnupi19 2015-08-31T05:13:09.396 INFO:teuthology.orchestra.run.burnupi19.stdout: osdmap e4: 3 osds: 0 up, 0 in 2015-08-31T05:13:09.396 INFO:teuthology.orchestra.run.burnupi19.stdout: flags sortbitwise 2015-08-31T05:13:09.397 INFO:teuthology.orchestra.run.burnupi19.stdout: pgmap v5: 64 pgs, 1 pools, 0 bytes data, 0 objects 2015-08-31T05:13:09.397 INFO:teuthology.orchestra.run.burnupi19.stdout: 0 kB used, 0 kB / 0 kB avail 2015-08-31T05:13:09.397 INFO:teuthology.orchestra.run.burnupi19.stdout: 64 creating 2015-08-31T05:13:09.416 INFO:teuthology.orchestra.run.burnupi19:Running: 'sudo ceph health'
Updated by Vasu Kulkarni over 8 years ago
- Assignee set to Loïc Dachary
Loic,
Can you tell what the new ceph-disk behavior is? , Does it now require 'osd activate' to be run for the OSD's to be activated, previously this was not required and prepare was sufficient.
Updated by Loïc Dachary over 8 years ago
It's most probably because of something that changed in https://github.com/ceph/ceph/pull/5699. How did you run this test ?
Updated by Loïc Dachary over 8 years ago
./virtualenv/bin/teuthology-suite --priority 50 --suite smoke/1node --suite-branch wip-11881-multipath --distro ubuntu --email loic@dachary.org --ceph infernalis --machine-type plana,burnupi,mira
including a large sleep right before trying to prepare the disks to check manually and debug
diff --git a/tasks/ceph_deploy.py b/tasks/ceph_deploy.py index 26d320a..6b62ab4 100644 --- a/tasks/ceph_deploy.py +++ b/tasks/ceph_deploy.py @@ -528,2 +528,3 @@ def cli_test(ctx, config): + time.sleep(1000000000) for i in range(3):
Updated by Loïc Dachary over 8 years ago
root@burnupi26:~# ceph-disk activate /dev/sdb1 got monmap epoch 1 2015-08-31 12:34:29.682753 7f99d8f70980 -1 filestore(/var/lib/ceph/tmp/mnt.xhhC1E) mkjournal error creating journal on /var/lib/ceph/tmp/mnt.xhhC1E/journal: (13) Permission denied 2015-08-31 12:34:29.682795 7f99d8f70980 -1 OSD::mkfs: ObjectStore::mkfs failed with error -13 2015-08-31 12:34:29.682894 7f99d8f70980 -1 ** ERROR: error creating empty object store in /var/lib/ceph/tmp/mnt.xhhC1E: (13) Permission denied ERROR:ceph-disk:Failed to activate Traceback (most recent call last): File "/usr/sbin/ceph-disk", line 3326, in <module> main(sys.argv[1:]) File "/usr/sbin/ceph-disk", line 3285, in main main_catch(args.func, args) File "/usr/sbin/ceph-disk", line 3304, in main_catch func(args) File "/usr/sbin/ceph-disk", line 2386, in main_activate dmcrypt_key_dir=args.dmcrypt_key_dir, File "/usr/sbin/ceph-disk", line 2159, in mount_activate (osd_id, cluster) = activate(path, activate_key_template, init) File "/usr/sbin/ceph-disk", line 2322, in activate keyring=keyring, File "/usr/sbin/ceph-disk", line 1925, in mkfs '--setgroup', get_ceph_user(), File "/usr/sbin/ceph-disk", line 333, in command_check_call return subprocess.check_call(arguments) File "/usr/lib/python2.7/subprocess.py", line 540, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/usr/bin/ceph-osd', '--cluster', 'ceph', '--mkfs', '--mkkey', '-i', '0', '--monmap', '/var/lib/ceph/tmp/mnt.xhhC1E/activate.monmap', '--osd-data', '/var/lib/ceph/tmp/mnt.xhhC1E', '--osd-journal', '/var/lib/ceph/tmp/mnt.xhhC1E/journal', '--osd-uuid', '616bb8bf-b2b7-4b8b-b127-67466f7e32e6', '--keyring', '/var/lib/ceph/tmp/mnt.xhhC1E/keyring', '--setuser', 'ceph', '--setgroup', 'ceph']' returned non-zero exit status 1
Updated by Loïc Dachary over 8 years ago
@Vasu Kulkarni it looks like it's related to '--setuser', 'ceph', '--setgroup', 'ceph' which comes from https://github.com/ceph/ceph/pull/4456
Updated by Loïc Dachary over 8 years ago
- Project changed from 18 to Ceph
- Subject changed from ceph_deploy smoke failure 1.5.28 - umount: /dev/sdb1: not mounted to ceph-disk activate calls ceph-osd with --setuser ceph and fails with Permission Denied
- Status changed from New to 12
- Priority changed from Normal to Urgent
Updated by Loïc Dachary over 8 years ago
Sage is doing something right now at https://github.com/liewegas/ceph/commits/wip-user (https://github.com/liewegas/ceph/commit/f31baaa315327a437a861243dfb1c31de9550ef7)
Updated by Loïc Dachary over 8 years ago
I think what happens is the following:
- ceph-disk prepare triggers a udev event
- the udev rule calls ceph-disk activate as root and mounts the file system at a temporary location as root
- ceph-disk is called as ceph and fails because the mount point is owned by root
It looks like https://github.com/liewegas/ceph/commit/f31baaa315327a437a861243dfb1c31de9550ef7 can fix this.
Updated by Loïc Dachary over 8 years ago
It's simpler actually:
<sage> it's because the block device isn't owned by ceph.ceph.. that's the first udev rule fix in wip-user
Updated by Loïc Dachary over 8 years ago
See https://github.com/ceph/ceph/pull/5727 for a larger fix including the permission fix.
Updated by Loïc Dachary over 8 years ago
- Assignee changed from Loïc Dachary to Sage Weil
Updated by Loïc Dachary over 8 years ago
- Status changed from 7 to Resolved