Comment 5 for bug 788265

Revision history for this message
Xavi Campa (xavicampa) wrote : Re: [Bug 788265] Re: Can't boot instance because of instance_type wrong pass

I can confirm I'm testing with custom instance types.

2011/6/22 Yuriy Taraday <email address hidden>

> This issue does appear only on custom created instance types, because they
> have real time instead of None in created_at field.
> Built-in (EC2-like) instance types are not affected.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/788265
>
> Title:
> Can't boot instance because of instance_type wrong pass
>
> Status in OpenStack Compute (Nova):
> New
>
> Bug description:
> [root@cloud ~]# nova boot --flavor 1 --image 365320335 mike
> datetime.datetime(2011, 5, 25, 17, 19, 57) is not JSON serializable (HTTP
> 500)
>
> Trace in nova-api:
> 2011-05-25 21:52:36,949 DEBUG nova.rpc [-] Making asynchronous cast on
> scheduler... from (pid=4237) cast
> /usr/lib/python2.7/site-packages/nova/rpc.py:411
> 2011-05-25 21:52:36,994 ERROR nova.api.openstack [-] Caught error:
> datetime.datetime(2011, 5, 25, 17, 19, 57) is not JSON serializable
> (nova.api.openstack): TRACE: Traceback (most recent call last):
> (nova.api.openstack): TRACE: File
> "/usr/lib/python2.7/site-packages/nova/api/openstack/__init__.py", line 59,
> in __call__
> (nova.api.openstack): TRACE: return req.get_response(self.application)
> (nova.api.openstack): TRACE: File
> "/usr/lib/python2.7/site-packages/webob/request.py", line 919, in
> get_response
> (nova.api.openstack): TRACE: application, catch_exc_info=False)
> (nova.api.openstack): TRACE: File
> "/usr/lib/python2.7/site-packages/webob/request.py", line 887, in
> call_application
> (nova.api.openstack): TRACE: app_iter = application(self.environ,
> start_response)
> (nova.api.openstack): TRACE: File
> "/usr/lib/python2.7/site-packages/webob/dec.py", line 159, in __call__
> (nova.api.openstack): TRACE: return resp(environ, start_response)
> (nova.api.openstack): TRACE: File
> "/usr/lib/python2.7/site-packages/webob/dec.py", line 159, in __call__
> (nova.api.openstack): TRACE: return resp(environ, start_response)
> (nova.api.openstack): TRACE: File
> "/usr/lib/python2.7/site-packages/webob/dec.py", line 159, in __call__
> (nova.api.openstack): TRACE: return resp(environ, start_response)
> (nova.api.openstack): TRACE: File
> "/usr/lib/python2.7/site-packages/routes/middleware.py", line 131, in
> __call__
> (nova.api.openstack): TRACE: response = self.app(environ,
> start_response)
> (nova.api.openstack): TRACE: File
> "/usr/lib/python2.7/site-packages/webob/dec.py", line 159, in __call__
> (nova.api.openstack): TRACE: return resp(environ, start_response)
> (nova.api.openstack): TRACE: File
> "/usr/lib/python2.7/site-packages/webob/dec.py", line 147, in __call__
> (nova.api.openstack): TRACE: resp = self.call_func(req, *args,
> **self.kwargs)
> (nova.api.openstack): TRACE: File
> "/usr/lib/python2.7/site-packages/webob/dec.py", line 208, in call_func
> (nova.api.openstack): TRACE: return self.func(req, *args, **kwargs)
> (nova.api.openstack): TRACE: File
> "/usr/lib/python2.7/site-packages/nova/wsgi.py", line 364, in __call__
> (nova.api.openstack): TRACE: result = method(**arg_dict)
> (nova.api.openstack): TRACE: File
> "/usr/lib/python2.7/site-packages/nova/api/openstack/servers.py", line 183,
> in create
> (nova.api.openstack): TRACE: injected_files=injected_files)
> (nova.api.openstack): TRACE: File
> "/usr/lib/python2.7/site-packages/nova/compute/api.py", line 268, in create
> (nova.api.openstack): TRACE: "injected_files": injected_files}})
> (nova.api.openstack): TRACE: File
> "/usr/lib/python2.7/site-packages/nova/rpc.py", line 415, in cast
> (nova.api.openstack): TRACE: publisher.send(msg)
> (nova.api.openstack): TRACE: File
> "/usr/lib/python2.7/site-packages/carrot/messaging.py", line 765, in send
> (nova.api.openstack): TRACE: serializer=serializer)
> (nova.api.openstack): TRACE: File
> "/usr/lib/python2.7/site-packages/carrot/messaging.py", line 690, in
> create_message
> (nova.api.openstack): TRACE: serializer=serializer)
> (nova.api.openstack): TRACE: File
> "/usr/lib/python2.7/site-packages/carrot/serialization.py", line 144, in
> encode
> (nova.api.openstack): TRACE: payload = encoder(data)
> (nova.api.openstack): TRACE: File
> "/usr/lib/python2.7/site-packages/anyjson/__init__.py", line 124, in
> <lambda>
> (nova.api.openstack): TRACE: serialize = lambda value:
> implementation.serialize(value)
> (nova.api.openstack): TRACE: File
> "/usr/lib/python2.7/site-packages/anyjson/__init__.py", line 86, in
> serialize
> (nova.api.openstack): TRACE: raise TypeError(*exc.args)
> (nova.api.openstack): TRACE: TypeError: datetime.datetime(2011, 5, 25, 17,
> 19, 57) is not JSON serializable
> (nova.api.openstack): TRACE:
>
> After commenting instance_type in RPC call it works fine:
> rpc.cast(context,
> FLAGS.scheduler_topic,
> {"method": "run_instance",
> "args": {"topic": FLAGS.compute_topic,
> "instance_id": instance_id,
> #"instance_type": instance_type,
> "availability_zone": availability_zone,
> "injected_files": injected_files}})
>
> [root@cloud ~]# nova-manage --version
> OpenStack Nova version: 2011.3-dev
> (2011.3-nova:tarmac-20110524231040-0tt6rxdaf77re6es)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/nova/+bug/788265/+subscriptions
>