Logging prints traces for q-svc and dhcp-agt

Bug #1254530 reported by Eugene Nikanorov
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Maru Newby

Bug Description

q-svc and q-dhcp services are printing the following stack traces in their screen tabs:

Traceback (most recent call last):
  File "/usr/lib/python2.7/logging/__init__.py", line 850, in emit
    msg = self.format(record)
  File "/opt/stack/neutron/neutron/openstack/common/log.py", line 566, 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/neutron/neutron/openstack/common/log.py", line 530, 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'project_name'

As a workaround, colorized logging config could be fixed to remove project_name from the list of fields in neutron.conf and that solves the issue. However new devstack setup brings the problem back.

Revision history for this message
Jian Wen (wenjianhn) wrote :

The workaround works.
Thanks.

Changed in devstack:
status: New → Confirmed
affects: devstack → neutron
Changed in neutron:
assignee: nobody → Maru Newby (maru)
status: Confirmed → In Progress
Revision history for this message
Maru Newby (maru) wrote :

q-svc has similar errors in its logs due to attempting to log unexpected kwargs before the context has been fully initialized. I'm going to submit an updated patch.

Revision history for this message
Akihiro Motoki (amotoki) wrote :

The workaround is to set LOG_COLOR=False in localrc. Non-colorized log format does not use "project_name".

Changed in neutron:
importance: Undecided → High
milestone: none → icehouse-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/58348
Committed: http://github.com/openstack/neutron/commit/4fd4d490ac1e12b2bf835949447d21b64c641616
Submitter: Jenkins
Branch: master

commit 4fd4d490ac1e12b2bf835949447d21b64c641616
Author: Maru Newby <email address hidden>
Date: Mon Nov 25 17:35:54 2013 +0000

    Fix format errors seen in rpc logging

    The previous commit for this bug didn't include the 'project_name'
    key in the context dict. The missing key was causing the amqp
    module to generate log formatting exceptions instead of normal
    log output.

    Separately, the context module itself was generating logging
    exceptions in the quantum service when logging was attempted
    before the context was fully initialized

    Change-Id: I0f4c6f5a6804442932c9b2bd409a258cfc2419ff
    Closes-Bug: #1254530
    Related-Bug: #1239923

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

Reviewed: https://review.openstack.org/58692
Committed: http://github.com/openstack/neutron/commit/5b61df1f539d78cf9d164a142d731e471aa18d4e
Submitter: Jenkins
Branch: master

commit 5b61df1f539d78cf9d164a142d731e471aa18d4e
Author: Maru Newby <email address hidden>
Date: Wed Nov 27 07:57:48 2013 +0000

    Stop logging unnecessary warning on context create

    The context was previously logging at the 'warn' level when unknown
    kwargs were being passed to its __init__(). Since the agents were
    passing tenant=None with each rpc request, this was generating an
    unreasonable amount of log chatter that would not be useful to an
    operator. The fix is to log at the debug level instead so that
    the operators don't see the output by default but developers can
    still choose to.

    Change-Id: I5c328f628c597eb949c1fe67b23120d2b5d1c7da
    Related-Bug: #1254530
    Partial-Bug: #1255441

Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: icehouse-1 → 2014.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.