nova-api throws an exception when using S3 image service

Bug #738371 reported by Lorin Hochstein
24
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Undecided
Unassigned

Bug Description

Version: revision 834 (installed from packages on Lucid)

When configured to use S3 image service (--image_service=nova.image.s3.S3ImageService), nova-api throws an exception:

2011-03-19 11:43:24,044 CRITICAL nova [-] maximum recursion depth exceeded
(nova): TRACE: Traceback (most recent call last):
(nova): TRACE: File "/usr/bin/nova-api", line 60, in <module>
(nova): TRACE: service = service.serve_wsgi(service.ApiService)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/service.py", line 306, in serve_wsgi
(nova): TRACE: service.start()
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/service.py", line 240, in start
(nova): TRACE: self.wsgi_app = _run_wsgi(self.conf, self.apis)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/service.py", line 321, in _run_wsgi
(nova): TRACE: app = wsgi.load_paste_app(paste_config_file, api)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/wsgi.py", line 559, in load_paste_app
(nova): TRACE: app = deploy.loadapp("config:%s" % filename, name=appname)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 204, in loadapp
(nova): TRACE: return loadobj(APP, uri, name=name, **kw)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 225, in loadobj
(nova): TRACE: return context.create()
(nova): TRACE: File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 625, in create
(nova): TRACE: return self.object_type.invoke(self)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 108, in invoke
(nova): TRACE: **context.local_conf)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/paste/deploy/util/fixtypeerror.py", line 57, in fix_call
(nova): TRACE: val = callable(*args, **kw)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/paste/urlmap.py", line 25, in urlmap_factory
(nova): TRACE: app = loader.get_app(app_name, global_conf=global_conf)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 297, in get_app
(nova): TRACE: name=name, global_conf=global_conf).create()
(nova): TRACE: File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 625, in create
(nova): TRACE: return self.object_type.invoke(self)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 168, in invoke
(nova): TRACE: app = filter(app)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/wsgi.py", line 212, in _factory
(nova): TRACE: return cls(app, **local_config)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/api/ec2/__init__.py", line 191, in __init__
(nova): TRACE: self.controller = utils.import_class(controller)()
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/api/ec2/cloud.py", line 84, in __init__
(nova): TRACE: self.image_service = s3.S3ImageService()
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/image/s3.py", line 50, in __init__
(nova): TRACE: service = utils.import_object(FLAGS.image_service)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/utils.py", line 75, in import_object
(nova): TRACE: return cls()
...
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/image/s3.py", line 50, in __init__
(nova): TRACE: service = utils.import_object(FLAGS.image_service)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/flags.py", line 139, in __getattr__
(nova): TRACE: val = gflags.FlagValues.__getattr__(self, name)
(nova): TRACE: File "/usr/lib/python2.6/dist-packages/gflags.py", line 808, in __getattr__
(nova): TRACE: fl = self.FlagDict()
(nova): TRACE: RuntimeError: maximum recursion depth exceeded

Revision history for this message
Lorin Hochstein (lorinh) wrote :

The problem seems to be in the S3ImageService constructor. If the image_service flag points to the S3ImageService, then the constructor will create an S3ImageService object:

class S3ImageService(service.BaseImageService):
    def __init__(self, service=None, *args, **kwargs):
        if service == None:
            service = utils.import_object(FLAGS.image_service)

The problem can be reproduced with the following Python code.

from nova import flags
flags.FLAGS.image_service = 'nova.image.s3.S3ImageService'
import nova.image.s3
s3 = nova.image.s3.S3ImageService()

Revision history for this message
Vish Ishaya (vishvananda) wrote : Re: [Bug 738371] Re: nova-api throws an exception when using S3 image service
Download full text (5.1 KiB)

The s3 image service isn't meant to be specified in the flag. It wraps the other image services for use by the ec2 api. The ec2 api will always use the s3 image service. If you specify local image service using the flag it will wrap the local image service. If you specify the glance image service, it will wrap glance.
On Mar 19, 2011, at 7:27 PM, Lorin Hochstein wrote:

> The problem seems to be in the S3ImageService constructor. If the
> image_service flag points to the S3ImageService, then the constructor
> will create an S3ImageService object:
>
> class S3ImageService(service.BaseImageService):
> def __init__(self, service=None, *args, **kwargs):
> if service == None:
> service = utils.import_object(FLAGS.image_service)
>
>
> The problem can be reproduced with the following Python code.
>
> from nova import flags
> flags.FLAGS.image_service = 'nova.image.s3.S3ImageService'
> import nova.image.s3
> s3 = nova.image.s3.S3ImageService()
>
> --
> You received this bug notification because you are a member of Nova Bug
> Team, which is subscribed to OpenStack Compute (nova).
> https://bugs.launchpad.net/bugs/738371
>
> Title:
> nova-api throws an exception when using S3 image service
>
> Status in OpenStack Compute (Nova):
> New
>
> Bug description:
> Version: revision 834 (installed from packages on Lucid)
>
> When configured to use S3 image service
> (--image_service=nova.image.s3.S3ImageService), nova-api throws an
> exception:
>
> 2011-03-19 11:43:24,044 CRITICAL nova [-] maximum recursion depth exceeded
> (nova): TRACE: Traceback (most recent call last):
> (nova): TRACE: File "/usr/bin/nova-api", line 60, in <module>
> (nova): TRACE: service = service.serve_wsgi(service.ApiService)
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/service.py", line 306, in serve_wsgi
> (nova): TRACE: service.start()
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/service.py", line 240, in start
> (nova): TRACE: self.wsgi_app = _run_wsgi(self.conf, self.apis)
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/service.py", line 321, in _run_wsgi
> (nova): TRACE: app = wsgi.load_paste_app(paste_config_file, api)
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/wsgi.py", line 559, in load_paste_app
> (nova): TRACE: app = deploy.loadapp("config:%s" % filename, name=appname)
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 204, in loadapp
> (nova): TRACE: return loadobj(APP, uri, name=name, **kw)
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 225, in loadobj
> (nova): TRACE: return context.create()
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 625, in create
> (nova): TRACE: return self.object_type.invoke(self)
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 108, in invoke
> (nova): TRACE: **context.local_conf)
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/paste/deploy/util/fixtypeerror.py", line 57, in fix_call
> (nova): TRACE: val = callable(*args, **kw)
> (nov...

Read more...

Revision history for this message
Lorin Hochstein (lorinh) wrote :

Is this a recent change or has it never been allowed? The docs say that the default for the image service flag is 'nova.image.s3.S3ImageService': http://docs.openstack.org/openstack-compute/admin/content/ch05s08.html

Revision history for this message
Vish Ishaya (vishvananda) wrote :

This is a recent change. Looks like the docs need to be updated.

On Mar 20, 2011, at 8:26 PM, Lorin Hochstein wrote:

> compute/admin/content/ch05s08.html

Revision history for this message
Lorin Hochstein (lorinh) wrote :

Vish:

Quick question to clarify: We have a setup where we have a head node that will run the nova-api service, a separate storage node where we would like to store images, and several compute nodes that will run the nova-compute service and will serve as hosts for the VMs. For this type of configuration, is the glance image service the only option that would allow the images to reside on a separate machine from the VM hosts (excluding remote mounted filesystem solutions like NFS)?

Revision history for this message
Vish Ishaya (vishvananda) wrote :
Download full text (4.7 KiB)

Yes that is correct. This is specifically what glance was made for. You can
have glance backend to local storage which will store the images on the
storage node or to swift which offers redundancy.
On Mar 21, 2011 8:41 AM, "Lorin Hochstein" <email address hidden>
wrote:
> Vish:
>
> Quick question to clarify: We have a setup where we have a head node
> that will run the nova-api service, a separate storage node where we
> would like to store images, and several compute nodes that will run the
> nova-compute service and will serve as hosts for the VMs. For this type
> of configuration, is the glance image service the only option that would
> allow the images to reside on a separate machine from the VM hosts
> (excluding remote mounted filesystem solutions like NFS)?
>
> --
> You received this bug notification because you are a member of Nova Bug
> Team, which is subscribed to OpenStack Compute (nova).
> https://bugs.launchpad.net/bugs/738371
>
> Title:
> nova-api throws an exception when using S3 image service
>
> Status in OpenStack Compute (Nova):
> New
>
> Bug description:
> Version: revision 834 (installed from packages on Lucid)
>
> When configured to use S3 image service
> (--image_service=nova.image.s3.S3ImageService), nova-api throws an
> exception:
>
> 2011-03-19 11:43:24,044 CRITICAL nova [-] maximum recursion depth exceeded
> (nova): TRACE: Traceback (most recent call last):
> (nova): TRACE: File "/usr/bin/nova-api", line 60, in <module>
> (nova): TRACE: service = service.serve_wsgi(service.ApiService)
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/service.py", line
306, in serve_wsgi
> (nova): TRACE: service.start()
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/service.py", line
240, in start
> (nova): TRACE: self.wsgi_app = _run_wsgi(self.conf, self.apis)
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/service.py", line
321, in _run_wsgi
> (nova): TRACE: app = wsgi.load_paste_app(paste_config_file, api)
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/wsgi.py", line 559,
in load_paste_app
> (nova): TRACE: app = deploy.loadapp("config:%s" % filename, name=appname)
> (nova): TRACE: File
"/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 204, in
loadapp
> (nova): TRACE: return loadobj(APP, uri, name=name, **kw)
> (nova): TRACE: File
"/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 225, in
loadobj
> (nova): TRACE: return context.create()
> (nova): TRACE: File
"/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 625, in create
> (nova): TRACE: return self.object_type.invoke(self)
> (nova): TRACE: File
"/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 108, in invoke
> (nova): TRACE: **context.local_conf)
> (nova): TRACE: File
"/usr/lib/pymodules/python2.6/paste/deploy/util/fixtypeerror.py", line 57,
in fix_call
> (nova): TRACE: val = callable(*args, **kw)
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/paste/urlmap.py", line
25, in urlmap_factory
> (nova): TRACE: app = loader.get_app(app_name, global_conf=global_conf)
> (nova): TRACE: File
"/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 297, in
get_app
> (nova): TRACE: name=name, glo...

Read more...

Revision history for this message
Lorin Hochstein (lorinh) wrote :

OK, since this technically isn't a bug (just an implementation change), I've set the bug status to "invalid".

Changed in nova:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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