node adopt failed

Bug #1751242 reported by blkart
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
senlin
Fix Released
Undecided
blkart

Bug Description

Description
===========
When i adopt a nova server(boot from image(create new volume)) use `openstack cluster node adopt` command, it was failed.

Steps to reproduce
==================
* create a new server(boot from image(create new volume))
* adopt the new server
# openstack cluster node adopt --identity bd71b832-e561-4f90-97b8-2949ec1415b0 --type os.nova.server-1.0 --name test_adopt_node-3
HttpException: u'\'id\'\n (HTTP 500) (Request-ID: req-c8b5e27e-5bfa-441f-8904-d71f0fb0355a), u'\'id\'\n

Expected result
===============
Command run successfully.

Actual result
=============
Command run failed, and raise HttpException.

Logs
==============
senlin-api logs:
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi [req-ffbca09b-e5a4-467d-865e-75d85d0bbce6 e1ddb7e7538845968789fd3a863de928 bdeecc1b58004bb19302da77ac056b44 - - -] Unexpected error occurred serving API: u'\'id\'\nTraceback (most recent call last):\n\n File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/server.py", line 163, in _process_incoming\n res = self.dispatcher.dispatch(message)\n\n File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 220, in dispatch\n return self._do_dispatch(endpoint, method, ctxt, args)\n\n File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 190, in _do_dispatch\n result = func(ctxt, **new_args)\n\n File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 157, in wrapper\n result = f(*args, **kwargs)\n\n File "/opt/stack/senlin/senlin/engine/service.py", line 72, in wrapped\n return func(self, ctx, req_obj)\n\n File "/opt/stack/senlin/senlin/engine/service.py", line 1869, in node_adopt\n profile_cls, spec = self._node_adopt_preview(ctx, req)\n\n File "/opt/stack/senlin/senlin/engine/service.py", line 1823, in _node_adopt_preview\n snapshot=req.snapshot)\n\n File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 157, in wrapper\n result = f(*args, **kwargs)\n\n File "/opt/stack/senlin/senlin/profiles/base.py", line 284, in adopt_node\n return profile.do_adopt(obj, overrides=overrides, snapshot=snapshot)\n\n File "/opt/stack/senlin/senlin/profiles/os/nova/server.py", line 1371, in do_adopt\n spec[self.IMAGE] = server.image[\'id\'] or server.image\n\nKeyError: \'id\'\n': KeyError: u'\'id\'\nTraceback (most recent call last):\n\n File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/server.py", line 163, in _process_incoming\n res = self.dispatcher.dispatch(message)\n\n File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 220, in dispatch\n return self._do_dispatch(endpoint, method, ctxt, args)\n\n File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 190, in _do_dispatch\n result = func(ctxt, **new_args)\n\n File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 157, in wrapper\n result = f(*args, **kwargs)\n\n File "/opt/stack/senlin/senlin/engine/service.py", line 72, in wrapped\n return func(self, ctx, req_obj)\n\n File "/opt/stack/senlin/senlin/engine/service.py", line 1869, in node_adopt\n profile_cls, spec = self._node_adopt_preview(ctx, req)\n\n File "/opt/stack/senlin/senlin/engine/service.py", line 1823, in _node_adopt_preview\n snapshot=req.snapshot)\n\n File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 157, in wrapper\n result = f(*args, **kwargs)\n\n File "/opt/stack/senlin/senlin/profiles/base.py", line 284, in adopt_node\n return profile.do_adopt(obj, overrides=overrides, snapshot=snapshot)\n\n File "/opt/stack/senlin/senlin/profiles/os/nova/server.py", line 1371, in do_adopt\n spec[self.IMAGE] = server.image[\'id\'] or server.image\n\nKeyError: \'id\'\n'
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi Traceback (most recent call last):
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi File "/opt/stack/senlin/senlin/api/common/wsgi.py", line 627, in __call__
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi request, **action_args)
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi File "/opt/stack/senlin/senlin/api/common/wsgi.py", line 703, in dispatch
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi return method(*args, **kwargs)
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi File "/opt/stack/senlin/senlin/api/common/wsgi.py", line 774, in version_select
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi return func.func(self, *args, **kwargs)
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi File "/opt/stack/senlin/senlin/api/common/util.py", line 42, in policy_checker
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi return handler(controller, req, **kwargs)
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi File "/opt/stack/senlin/senlin/api/openstack/v1/nodes.py", line 78, in adopt
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi node = self.rpc_client.call(req.context, 'node_adopt', obj)
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi File "/opt/stack/senlin/senlin/rpc/client.py", line 56, in call
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi return client.call(ctxt, method, req=req)
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/client.py", line 475, in call
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi return self.prepare().call(ctxt, method, **kwargs)
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/client.py", line 174, in call
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi retry=self.retry)
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi File "/usr/lib/python2.7/site-packages/oslo_messaging/transport.py", line 131, in _send
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi timeout=timeout, retry=retry)
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi File "/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py", line 559, in send
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi retry=retry)
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi File "/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py", line 550, in _send
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi raise result
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi KeyError: u'\'id\'\nTraceback (most recent call last):\n\n File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/server.py", line 163, in _process_incoming\n res = self.dispatcher.dispatch(message)\n\n File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 220, in dispatch\n return self._do_dispatch(endpoint, method, ctxt, args)\n\n File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 190, in _do_dispatch\n result = func(ctxt, **new_args)\n\n File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 157, in wrapper\n result = f(*args, **kwargs)\n\n File "/opt/stack/senlin/senlin/engine/service.py", line 72, in wrapped\n return func(self, ctx, req_obj)\n\n File "/opt/stack/senlin/senlin/engine/service.py", line 1869, in node_adopt\n profile_cls, spec = self._node_adopt_preview(ctx, req)\n\n File "/opt/stack/senlin/senlin/engine/service.py", line 1823, in _node_adopt_preview\n snapshot=req.snapshot)\n\n File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 157, in wrapper\n result = f(*args, **kwargs)\n\n File "/opt/stack/senlin/senlin/profiles/base.py", line 284, in adopt_node\n return profile.do_adopt(obj, overrides=overrides, snapshot=snapshot)\n\n File "/opt/stack/senlin/senlin/profiles/os/nova/server.py", line 1371, in do_adopt\n spec[self.IMAGE] = server.image[\'id\'] or server.image\n\nKeyError: \'id\'\n'
2018-02-23 18:01:11.604 17706 ERROR senlin.api.common.wsgi

senlin-engine logs:
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server [req-ffbca09b-e5a4-467d-865e-75d85d0bbce6 e1ddb7e7538845968789fd3a863de928 bdeecc1b58004bb19302da77ac056b44 - - -] Exception during message handling: KeyError: 'id'
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server Traceback (most recent call last):
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/server.py", line 163, in _process_incoming
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server res = self.dispatcher.dispatch(message)
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 220, in dispatch
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server return self._do_dispatch(endpoint, method, ctxt, args)
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 190, in _do_dispatch
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server result = func(ctxt, **new_args)
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 157, in wrapper
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server result = f(*args, **kwargs)
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server File "/opt/stack/senlin/senlin/engine/service.py", line 72, in wrapped
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server return func(self, ctx, req_obj)
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server File "/opt/stack/senlin/senlin/engine/service.py", line 1869, in node_adopt
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server profile_cls, spec = self._node_adopt_preview(ctx, req)
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server File "/opt/stack/senlin/senlin/engine/service.py", line 1823, in _node_adopt_preview
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server snapshot=req.snapshot)
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 157, in wrapper
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server result = f(*args, **kwargs)
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server File "/opt/stack/senlin/senlin/profiles/base.py", line 284, in adopt_node
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server return profile.do_adopt(obj, overrides=overrides, snapshot=snapshot)
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server File "/opt/stack/senlin/senlin/profiles/os/nova/server.py", line 1371, in do_adopt
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server spec[self.IMAGE] = server.image['id'] or server.image
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server KeyError: 'id'
2018-02-23 18:01:11.600 18688 ERROR oslo_messaging.rpc.server

blkart (blkart)
Changed in senlin:
assignee: nobody → blkart (blkart)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to senlin (master)

Fix proposed to branch: master
Review: https://review.openstack.org/547364

Changed in senlin:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to senlin (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/547831

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to senlin (master)

Reviewed: https://review.openstack.org/547364
Committed: https://git.openstack.org/cgit/openstack/senlin/commit/?id=6d99c130be820091d7586c607b6fc98fd7b9a1d4
Submitter: Zuul
Branch: master

commit 6d99c130be820091d7586c607b6fc98fd7b9a1d4
Author: blkart <email address hidden>
Date: Fri Feb 23 18:18:42 2018 +0800

    Get image id from multiple places

    The nova server was not saved image id in 'image' attribute if it was
    boot from image(create new volume), then we need to find a volume which
    is bootable and use its image_id for the server.

    Closes-bug: #1751242

    Change-Id: I72e02695f3eb10d1a00976bf68727e0dfb360167
    Signed-off-by: blkart <email address hidden>

Changed in senlin:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to senlin (stable/queens)

Reviewed: https://review.openstack.org/547831
Committed: https://git.openstack.org/cgit/openstack/senlin/commit/?id=38f22bc385f082544db99d9ad053ceff98542a39
Submitter: Zuul
Branch: stable/queens

commit 38f22bc385f082544db99d9ad053ceff98542a39
Author: blkart <email address hidden>
Date: Fri Feb 23 18:18:42 2018 +0800

    Get image id from multiple places

    The nova server was not saved image id in 'image' attribute if it was
    boot from image(create new volume), then we need to find a volume which
    is bootable and use its image_id for the server.

    Closes-bug: #1751242

    Change-Id: I72e02695f3eb10d1a00976bf68727e0dfb360167
    Signed-off-by: blkart <email address hidden>

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/senlin 5.0.1

This issue was fixed in the openstack/senlin 5.0.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/senlin 6.0.0.0b1

This issue was fixed in the openstack/senlin 6.0.0.0b1 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.