exception caused by logger in collector

Bug #1078190 reported by Lianhao Lu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Undecided
Lianhao Lu
oslo-incubator
Fix Released
Undecided
Lianhao Lu
Grizzly
Fix Released
Undecided
Lianhao Lu

Bug Description

Using the latest code (commit id: 171b1ce4495c104b8cf19f0a7609a71a354446ba) with the patch from https://review.openstack.org/15622, the collector can be launched.

But once upon a "record_metering_data" rpc call is executed, an exception happens in LOG.info:

Traceback (most recent call last):
  File "/usr/lib/python2.7/logging/__init__.py", line 846, in emit
    msg = self.format(record)
  File "/opt/stack/ceilometer/ceilometer/openstack/common/log.py", line 463, in format
    return logging.StreamHandler.format(self, record)
  File "/usr/lib/python2.7/logging/__init__.py", line 723, in format
    return fmt.format(record)
  File "/opt/stack/ceilometer/ceilometer/openstack/common/log.py", line 427, in format
    return logging.Formatter.format(self, record)
  File "/usr/lib/python2.7/logging/__init__.py", line 467, in format
    s = self._fmt % record.__dict__
KeyError: u'user_id'
Logged from file service.py, line 134
Traceback (most recent call last):
  File "/usr/lib/python2.7/logging/__init__.py", line 846, in emit
    msg = self.format(record)
  File "/opt/stack/ceilometer/ceilometer/openstack/common/log.py", line 463, in format
    return logging.StreamHandler.format(self, record)
  File "/usr/lib/python2.7/logging/__init__.py", line 723, in format
    return fmt.format(record)
  File "/opt/stack/ceilometer/ceilometer/openstack/common/log.py", line 427, in format
    return logging.Formatter.format(self, record)
  File "/usr/lib/python2.7/logging/__init__.py", line 467, in format
    s = self._fmt % record.__dict__
KeyError: u'user_id'
Logged from file service.py, line 147

Revision history for this message
Lianhao Lu (lianhao-lu) wrote :

forget about the KeyError in service.py line 147, it's a logging message I created for debug. The focus is on the line 134.

Revision history for this message
Lianhao Lu (lianhao-lu) wrote :

This is because the logging_context_format_string used in LegacyFormatter() is inconsistent with context.RequestContext() and log.ContextAdapter(). It uses some fields the latter 2 don't have.

Changed in oslo:
assignee: nobody → Lianhao Lu (lianhao-lu)
Revision history for this message
Lianhao Lu (lianhao-lu) wrote :

Looks like the hudson can't automatically post review message for oslo-incubator project.

Here is the patch being reviewed: https://review.openstack.org/#/c/15956/

Changed in oslo:
status: New → In Progress
Lianhao Lu (lianhao-lu)
description: updated
Revision history for this message
Lianhao Lu (lianhao-lu) wrote :
Changed in oslo:
status: In Progress → Fix Committed
Lianhao Lu (lianhao-lu)
Changed in ceilometer:
assignee: nobody → Lianhao Lu (lianhao-lu)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

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

Changed in ceilometer:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/16168
Committed: http://github.com/openstack/ceilometer/commit/26c5ce081a8bfa2f6c7d6200426787ec94aea7d7
Submitter: Jenkins
Branch: master

commit 26c5ce081a8bfa2f6c7d6200426787ec94aea7d7
Author: Lianhao Lu <email address hidden>
Date: Thu Nov 15 18:38:36 2012 +0800

    Update openstack.common(except policy).

    Fixed bug 1078190.

    Change-Id: I293f1888362c64b0af3f9c66e4ebea94d987e59a

Changed in ceilometer:
status: In Progress → Fix Committed
Mark McLoughlin (markmc)
Changed in oslo:
milestone: none → grizzly-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: none → grizzly-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: grizzly-2 → 2013.1
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.