Internal server error (`error connecting to the cluster`) if no accessible keyring can be found (and no specific keyring is configured).
Steps to reproduce:
- Goto "Settings" and remove the path to the keyring file and the keyring user. Save the settings.
- Make the files in `/etc/ceph` inaccessible for the `openattic` user (e.g. `chown root:root /etc/ceph/*`)
- Browse to either
- the Dashboard,
- the Nodes tab
- or the CRUSH Map.
Expected behavior:
What's shown on RBD, OSD or Pools page but without the internal server error toasty.
The following error appears in the log file even on RBD, OSD or the Pools page. We might not want such an error in the log file if the incident is properly handled.
Unable to find source-code formatter for language: text. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
2017-12-14 08:49:35,304 5624 mod_wsgi ERROR nodb.models#__get__ - failed to populate Field "osd_flags" of /etc/ceph/ceph.conf (<class 'ceph.models.CephCluster'>) Traceback (most recent call last): File "/srv/openattic/backend/nodb/models.py", line 324, in __get__ self.eval_func(instance, query_set, self.field_names) File "/srv/openattic/backend/ceph/models.py", line 184, in set_osd_flags flags = self.mon_api(self.fsid).osd_dump()['flags'].split(',') File "/srv/openattic/backend/ceph/librados.py", line 944, in osd_dump return self._call_mon_command('osd dump') File "/srv/openattic/backend/ceph/librados.py", line 1059, in _call_mon_command timeout) File "/srv/openattic/backend/ceph/librados.py", line 439, in call_librados return run_in_external_process(with_client, cmd_name, timeout) File "/srv/openattic/backend/utilities.py", line 163, in run_in_external_process raise res ObjectNotFound: [errno 2] error connecting to the cluster
This is the complete log output of trying to open the Dashboard.
Unable to find source-code formatter for language: text. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
2017-12-14 09:05:32,061 5618 mod_wsgi ERROR utilities#run - Exception when running a librados process. Traceback (most recent call last): File "/srv/openattic/backend/utilities.py", line 150, in run self.com_pipe.send(func()) File "/srv/openattic/backend/ceph/librados.py", line 435, in with_client with ClusterConf.from_fsid(fsid).client as client: File "/srv/openattic/backend/ceph/librados.py", line 191, in client return Client(self.file_path, self.keyring) File "/srv/openattic/backend/ceph/librados.py", line 292, in __init__ self.connect(self._conf_file) File "/srv/openattic/backend/ceph/librados.py", line 307, in connect self._cluster.connect() File "rados.pyx", line 875, in rados.Rados.connect (/home/abuild/rpmbuild/BUILD/ceph-12.2.1+git.1507910930.aea79b8b7a/build/src/pybind/rados/pyrex/rados.c:10952) ObjectNotFound: [errno 2] error connecting to the cluster 2017-12-14 09:05:32,062 5618 mod_wsgi WARNING py.warnings#run - /srv/openattic/backend/utilities.py:153: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6 self.com_pipe.send(e) 2017-12-14 09:05:32,064 5618 mod_wsgi ERROR ceph.models#set_cluster_health - failed to get ceph health Traceback (most recent call last): File "/srv/openattic/backend/ceph/models.py", line 174, in set_cluster_health health = self.mon_api(self.fsid).health() File "/srv/openattic/backend/ceph/librados.py", line 1048, in health return self._call_mon_command('health', self._args_to_argdict(detail=detail)) File "/srv/openattic/backend/ceph/librados.py", line 1059, in _call_mon_command timeout) File "/srv/openattic/backend/ceph/librados.py", line 439, in call_librados return run_in_external_process(with_client, cmd_name, timeout) File "/srv/openattic/backend/utilities.py", line 163, in run_in_external_process raise res ObjectNotFound: [errno 2] error connecting to the cluster 2017-12-14 09:05:32,088 5618 mod_wsgi ERROR utilities#run - Exception when running a librados process. Traceback (most recent call last): File "/srv/openattic/backend/utilities.py", line 150, in run self.com_pipe.send(func()) File "/srv/openattic/backend/ceph/librados.py", line 435, in with_client with ClusterConf.from_fsid(fsid).client as client: File "/srv/openattic/backend/ceph/librados.py", line 191, in client return Client(self.file_path, self.keyring) File "/srv/openattic/backend/ceph/librados.py", line 292, in __init__ self.connect(self._conf_file) File "/srv/openattic/backend/ceph/librados.py", line 307, in connect self._cluster.connect() File "rados.pyx", line 875, in rados.Rados.connect (/home/abuild/rpmbuild/BUILD/ceph-12.2.1+git.1507910930.aea79b8b7a/build/src/pybind/rados/pyrex/rados.c:10952) ObjectNotFound: [errno 2] error connecting to the cluster 2017-12-14 09:05:32,089 5618 mod_wsgi WARNING py.warnings#run - /srv/openattic/backend/utilities.py:153: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6 self.com_pipe.send(e) 2017-12-14 09:05:32,091 5618 mod_wsgi ERROR nodb.models#__get__ - failed to populate Field "osd_flags" of /etc/ceph/ceph.conf (<class 'ceph.models.CephCluster'>) Traceback (most recent call last): File "/srv/openattic/backend/nodb/models.py", line 324, in __get__ self.eval_func(instance, query_set, self.field_names) File "/srv/openattic/backend/ceph/models.py", line 184, in set_osd_flags flags = self.mon_api(self.fsid).osd_dump()['flags'].split(',') File "/srv/openattic/backend/ceph/librados.py", line 944, in osd_dump return self._call_mon_command('osd dump') File "/srv/openattic/backend/ceph/librados.py", line 1059, in _call_mon_command timeout) File "/srv/openattic/backend/ceph/librados.py", line 439, in call_librados return run_in_external_process(with_client, cmd_name, timeout) File "/srv/openattic/backend/utilities.py", line 163, in run_in_external_process raise res ObjectNotFound: [errno 2] error connecting to the cluster 2017-12-14 09:05:32,196 5637 mod_wsgi ERROR utilities#run - Exception when running a librados process. Traceback (most recent call last): File "/srv/openattic/backend/utilities.py", line 150, in run self.com_pipe.send(func()) File "/srv/openattic/backend/ceph/librados.py", line 435, in with_client with ClusterConf.from_fsid(fsid).client as client: File "/srv/openattic/backend/ceph/librados.py", line 191, in client return Client(self.file_path, self.keyring) File "/srv/openattic/backend/ceph/librados.py", line 292, in __init__ self.connect(self._conf_file) File "/srv/openattic/backend/ceph/librados.py", line 307, in connect self._cluster.connect() File "rados.pyx", line 875, in rados.Rados.connect (/home/abuild/rpmbuild/BUILD/ceph-12.2.1+git.1507910930.aea79b8b7a/build/src/pybind/rados/pyrex/rados.c:10952) ObjectNotFound: [errno 2] error connecting to the cluster 2017-12-14 09:05:32,196 5637 mod_wsgi WARNING py.warnings#run - /srv/openattic/backend/utilities.py:153: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6 self.com_pipe.send(e) 2017-12-14 09:05:32,198 5637 mod_wsgi ERROR exception#custom_handler - Internal Server Error: None Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/rest_framework/views.py", line 400, in dispatch response = handler(request, *args, **kwargs) File "/srv/openattic/backend/ceph/restapi.py", line 72, in status return Response(object.status, status=status.HTTP_200_OK) File "/srv/openattic/backend/ceph/models.py", line 94, in status val = self.mon_api(self.fsid).status() File "/srv/openattic/backend/ceph/librados.py", line 1044, in status return self._call_mon_command('status') File "/srv/openattic/backend/ceph/librados.py", line 1059, in _call_mon_command timeout) File "/srv/openattic/backend/ceph/librados.py", line 439, in call_librados return run_in_external_process(with_client, cmd_name, timeout) File "/srv/openattic/backend/utilities.py", line 163, in run_in_external_process raise res ObjectNotFound: [errno 2] error connecting to the cluster