masakari-api failed to launch due to setting of watch_log_file and log_file

Bug #1740111 reported by takahara.kengo
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

I added the following settings to /etc/masakari/masakari.conf.
log_file = /var/log/masakari/masakari.log
watch_log_file = true

And then I failed to launch masakari-api with above settings.
Masakari-api output error logs as follows:

$ masakari-api
Config option database.idle_timeout is deprecated. Use option database.connection_recycle_time instead.
Traceback (most recent call last):
  File "/usr/local/bin/masakari-api", line 10, in <module>
  File "/usr/local/lib/python2.7/dist-packages/masakari/cmd/", line 37, in main
    logging.setup(CONF, "masakari")
  File "/usr/local/lib/python2.7/dist-packages/oslo_log/", line 264, in setup
    _setup_logging_from_conf(conf, product_name, version)
  File "/usr/local/lib/python2.7/dist-packages/oslo_log/", line 353, in _setup_logging_from_conf
    filelog = file_handler(logpath)
  File "/usr/local/lib/python2.7/dist-packages/oslo_log/", line 75, in __init__
  File "/usr/local/lib/python2.7/dist-packages/oslo_log/", line 86, in _watch_file
  File "/usr/local/lib/python2.7/dist-packages/", line 1461, in __init__
    threshold, timeout)
  File "/usr/local/lib/python2.7/dist-packages/", line 1138, in __init__
    self._pollobj = select.poll()
AttributeError: 'module' object has no attribute 'poll'

[Impact on other projects]
watch_log_file and log_file are configuration options of oslo.log.
So I tried to set same options for nova-compute.
As a result, same issue occurred in the nova-compute process.

There is a possibility that this issue affects all openstack projects using oslo.log.

[Caus of bug]
I think the root cause of this isse is the following bug of pyinotify.
pyinotify is used by oslo.log.
But this pull requests is not merged yet.

Revision history for this message
Rikimaru Honjo (honjo-rikimaru-c6) wrote :

"watch_log_file" is a configuration value of oslo.log.
So I added oslo.log to affects project.

description: updated
Revision history for this message
takahara.kengo (takahara.kengo) wrote :

Additional Infomation:
I could launch masakari-api and nova-compute after applying the patch[1] to my environment.

description: updated
Revision history for this message
Rikimaru Honjo (honjo-rikimaru-c6) wrote :

I sent a mail about this issue to openstack-dev ML.
As a result, Doug Hellmann replied to me and presented the policy to fix.

Changed in oslo.log:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Rikimaru Honjo (honjo-rikimaru-c6) wrote :

I tried to replace pyinotfy to inotify according to the discussion with Doug.
But, the same error was occurred.

I confirmed issues of inotify.
As a result, I found the report about same error. [1]

The above issue page said that epol is Linux only.
But, I was using Linux...
I'm asking about it on the above issue page.

The repository name is "PyInotify", but inotify's repository is this.
Please show the below page.

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.