OpenStack Telemetry (Ceilometer)

exception caused by logger in collector

Reported by Lianhao Lu on 2012-11-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Undecided
Lianhao Lu
oslo
Undecided
Lianhao Lu
Grizzly
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

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.

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)
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) on 2012-11-13
description: updated
Lianhao Lu (lianhao-lu) wrote :
Changed in oslo:
status: In Progress → Fix Committed
Lianhao Lu (lianhao-lu) on 2012-11-15
Changed in ceilometer:
assignee: nobody → Lianhao Lu (lianhao-lu)

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

Changed in ceilometer:
status: New → In Progress

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) on 2012-12-03
Changed in oslo:
milestone: none → grizzly-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2013-01-09
Changed in ceilometer:
milestone: none → grizzly-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2013-04-04
Changed in ceilometer:
milestone: grizzly-2 → 2013.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers