Magnum is unable to create a bay due to the following error:
AttributeError: 'KeyUsage' object has no attribute 'oid'
Here are the details. I create a bay, but it fails:
$ magnum --debug bay-create --name k8s --baymodel k8s --node-count 1
DEBUG (v2:76) Making authentication request to http://172.29.74.86:5000/v2.0/tokens
INFO (connectionpool:203) Starting new HTTP connection (1): 172.29.74.86
DEBUG (connectionpool:383) "POST /v2.0/tokens HTTP/1.1" 200 4609
DEBUG (iso8601:184) Parsed 2015-09-08T18:44:47Z into {'tz_sign': None, 'second_fraction': None, 'hour': u'18', 'daydash': u'08', 'tz_hour': None, 'month': None, 'timezone': u'Z', 'second': u'47', 'tz_minute': None, 'year': u'2015', 'separator': u'T', 'monthdash': u'09', 'day': None, 'minute': u'44'} with default timezone <iso8601.iso8601.Utc object at 0x7fa94324f290>
DEBUG (iso8601:140) Got u'2015' for 'year' with default None
DEBUG (iso8601:140) Got u'09' for 'monthdash' with default 1
DEBUG (iso8601:140) Got 9 for 'month' with default 9
DEBUG (iso8601:140) Got u'08' for 'daydash' with default 1
DEBUG (iso8601:140) Got 8 for 'day' with default 8
DEBUG (iso8601:140) Got u'18' for 'hour' with default None
DEBUG (iso8601:140) Got u'44' for 'minute' with default None
DEBUG (iso8601:140) Got u'47' for 'second' with default None
DEBUG (httpclient:105) curl -i -X GET -H 'X-Auth-Token: ecfde0ed4c7a4b16a86ebb575602e0e4' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'User-Agent: python-magnumclient' http://172.29.74.86:9511/v1/baymodels/k8s
DEBUG (httpclient:115)
HTTP/1.0 200 OK
x-openstack-magnum-api-maximum-version: 1.1
content-length: 768
x-openstack-magnum-api-version: 1.1
x-openstack-magnum-api-minimum-version: 1.1
server: WSGIServer/0.1 Python/2.7.6
date: Tue, 08 Sep 2015 16:44:47 GMT
content-type: application/json; charset=UTF-8
{"no_proxy": null, "ssh_authorized_key": null, "updated_at": null, "apiserver_port": null, "uuid": "9b12546a-8070-4ecd-b9fe-e9d45ad17975", "docker_volume_size": 3, "https_proxy": null, "keypair_id": "danehans", "external_network_id": "0521ceb2-fe2e-4b14-a39f-5fbc5d99f66b", "created_at": "2015-09-08T16:44:36+00:00", "http_proxy": null, "links": [{"href": "http://172.29.74.86:9511/v1/baymodels/9b12546a-8070-4ecd-b9fe-e9d45ad17975", "rel": "self"}, {"href": "http://172.29.74.86:9511/baymodels/9b12546a-8070-4ecd-b9fe-e9d45ad17975", "rel": "bookmark"}], "cluster_distro": "fedora-atomic", "name": "k8s", "fixed_network": null, "image_id": "fedora-21-atomic-3", "coe": "kubernetes", "flavor_id": "m1.small", "dns_nameserver": "172.29.74.154", "master_flavor_id": null}
DEBUG (httpclient:105) curl -i -X POST -H 'X-Auth-Token: ecfde0ed4c7a4b16a86ebb575602e0e4' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'User-Agent: python-magnumclient' -d '{"name": "k8s", "discovery_url": null, "master_count": 1, "baymodel_id": "9b12546a-8070-4ecd-b9fe-e9d45ad17975", "node_count": "1", "bay_create_timeout": null}' http://172.29.74.86:9511/v1/bays
DEBUG (httpclient:115)
HTTP/1.0 500 Internal Server Error
x-openstack-magnum-api-maximum-version: 1.1
content-length: 127
x-openstack-magnum-api-version: 1.1
x-openstack-magnum-api-minimum-version: 1.1
server: WSGIServer/0.1 Python/2.7.6
date: Tue, 08 Sep 2015 16:44:47 GMT
content-type: application/json
{"error_message": "{\"debuginfo\":null,\"faultcode\":\"Server\",\"faultstring\":\"'KeyUsage' object has no attribute 'oid'\"}"}
WARNING (httpclient:175) Request returned failure status.
DEBUG (shell:577) 'KeyUsage' object has no attribute 'oid' (HTTP 500)
Traceback (most recent call last):
File "/opt/stack/python-magnumclient/magnumclient/shell.py", line 574, in main
OpenStackMagnumShell().main(map(encodeutils.safe_decode, sys.argv[1:]))
File "/opt/stack/python-magnumclient/magnumclient/shell.py", line 519, in main
args.func(self.cs, args)
File "/opt/stack/python-magnumclient/magnumclient/v1/shell.py", line 99, in do_bay_create
bay = cs.bays.create(**opts)
File "/opt/stack/python-magnumclient/magnumclient/v1/bays.py", line 94, in create
return self._create(self._path(), new)
File "/opt/stack/python-magnumclient/magnumclient/common/base.py", line 49, in _create
resp, body = self.api.json_request('POST', url, body=body)
File "/opt/stack/python-magnumclient/magnumclient/common/httpclient.py", line 196, in json_request
resp, body_iter = self._http_request(url, method, **kwargs)
File "/opt/stack/python-magnumclient/magnumclient/common/httpclient.py", line 179, in _http_request
error_json.get('debuginfo'), method, url)
InternalServerError: 'KeyUsage' object has no attribute 'oid' (HTTP 500)
ERROR: 'KeyUsage' object has no attribute 'oid' (HTTP 500)
Here are the server-side logs:
2015-09-08 16:44:47.747 DEBUG magnum.conductor.handlers.bay_conductor [req-539d42c2-81ab-484a-9a72-e4e6ec179ced admin admin] bay_heat bay_create from (pid=19424) bay_create /opt/stack/magnum/magnum/conductor/handlers/bay_conductor.py:120
2015-09-08 16:44:47.747 DEBUG magnum.conductor.handlers.common.cert_manager [req-539d42c2-81ab-484a-9a72-e4e6ec179ced admin admin] Start to generate certificates: k8s from (pid=19424) generate_certificates_to_bay /opt/stack/magnum/magnum/conductor/handlers/common/cert_manager.py:79
2015-09-08 16:44:47.747 ERROR oslo_messaging.rpc.dispatcher [req-539d42c2-81ab-484a-9a72-e4e6ec179ced admin admin] Exception during message handling: 'KeyUsage' object has no attribute 'oid'
2015-09-08 16:44:47.747 TRACE oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2015-09-08 16:44:47.747 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply
2015-09-08 16:44:47.747 TRACE oslo_messaging.rpc.dispatcher executor_callback))
2015-09-08 16:44:47.747 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch
2015-09-08 16:44:47.747 TRACE oslo_messaging.rpc.dispatcher executor_callback)
2015-09-08 16:44:47.747 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 129, in _do_dispatch
2015-09-08 16:44:47.747 TRACE oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args)
2015-09-08 16:44:47.747 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/magnum/magnum/conductor/handlers/bay_conductor.py", line 126, in bay_create
2015-09-08 16:44:47.747 TRACE oslo_messaging.rpc.dispatcher cert_manager.generate_certificates_to_bay(bay)
2015-09-08 16:44:47.747 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/magnum/magnum/conductor/handlers/common/cert_manager.py", line 81, in generate_certificates_to_bay
2015-09-08 16:44:47.747 TRACE oslo_messaging.rpc.dispatcher ca_cert_ref, ca_cert, ca_password = _generate_ca_cert(issuer_name)
2015-09-08 16:44:47.747 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/magnum/magnum/conductor/handlers/common/cert_manager.py", line 35, in _generate_ca_cert
2015-09-08 16:44:47.747 TRACE oslo_messaging.rpc.dispatcher encryption_password=ca_password)
2015-09-08 16:44:47.747 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/magnum/magnum/common/x509/operations.py", line 41, in generate_ca_certificate
2015-09-08 16:44:47.747 TRACE oslo_messaging.rpc.dispatcher _build_ca_extentions(),
2015-09-08 16:44:47.747 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/magnum/magnum/common/x509/operations.py", line 83, in _build_ca_extentions
2015-09-08 16:44:47.747 TRACE oslo_messaging.rpc.dispatcher key_usage = Extension(key_usage.oid, True, key_usage)
2015-09-08 16:44:47.747 TRACE oslo_messaging.rpc.dispatcher AttributeError: 'KeyUsage' object has no attribute 'oid'
2015-09-08 16:44:47.747 TRACE oslo_messaging.rpc.dispatcher
2015-09-08 16:44:47.748 DEBUG oslo_messaging._drivers.amqp [req-539d42c2-81ab-484a-9a72-e4e6ec179ced admin admin] Pool creating new connection from (pid=19424) create /usr/local/lib/python2.7/dist-packages/oslo_messaging/_drivers/amqp.py:103
2015-09-08 16:44:47.749 INFO oslo_messaging._drivers.impl_rabbit [req-539d42c2-81ab-484a-9a72-e4e6ec179ced admin admin] Connecting to AMQP server on 172.29.74.86:5672
2015-09-08 16:44:47.754 INFO oslo_messaging._drivers.impl_rabbit [req-539d42c2-81ab-484a-9a72-e4e6ec179ced admin admin] Connected to AMQP server on 172.29.74.86:5672
2015-09-08 16:44:47.754 ERROR oslo_messaging._drivers.common [req-539d42c2-81ab-484a-9a72-e4e6ec179ced admin admin] Returning exception 'KeyUsage' object has no attribute 'oid' to caller
2015-09-08 16:44:47.755 ERROR oslo_messaging._drivers.common [req-539d42c2-81ab-484a-9a72-e4e6ec179ced admin admin] ['Traceback (most recent call last):\n', ' File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply\n executor_callback))\n', ' File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch\n executor_callback)\n', ' File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 129, in _do_dispatch\n result = func(ctxt, **new_args)\n', ' File "/opt/stack/magnum/magnum/conductor/handlers/bay_conductor.py", line 126, in bay_create\n cert_manager.generate_certificates_to_bay(bay)\n', ' File "/opt/stack/magnum/magnum/conductor/handlers/common/cert_manager.py", line 81, in generate_certificates_to_bay\n ca_cert_ref, ca_cert, ca_password = _generate_ca_cert(issuer_name)\n', ' File "/opt/stack/magnum/magnum/conductor/handlers/common/cert_manager.py", line 35, in _generate_ca_cert\n encryption_password=ca_password)\n', ' File "/opt/stack/magnum/magnum/common/x509/operations.py", line 41, in generate_ca_certificate\n _build_ca_extentions(),\n', ' File "/opt/stack/magnum/magnum/common/x509/operations.py", line 83, in _build_ca_extentions\n key_usage = Extension(key_usage.oid, True, key_usage)\n', "AttributeError: 'KeyUsage' object has no attribute 'oid'\n"]
2015-09-08 16:44:47.757 ERROR wsme.api [req-539d42c2-81ab-484a-9a72-e4e6ec179ced admin admin] Server-side error: "'KeyUsage' object has no attribute 'oid'
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply
executor_callback))
File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch
executor_callback)
File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 129, in _do_dispatch
result = func(ctxt, **new_args)
File "/opt/stack/magnum/magnum/conductor/handlers/bay_conductor.py", line 126, in bay_create
cert_manager.generate_certificates_to_bay(bay)
File "/opt/stack/magnum/magnum/conductor/handlers/common/cert_manager.py", line 81, in generate_certificates_to_bay
ca_cert_ref, ca_cert, ca_password = _generate_ca_cert(issuer_name)
File "/opt/stack/magnum/magnum/conductor/handlers/common/cert_manager.py", line 35, in _generate_ca_cert
encryption_password=ca_password)
File "/opt/stack/magnum/magnum/common/x509/operations.py", line 41, in generate_ca_certificate
_build_ca_extentions(),
File "/opt/stack/magnum/magnum/common/x509/operations.py", line 83, in _build_ca_extentions
key_usage = Extension(key_usage.oid, True, key_usage)
AttributeError: 'KeyUsage' object has no attribute 'oid'
". Detail:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/wsmeext/pecan.py", line 84, in callfunction
result = f(self, *args, **kwargs)
File "/opt/stack/magnum/magnum/api/controllers/v1/bay.py", line 280, in post
bay.bay_create_timeout)
File "/opt/stack/magnum/magnum/conductor/api.py", line 52, in bay_create
bay_create_timeout=bay_create_timeout)
File "/opt/stack/magnum/magnum/common/rpc_service.py", line 103, in _call
return self._client.call(self._context, method, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/client.py", line 403, in call
return self.prepare().call(ctxt, method, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/client.py", line 158, in call
retry=self.retry)
File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/transport.py", line 90, in _send
timeout=timeout, retry=retry)
File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/_drivers/amqpdriver.py", line 431, in send
retry=retry)
File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/_drivers/amqpdriver.py", line 422, in _send
raise result
AttributeError: 'KeyUsage' object has no attribute 'oid'
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply
executor_callback))
File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch
executor_callback)
File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 129, in _do_dispatch
result = func(ctxt, **new_args)
File "/opt/stack/magnum/magnum/conductor/handlers/bay_conductor.py", line 126, in bay_create
cert_manager.generate_certificates_to_bay(bay)
File "/opt/stack/magnum/magnum/conductor/handlers/common/cert_manager.py", line 81, in generate_certificates_to_bay
ca_cert_ref, ca_cert, ca_password = _generate_ca_cert(issuer_name)
File "/opt/stack/magnum/magnum/conductor/handlers/common/cert_manager.py", line 35, in _generate_ca_cert
encryption_password=ca_password)
File "/opt/stack/magnum/magnum/common/x509/operations.py", line 41, in generate_ca_certificate
_build_ca_extentions(),
File "/opt/stack/magnum/magnum/common/x509/operations.py", line 83, in _build_ca_extentions
key_usage = Extension(key_usage.oid, True, key_usage)
AttributeError: 'KeyUsage' object has no attribute 'oid'
I have not encountered this problem, I think that is the problem of your environment or the problem has been solved.