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

Bug #1740111 reported by takahara.kengo on 2017-12-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
masakari
Undecided
Unassigned
oslo.log
Medium
Unassigned

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>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/masakari/cmd/api.py", line 37, in main
    logging.setup(CONF, "masakari")
  File "/usr/local/lib/python2.7/dist-packages/oslo_log/log.py", line 264, in setup
    _setup_logging_from_conf(conf, product_name, version)
  File "/usr/local/lib/python2.7/dist-packages/oslo_log/log.py", line 353, in _setup_logging_from_conf
    filelog = file_handler(logpath)
  File "/usr/local/lib/python2.7/dist-packages/oslo_log/watchers.py", line 75, in __init__
    self._watch_file()
  File "/usr/local/lib/python2.7/dist-packages/oslo_log/watchers.py", line 86, in _watch_file
    timeout=FastWatchedFileHandler.TIMEOUT)
  File "/usr/local/lib/python2.7/dist-packages/pyinotify.py", line 1461, in __init__
    threshold, timeout)
  File "/usr/local/lib/python2.7/dist-packages/pyinotify.py", 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.
https://github.com/seb-m/pyinotify/pull/117

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

description: updated
takahara.kengo (takahara.kengo) wrote :

Additional Infomation:
I could launch masakari-api and nova-compute after applying the patch[1] to my environment.
[1]: https://github.com/seb-m/pyinotify/pull/117/files

description: updated

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.
(Thanks!)

http://lists.openstack.org/pipermail/openstack-dev/2018-January/125966.html

Changed in oslo.log:
status: New → Triaged
importance: Undecided → Medium

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.
https://github.com/dsoprea/PyInotify/issues/36 [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.

[1]
The repository name is "PyInotify", but inotify's repository is this.
Please show the below page.
https://pypi.python.org/pypi/inotify/0.2.9

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.