wrapper.py fails if no /dev/log exists

Bug #1730949 reported by Cédric Jeanneret deactivated
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.rootwrap
Fix Released
Undecided
Thierry Carrez

Bug Description

Dear Stackers,

Apparently, a nice little bug is present in the wrapper.py, preventing things to go smooth in case journald crashed its "/dev/log" socket (systemctl restart systemd-journald.socket to correct that tragic absence)

Apparently, there's no try/catch for the logging, and this results in the following stack-trace being issued:
Traceback (most recent call last):
  File "/usr/bin/nova-rootwrap", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/oslo_rootwrap/cmd.py", line 89, in main
    config.syslog_log_level)
  File "/usr/lib/python2.7/site-packages/oslo_rootwrap/wrapper.py", line 105, in setup_syslog
    facility=facility)
  File "/usr/lib64/python2.7/logging/handlers.py", line 761, in __init__
    self._connect_unixsocket(address)
  File "/usr/lib64/python2.7/logging/handlers.py", line 789, in _connect_unixsocket
    self.socket.connect(address)
  File "/usr/lib64/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 2] No such file or directory

It might be good to set some catcher in order to either allow the command to go through without logging, or at least report "hey you need to restart journald socket".

The current situation might lead in a complete locking of nova functions due to a peak in the errors, that might deactivate nova-compute on said node… Not a really good situation, to be honnest :(.

Thank you in advance!

Cheers,

C.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.rootwrap (master)

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

Changed in oslo.rootwrap:
assignee: nobody → Thierry Carrez (ttx)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.rootwrap (master)

Reviewed: https://review.openstack.org/522567
Committed: https://git.openstack.org/cgit/openstack/oslo.rootwrap/commit/?id=574dede5efaaf39dd93c91dfb01fc08b03164282
Submitter: Zuul
Branch: master

commit 574dede5efaaf39dd93c91dfb01fc08b03164282
Author: Thierry Carrez <email address hidden>
Date: Thu Nov 23 15:31:09 2017 +0100

    Ignore syslog settings if /dev/log is not present

    When journald crashes, the /dev/log socket is not present
    and rootwrap calls fail with an unclear error message.

    Ignore syslog configuration, log a warning and proceed in
    those cases.

    Change-Id: I4152593696ad63a977f127da3b00934feb14b069
    Closes-Bug: #1730949

Changed in oslo.rootwrap:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.rootwrap 5.12.1

This issue was fixed in the openstack/oslo.rootwrap 5.12.1 release.

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.