事象内容

Openstack magnum の動作確認で、openstack coe service list コマンドを実行すると、下記エラーとなる。

[root@controller ~]# openstack coe service list
Internal Server Error (HTTP 500)
[root@controller ~]# 
messages ログ( /var/log/messages )を確認すると、認証が拒否されたようなメッセージが出力されている。

ConnectFailure: Unable to establish connection to http://controller:35357: HTTPConnectionPool(host=’controller’, port=35357)

Jan  2 20:52:41 controller magnum-api: 2019-01-02 20:52:41.748 31583 WARNING keystoneauth.identity.generic.base [-] Failed to discover available identity versions when contacting http://controller:35357. Attempting to parse version from URL.: ConnectFailure: Unable to establish connection to http://controller:35357: HTTPConnectionPool(host='controller', port=35357): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fa85d5e6250>: Failed to establish a new connection: [Errno 111] ECONNREFUSED',))#033[00m
Jan  2 20:52:41 controller magnum-api: 2019-01-02 20:52:41.754 31583 INFO werkzeug [-] 192.168.24.111 - - [02/Jan/2019 20:52:41] "GET /v1/mservices HTTP/1.1" 500 -#033[00m
Jan  2 20:52:41 controller magnum-api: 2019-01-02 20:52:41.765 31583 ERROR werkzeug [-] Error on request:
Jan  2 20:52:41 controller magnum-api: Traceback (most recent call last):
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/werkzeug/serving.py", line 270, in run_wsgi
Jan  2 20:52:41 controller magnum-api: execute(self.server.app)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/werkzeug/serving.py", line 258, in execute
Jan  2 20:52:41 controller magnum-api: application_iter = app(environ, start_response)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/webob/dec.py", line 129, in __call__
Jan  2 20:52:41 controller magnum-api: resp = self.call_func(req, *args, **kw)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/webob/dec.py", line 193, in call_func
Jan  2 20:52:41 controller magnum-api: return self.func(req, *args, **kwargs)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/oslo_middleware/base.py", line 131, in __call__
Jan  2 20:52:41 controller magnum-api: response = req.get_response(self.application)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/webob/request.py", line 1313, in send
Jan  2 20:52:41 controller magnum-api: application, catch_exc_info=False)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/webob/request.py", line 1277, in call_application
Jan  2 20:52:41 controller magnum-api: app_iter = application(self.environ, start_response)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/webob/dec.py", line 129, in __call__
Jan  2 20:52:41 controller magnum-api: resp = self.call_func(req, *args, **kw)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/webob/dec.py", line 193, in call_func
Jan  2 20:52:41 controller magnum-api: return self.func(req, *args, **kwargs)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/oslo_middleware/base.py", line 131, in __call__
Jan  2 20:52:41 controller magnum-api: response = req.get_response(self.application)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/webob/request.py", line 1313, in send
Jan  2 20:52:41 controller magnum-api: application, catch_exc_info=False)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/webob/request.py", line 1277, in call_application
Jan  2 20:52:41 controller magnum-api: app_iter = application(self.environ, start_response)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/webob/dec.py", line 129, in __call__
Jan  2 20:52:41 controller magnum-api: resp = self.call_func(req, *args, **kw)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/webob/dec.py", line 193, in call_func
Jan  2 20:52:41 controller magnum-api: return self.func(req, *args, **kwargs)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/oslo_middleware/base.py", line 131, in __call__
Jan  2 20:52:41 controller magnum-api: response = req.get_response(self.application)
Jan  2 20:52:41 controller kernel: FINAL_REJECT: IN=brq2769f828-ae OUT=brq2769f828-ae PHYSIN=vxlan-76 PHYSOUT=tap0f167256-eb MAC=fa:16:3e:7a:22:81:fa:16:3e:3e:4a:00:08:00 SRC=172.16.2.221 DST=133.167.77.169 LEN=76 TOS=0x00 PREC=0x00 TTL=64 ID=35452 DF PROTO=UDP SPT=59601 DPT=123 LEN=56 
Jan  2 20:52:41 controller kernel: FINAL_REJECT: IN=brq2769f828-ae OUT=brq2769f828-ae PHYSIN=vxlan-76 PHYSOUT=tap727f0f6b-49 MAC=fa:16:3e:7a:22:81:fa:16:3e:3e:4a:00:08:00 SRC=172.16.2.221 DST=133.167.77.169 LEN=76 TOS=0x00 PREC=0x00 TTL=64 ID=35452 DF PROTO=UDP SPT=59601 DPT=123 LEN=56 
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/webob/request.py", line 1313, in send
Jan  2 20:52:41 controller magnum-api: application, catch_exc_info=False)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/webob/request.py", line 1277, in call_application
Jan  2 20:52:41 controller magnum-api: app_iter = application(self.environ, start_response)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/webob/dec.py", line 129, in __call__
Jan  2 20:52:41 controller magnum-api: resp = self.call_func(req, *args, **kw)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/webob/dec.py", line 193, in call_func
Jan  2 20:52:41 controller magnum-api: return self.func(req, *args, **kwargs)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/oslo_middleware/request_id.py", line 58, in __call__
Jan  2 20:52:41 controller magnum-api: response = req.get_response(self.application)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/webob/request.py", line 1313, in send
Jan  2 20:52:41 controller magnum-api: application, catch_exc_info=False)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/webob/request.py", line 1277, in call_application
Jan  2 20:52:41 controller magnum-api: app_iter = application(self.environ, start_response)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/webob/dec.py", line 129, in __call__
Jan  2 20:52:41 controller magnum-api: resp = self.call_func(req, *args, **kw)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/webob/dec.py", line 193, in call_func
Jan  2 20:52:41 controller magnum-api: return self.func(req, *args, **kwargs)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/osprofiler/web.py", line 112, in __call__
Jan  2 20:52:41 controller magnum-api: return request.get_response(self.application)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/webob/request.py", line 1313, in send
Jan  2 20:52:41 controller magnum-api: application, catch_exc_info=False)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/webob/request.py", line 1277, in call_application
Jan  2 20:52:41 controller magnum-api: app_iter = application(self.environ, start_response)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/magnum/api/middleware/auth_token.py", line 60, in __call__
Jan  2 20:52:41 controller magnum-api: return super(AuthTokenMiddleware, self).__call__(env, start_response)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/webob/dec.py", line 129, in __call__
Jan  2 20:52:41 controller magnum-api: resp = self.call_func(req, *args, **kw)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/webob/dec.py", line 193, in call_func
Jan  2 20:52:41 controller magnum-api: return self.func(req, *args, **kwargs)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py", line 332, in __call__
Jan  2 20:52:41 controller magnum-api: response = self.process_request(req)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py", line 622, in process_request
Jan  2 20:52:41 controller magnum-api: resp = super(AuthProtocol, self).process_request(request)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py", line 405, in process_request
Jan  2 20:52:41 controller magnum-api: allow_expired=allow_expired)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py", line 437, in _do_fetch_token
Jan  2 20:52:41 controller magnum-api: data = self.fetch_token(token, **kwargs)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py", line 761, in fetch_token
Jan  2 20:52:41 controller magnum-api: allow_expired=allow_expired)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/keystonemiddleware/auth_token/_identity.py", line 221, in verify_token
Jan  2 20:52:41 controller magnum-api: allow_expired=allow_expired)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/keystonemiddleware/auth_token/_identity.py", line 108, in verify_token
Jan  2 20:52:41 controller magnum-api: allow_expired=allow_expired)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/keystoneclient/v3/tokens.py", line 105, in validate
Jan  2 20:52:41 controller magnum-api: allow_expired=allow_expired)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/keystoneclient/v3/tokens.py", line 85, in get_token_data
Jan  2 20:52:41 controller magnum-api: resp, body = self._client.get(url, headers=headers)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/keystoneauth1/adapter.py", line 328, in get
Jan  2 20:52:41 controller magnum-api: return self.request(url, 'GET', **kwargs)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/keystoneauth1/adapter.py", line 487, in request
Jan  2 20:52:41 controller magnum-api: resp = super(LegacyJsonAdapter, self).request(*args, **kwargs)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/keystoneauth1/adapter.py", line 213, in request
Jan  2 20:52:41 controller magnum-api: return self.session.request(url, method, **kwargs)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/keystoneauth1/adapter.py", line 213, in request
Jan  2 20:52:41 controller magnum-api: return self.session.request(url, method, **kwargs)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/keystoneauth1/session.py", line 684, in request
Jan  2 20:52:41 controller magnum-api: auth_headers = self.get_auth_headers(auth)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/keystoneauth1/session.py", line 1071, in get_auth_headers
Jan  2 20:52:41 controller magnum-api: return auth.get_headers(self, **kwargs)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/keystoneauth1/plugin.py", line 95, in get_headers
Jan  2 20:52:41 controller magnum-api: token = self.get_token(session)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/base.py", line 88, in get_token
Jan  2 20:52:41 controller magnum-api: return self.get_access(session).auth_token
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/base.py", line 134, in get_access
Jan  2 20:52:41 controller magnum-api: self.auth_ref = self.get_auth_ref(session)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/generic/base.py", line 206, in get_auth_ref
Jan  2 20:52:41 controller magnum-api: self._plugin = self._do_create_plugin(session)
Jan  2 20:52:41 controller magnum-api: File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/generic/base.py", line 161, in _do_create_plugin
Jan  2 20:52:41 controller magnum-api: 'auth_url is correct. %s' % e)
Jan  2 20:52:41 controller magnum-api: DiscoveryFailure: Could not find versioned identity endpoints when attempting to authenticate. Please check that your auth_url is correct. Unable to establish connection to http://controller:35357: HTTPConnectionPool(host='controller', port=35357): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fa85d5e6250>: Failed to establish a new connection: [Errno 111] ECONNREFUSED',)): DiscoveryFailure: Could not find versioned identity endpoints when attempting to authenticate. Please check that your auth_url is correct. Unable to establish connection to http://controller:35357: HTTPConnectionPool(host='controller', port=35357): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fa85d5e6250>: Failed to establish a new connection: [Errno 111] ECONNREFUSED',))#033[00m
Jan  2 20:52:46 controller kernel: FINAL_REJECT: IN=brqd8d35733-12 OUT=brqd8d35733-12 PHYSIN=vxl

解決方法

magnum設定ファイル( /etc/magnum/magnum.conf )の [ keystone_authtoken ] セクションで指定する auth_url のポート番号が町あっていることが原因である。35537 ではなく 5000 ポートに設定を修正します。

[root@controller ~]# vi /etc/magnum/magnum.conf 
[keystone_authtoken]
...
auth_url = http://controller:35357
↓
auth_url = http://controller:5000