Skip to content

Commit

Permalink
mgr: print a more helpful error message for when users lack mgr cephx…
Browse files Browse the repository at this point in the history
… caps

Add some brief documentation on updating their caps and link to it.

Fixes: http://tracker.ceph.com/issues/20296

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
  • Loading branch information
gregsfortytwo committed Jun 14, 2017
1 parent 3ace41f commit 26f7ed8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
10 changes: 10 additions & 0 deletions doc/mgr/administrator.rst
Expand Up @@ -25,6 +25,15 @@ of ``ceph status``, which should now include a mgr status line::

mgr active: $name

Client authentication
---------------------
The manager is a new daemon which requires new CephX capabilities. If you upgrade
a cluster from an old version of Ceph, or use the default install/deploy tools,
your admin client should get this capability automatically. If you use tooling from
elsewhere, you may get EACCES errors when invoking certain ceph cluster commands.
To fix that, add a "mgr allow *" stanza to your client's cephx capabilities by
`Modifying User Capabilities`_.
High availability
-----------------

Expand Down Expand Up @@ -92,3 +101,4 @@ OPTION(mgr_module_path, OPT_STR, CEPH_PKGLIBDIR "/mgr") // where to load python
:Type: Integer
:Default: ``30``

.. _Modifying User Capabilities: ../rados/operations/user-management#modify-user-capabilities
1 change: 1 addition & 0 deletions doc/rados/operations/user-management.rst
Expand Up @@ -360,6 +360,7 @@ are often restricted to accessing a particular pool. ::
pools in the cluster!


.. _modify-user-capabilities:
Modify User Capabilities
------------------------

Expand Down
6 changes: 4 additions & 2 deletions src/mgr/DaemonServer.cc
Expand Up @@ -550,7 +550,8 @@ bool DaemonServer::handle_command(MCommand *m)
if (!_allowed_command(session.get(), py_command.module, prefix, cmdctx->cmdmap,
param_str_map, &py_command)) {
dout(1) << " access denied" << dendl;
ss << "access denied";
ss << "access denied; does your client key have mgr caps?"
" See http://docs.ceph.com/docs/master/mgr/administrator/#client-authentication";
cmdctx->reply(-EACCES, ss);
return true;
}
Expand All @@ -562,7 +563,8 @@ bool DaemonServer::handle_command(MCommand *m)
audit_clog->info() << "from='" << session->inst << "' "
<< "entity='" << session->entity_name << "' "
<< "cmd=" << m->cmd << ": access denied";
ss << "access denied";
ss << "access denied' does your client key have mgr caps?"
" See http://docs.ceph.com/docs/master/mgr/administrator/#client-authentication";
cmdctx->reply(-EACCES, ss);
return true;
}
Expand Down

0 comments on commit 26f7ed8

Please sign in to comment.