[openstack-dev] [ceilometer] Error "No handler could be found for logger "stevedore.extension""

Doug Hellmann doug.hellmann at dreamhost.com
Wed Nov 14 01:48:43 UTC 2012


On Tue, Nov 13, 2012 at 7:57 PM, Jiang, Yunhong <yunhong.jiang at intel.com>wrote:

>  Doug, thanks for reply. ****
>
> ** **
>
> It’s logging module failed to print anything other than this warning. The
> issue happens in followed code on _load_plugins() from
> stevedore/extension.py. If exception happen when loading plugin, while the
> code intended to log the exception stacktrace, but it printed only one
> warning of “"No handler could be found for logger " stevedore.extension""
> printed, no stack trace at all.
>

Right. I think that's a print statement embedded in the standard library
logging module, and not an exception.

http://hg.python.org/cpython/file/bb21c800cf49/Lib/logging/__init__.py#l1323



> ****
>
> ** **
>
> ** **
>
>    def _load_plugins(self, invoke_on_load, invoke_args, invoke_kwds):****
>
>         extensions = []****
>
>         for ep in pkg_resources.iter_entry_points(self.namespace):****
>
>             LOG.debug('found extension %r', ep)****
>
>             try:****
>
>                 ext = self._load_one_plugin(ep,****
>
>                                             invoke_on_load,****
>
>                                             invoke_args,****
>
>                                             invoke_kwds,****
>
>                                             )****
>
>                 if ext:****
>
>                     extensions.append(ext)****
>
>             except KeyboardInterrupt:****
>
>                 raise****
>
>             except Exception as err:****
>
>                 LOG.error('Could not load %r: %s', ep.name, err)   >>>
> not printed****
>
>                 LOG.exception(err)              >>> not printed****
>
>         return extensions****
>
> ** **
>
> IMHO, I don’t think stevedore should handle the exception silently. The
> caller should handle that to be more flexible. Or at least it should know
> that some plug-in failed to load. Possibly we can return plugin iterator to
> caller, and caller load them one by one.****
>
> ** **
>
> Possibly we can dsicuss on the stevedore side.
>

Part of the point of stevedore is to make it so the caller doesn't have to
worry about that sort of thing. An exception is raised if no plugins can be
loaded, but otherwise individual plugins shouldn't cause errors.

Doug


> ****
>
> ** **
>
> Thanks****
>
> --jyh****
>
> ** **
>
> ** **
>
> ****
>
>
>
>         IMHO the _load_plugins() in stevestore.extension should not handle
> the exception, instead, the caller should do that.****
>
> ** **
>
> Is it actually an exception, or is it just the logging module reporting a
> warning?****
>
> ** **
>
> In either case, I opened a bug (
> https://github.com/dreamhost/stevedore/issues/2) to address this in
> stevedore.****
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
>  ****
>
>
> Thanks
> --jyh****
>
>  ** **
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20121113/42537593/attachment.html>


More information about the OpenStack-dev mailing list