I find the reason. When devstack install sahara, "logging_context_format_string" would be configured by default to: logging_context_format_string = %(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s [^[[01;36m%(request_id)s ^[[00;36m%(user_name)s %(project_name)s%(color)s] ^[[01;35m%(instance)s%(color)s%(message)s^[[00m
But we don't have user_name, we're using username: https://github.com/openstack/sahara/blob/master/sahara/context.py#L40 The error do not happen until we merged https://review.openstack.org/#/c/172426/. When we do LOG.debug with a Context instance. Summited a fix already : https://review.openstack.org/#/c/180051/ Thanks. -chen From: Li, Chen Sent: Tuesday, May 05, 2015 10:43 AM To: OpenStack Development Mailing List (not for usage questions) (openstack-dev@lists.openstack.org) Subject: [Sahara][oslo]Error in Log.debug Hi all, I just upgrade my devstack and re-installed. My sahara keep reporting errors: 2015-05-05 10:42:00.453 DEBUG sahara.openstack.common.loopingcall [-] Dynamic looping call <bound method SaharaPeriodicTasks.run_periodic_tasks of <sahara.service.periodic.SaharaPeriodicTasks object at 0x7f2ccef987d0>> sleeping for 35.91 seconds from (pid=5361) _inner /opt/stack/sahara/sahara/openstack/common/loopingcall.py:132 2015-05-05 10:42:36.397 DEBUG sahara.openstack.common.periodic_task [-] Running periodic task SaharaPeriodicTasks.terminate_unneeded_transient_clusters from (pid=5361) run_periodic_tasks /opt/stack/sahara/sahara/openstack/common/periodic_task.py:219 Traceback (most recent call last): File "/usr/lib/python2.7/logging/__init__.py", line 851, in emit msg = self.format(record) File "/usr/local/lib/python2.7/dist-packages/oslo_log/handlers.py", line 69, in format return logging.StreamHandler.format(self, record) File "/usr/lib/python2.7/logging/__init__.py", line 724, in format return fmt.format(record) File "/usr/local/lib/python2.7/dist-packages/oslo_log/formatters.py", line 235, 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: 'user_name' Logged from file periodic.py, line 137 2015-05-05 10:42:36.434 DEBUG sahara.openstack.common.loopingcall [-] Dynamic looping call <bound method SaharaPeriodicTasks.run_periodic_tasks of <sahara.service.periodic.SaharaPeriodicTasks object at 0x7f2ccef987d0>> sleeping for 9.96 seconds from (pid=5361) _inner /opt/stack/sahara/sahara/openstack/common/loopingcall.py:132 2015-05-05 10:42:46.408 DEBUG sahara.openstack.common.periodic_task [-] Running periodic task SaharaPeriodicTasks.update_job_statuses from (pid=5361) run_periodic_tasks /opt/stack/sahara/sahara/openstack/common/periodic_task.py:219 Traceback (most recent call last): File "/usr/lib/python2.7/logging/__init__.py", line 851, in emit msg = self.format(record) File "/usr/local/lib/python2.7/dist-packages/oslo_log/handlers.py", line 69, in format return logging.StreamHandler.format(self, record) File "/usr/lib/python2.7/logging/__init__.py", line 724, in format return fmt.format(record) File "/usr/local/lib/python2.7/dist-packages/oslo_log/formatters.py", line 235, 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: 'user_name' Logged from file periodic.py, line 131 Anyone know why this happens ??? Thanks. -chen
__________________________________________________________________________ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev