Project

General

Profile

Actions

Bug #3279

closed

mon/caps: cap comparison in get-or-create is based on a string literal

Added by Greg Farnum over 11 years ago. Updated over 11 years ago.

Status:
Resolved
Priority:
Normal
Category:
Monitor
Target version:
-
% Done:

0%

Source:
Development
Tags:
Backport:
Regression:
Severity:
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

If you run ceph auth get-or-create and your caps string differs by a space, then it returns an error:

key for client.bootstrap-osd exists but cap mon does not match

Boo!

I guess we can't actually make these based on semantic parsing (the caps are opaque to the monitor), but we can at least canonicalize the whitespace.

Actions #1

Updated by Joao Eduardo Luis over 11 years ago

  • Status changed from New to Resolved
Actions #2

Updated by Kraig Amador over 11 years ago

This effects the chef mon recipe. I am able to correct this error by joining lines 96-99.

[Thu, 17 Jan 2013 16:50:30 -0800] INFO: Processing ruby_block[save osd bootstrap key in node attributes] action create (ceph::mon line 85)
key for client.bootstrap-osd exists but cap mon does not match

================================================================================
Error executing action `create` on resource 'ruby_block[save osd bootstrap key in node attributes]' ================================================================================

RuntimeError
------------
adding or getting bootstrap-osd key failed

Cookbook Trace:
---------------
/var/cache/chef/cookbooks/ceph/recipes/mon.rb:101:in `from_file'

Resource Declaration:
---------------------
  1. In /var/cache/chef/cookbooks/ceph/recipes/mon.rb
85: ruby_block "save osd bootstrap key in node attributes" do
86: block do
87: if node['ceph_bootstrap_osd_key'].nil? then
88: if not have_quorum? then
89: puts 'ceph-mon is not in quorum, skipping bootstrap-osd key generation for this run'
90: else
91: key = %x[
92: ceph \
93: --name mon. \
94: --keyring '/var/lib/ceph/mon/#{cluster}-#{node['hostname']}/keyring' \
95: auth get-or-create-key client.bootstrap-osd mon \
96: "allow command osd create ...; \
97: allow command osd crush set ...; \
98: allow command auth add * osd allow\\ * mon allow\\ rwx; \
99: allow command mon getmap"
100: ]
101: raise 'adding or getting bootstrap-osd key failed' unless $?.exitstatus == 0
102: node.override['ceph_bootstrap_osd_key'] = key
103: node.save
104: end
105: end
106: end
Compiled Resource:
------------------
  1. Declared in /var/cache/chef/cookbooks/ceph/recipes/mon.rb:85:in `from_file'

ruby_block("save osd bootstrap key in node attributes") do
block #<Proc:0x00007f66a91b3818@/var/cache/chef/cookbooks/ceph/recipes/mon.rb:86>
block_name "save osd bootstrap key in node attributes"
recipe_name "mon"
action "create"
retry_delay 2
cookbook_name "ceph"
retries 0
end

Actions

Also available in: Atom PDF