publish_errors option is broken

Bug #1023573 reported by Russell Bryant
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo-incubator
Invalid
Medium
Eric Harney

Bug Description

When publish_errors is enabled, the logger raises an exception. nova.notifier.api has not been imported.

==> /net/srh-07/var/log/nova/network.log <==
2012-06-12 14:22:33 ERROR nova.network.manager [req-e2a5322d-e451-4d6e-86a4-a5d6da07df33 d253de78cff2426d822d03ee09a9a890 98a6861a575841d3a830dc0f1d983fdd] Unable to release 192.168.0.12 because vif doesn't exist.
2012-06-12 14:22:33 ERROR nova.rpc.amqp [req-e2a5322d-e451-4d6e-86a4-a5d6da07df33 d253de78cff2426d822d03ee09a9a890 98a6861a575841d3a830dc0f1d983fdd] Exception during message handling
2012-06-12 14:22:33 TRACE nova.rpc.amqp Traceback (most recent call last):
2012-06-12 14:22:33 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/rpc/amqp.py", line 253, in _process_data
2012-06-12 14:22:33 TRACE nova.rpc.amqp rval = node_func(context=ctxt, **node_args)
2012-06-12 14:22:33 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/network/manager.py", line 257, in wrapped
2012-06-12 14:22:33 TRACE nova.rpc.amqp return func(self, context, *args, **kwargs)
2012-06-12 14:22:33 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/network/manager.py", line 379, in deallocate_for_instance
2012-06-12 14:22:33 TRACE nova.rpc.amqp super(FloatingIP, self).deallocate_for_instance(context, **kwargs)
2012-06-12 14:22:33 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/network/manager.py", line 257, in wrapped
2012-06-12 14:22:33 TRACE nova.rpc.amqp return func(self, context, *args, **kwargs)
2012-06-12 14:22:33 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/network/manager.py", line 934, in deallocate_for_instance
2012-06-12 14:22:33 TRACE nova.rpc.amqp **kwargs)
2012-06-12 14:22:33 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/network/manager.py", line 247, in deallocate_fixed_ip
2012-06-12 14:22:33 TRACE nova.rpc.amqp address)
2012-06-12 14:22:33 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/network/manager.py", line 1228, in deallocate_fixed_ip
2012-06-12 14:22:33 TRACE nova.rpc.amqp LOG.error(msg % address)
2012-06-12 14:22:33 TRACE nova.rpc.amqp File "/usr/lib64/python2.6/logging/__init__.py", line 1329, in error
2012-06-12 14:22:33 TRACE nova.rpc.amqp self.logger.error(msg, *args, **kwargs)
2012-06-12 14:22:33 TRACE nova.rpc.amqp File "/usr/lib64/python2.6/logging/__init__.py", line 1082, in error
2012-06-12 14:22:33 TRACE nova.rpc.amqp self._log(ERROR, msg, args, **kwargs)
2012-06-12 14:22:33 TRACE nova.rpc.amqp File "/usr/lib64/python2.6/logging/__init__.py", line 1173, in _log
2012-06-12 14:22:33 TRACE nova.rpc.amqp self.handle(record)
2012-06-12 14:22:33 TRACE nova.rpc.amqp File "/usr/lib64/python2.6/logging/__init__.py", line 1183, in handle
2012-06-12 14:22:33 TRACE nova.rpc.amqp self.callHandlers(record)
2012-06-12 14:22:33 TRACE nova.rpc.amqp File "/usr/lib64/python2.6/logging/__init__.py", line 1220, in callHandlers
2012-06-12 14:22:33 TRACE nova.rpc.amqp hdlr.handle(record)
2012-06-12 14:22:33 TRACE nova.rpc.amqp File "/usr/lib64/python2.6/logging/__init__.py", line 679, in handle
2012-06-12 14:22:33 TRACE nova.rpc.amqp self.emit(record)
2012-06-12 14:22:33 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/log.py", line 274, in emit
2012-06-12 14:22:33 TRACE nova.rpc.amqp nova.notifier.api.notify('nova.error.publisher', 'error_notification',
2012-06-12 14:22:33 TRACE nova.rpc.amqp AttributeError: 'module' object has no attribute 'api'
2012-06-12 14:22:33 TRACE nova.rpc.amqp

Changed in nova:
importance: Undecided → Medium
status: New → Confirmed
tags: added: low-hanging-fruit
Revision history for this message
Bhuvan Arumugam (bhuvan) wrote :

Russell, I couldn't replicate this issue. Can you please confirm the issue still exist?

I added following lines in /etc/nova/nova.conf file and restarted nova-manage. But I don't find any ERROR/TRACE entries in log file /opt/stack/nova/nova-network.log.

  publish_errors=True
  log_dir=/opt/stack/nova

If the issue still exist, can you please let me know the steps to replicate?

Revision history for this message
Mark McLoughlin (markmc) wrote :

Russell - any more info? Looks like bhuvan can't reproduce?

Untargeting from Essex until we confirm it applies there

Changed in nova:
status: Confirmed → Incomplete
no longer affects: nova/essex
Revision history for this message
Russell Bryant (russellb) wrote :

to reproduce, something has to log an ERROR

The code still looks broken to me. It's doing nova.notifier.api.notify(...), but that hasn't been imported anywhere.

Changed in nova:
status: Incomplete → Confirmed
Revision history for this message
Christopher Yeoh (cyeoh-0) wrote :

Note that this is fixed in the Folsom code (by commit d335457f) so only effects Essex now.

affects: nova → openstack-common
Changed in openstack-common:
assignee: nobody → Eric Harney (eharney)
Mark McLoughlin (markmc)
affects: openstack-common → oslo
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

Latest oslo and nova both seem to have the following in log.py

from nova.openstack.common import notifier

and then

        notifier.api.notify(None, 'error.publisher',
                            'error_notification',
                            notifier.api.ERROR,
                            dict(error=record.msg))

Looks like this bug is already taken care of. please reopen if necessary.

Changed in oslo:
status: Confirmed → Invalid
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.