neutron-keepalived-state-change can not start on some python3 distro

Bug #1822155 reported by LIU Yulong on 2019-03-28
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Low
LIU Yulong

Bug Description

LOG:
DEBUG neutron.common.config [-] command line: /opt/stack/neutron/.tox/dsvm-functional/bin/neutron-keepalived-state-change --router_id=82ec666b-621b-4e70-bac1-f43f325540f8 --namespace=snat-82ec666b-621b-4e70-bac1-f43f325540f8@agent1 --conf_dir=/tmp/tmp9_bn0tg1/tmpd9zia3km/ha_confs/82ec666b-621b-4e70-bac1-f43f325540f8 --log-file=/tmp/tmp9_bn0tg1/tmpd9zia3km/ha_confs/82ec666b-621b-4e70-bac1-f43f325540f8/82ec666b-621b-4e70-bac1-f43f325540f8_state_change.log --monitor_interface=ha-76979d9f-9f --monitor_cidr=169.254.0.14/24 --pid_file=/tmp/tmp9_bn0tg1/tmpd9zia3km/external/pids/82ec666b-621b-4e70-bac1-f43f325540f8.monitor.pid --state_path=/tmp/tmp9_bn0tg1/tmpd9zia3km --user=1000 --group=1000 --AGENT-root_helper=sudo /opt/stack/neutron/.tox/dsvm-functional/bin/neutron-rootwrap /opt/stack/neutron/.tox/dsvm-functional/etc/neutron/rootwrap.conf --AGENT-root_helper_daemon=sudo /opt/stack/neutron/.tox/dsvm-functional/bin/neutron-rootwrap-daemon /opt/stack/neutron/.tox/dsvm-functional/etc/neutron/rootwrap.conf {{(pid=12369) setup_logging /opt/stack/neutron/.tox/dsvm-functional/lib/python3.4/site-packages/neutron/common/config.py:103}}
CRITICAL neutron [-] Unhandled error: TypeError: unsupported operand type(s) for %: 'bytes' and 'int'
ERROR neutron Traceback (most recent call last):
ERROR neutron File "/opt/stack/neutron/.tox/dsvm-functional/bin/neutron-keepalived-state-change", line 10, in <module>
ERROR neutron sys.exit(main())
ERROR neutron File "/opt/stack/neutron/.tox/dsvm-functional/lib/python3.4/site-packages/neutron/cmd/keepalived_state_change.py", line 19, in main
ERROR neutron keepalived_state_change.main()
ERROR neutron File "/opt/stack/neutron/.tox/dsvm-functional/lib/python3.4/site-packages/neutron/agent/l3/keepalived_state_change.py", line 178, in main
ERROR neutron cfg.CONF.monitor_cidr).start()
ERROR neutron File "/opt/stack/neutron/.tox/dsvm-functional/lib/python3.4/site-packages/neutron/agent/linux/daemon.py", line 247, in start
ERROR neutron self.daemonize()
ERROR neutron File "/opt/stack/neutron/.tox/dsvm-functional/lib/python3.4/site-packages/neutron/agent/linux/daemon.py", line 228, in daemonize
ERROR neutron self.pidfile.write(os.getpid())
ERROR neutron File "/opt/stack/neutron/.tox/dsvm-functional/lib/python3.4/site-packages/neutron/agent/linux/daemon.py", line 139, in write
ERROR neutron os.write(self.fd, b"%d" % pid)
ERROR neutron TypeError: unsupported operand type(s) for %: 'bytes' and 'int'
ERROR neutron

LIU Yulong (dragon889) on 2019-03-28
Changed in neutron:
assignee: nobody → LIU Yulong (dragon889)

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

Changed in neutron:
status: New → In Progress

Change abandoned by LIU Yulong (<email address hidden>) on branch: master
Review: https://review.openstack.org/648456
Reason: Log is enabled by default.

Bence Romsics (bence-romsics) wrote :

This problem seems to me python3.4 specific to me, please see here:

https://legacy.python.org/dev/peps/pep-0461/

Before 3.5 python did not support bytestring interpolation.

Do we support python3.4 at all? I don't think we have any python3.4 gate jobs. I think we started with 3.5 when moving to 3:

https://governance.openstack.org/tc/goals/pike/python35.html

Changed in neutron:
importance: Undecided → Low
tags: added: py34
Slawek Kaplonski (slaweq) wrote :

Bence: correct. We are not gating against python 3.4 at all. Currently everything (or almost everything) is done on python 3.6. If tests are run on Ubuntu Xenial than it's python 3.5

Reviewed: https://review.openstack.org/648459
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=97923ae4a89217f90417d2561a1366e8aacd7f25
Submitter: Zuul
Branch: master

commit 97923ae4a89217f90417d2561a1366e8aacd7f25
Author: LIU Yulong <email address hidden>
Date: Fri Mar 29 00:16:10 2019 +0800

    Convert int to bytes for py3

    The following error raised during the functional test:
    "TypeError: unsupported operand type(s) for %: 'bytes' and 'int'"
    This patch converts the string to bytes for py3.

    Closes-Bug: #1822155
    Change-Id: I3de92ef830e5f424aa83b57d8ed843a7c4349e8a

Changed in neutron:
status: In Progress → Fix Released

Reviewed: https://review.opendev.org/648456
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=ccf76c36bb508a8cfd4e0f3a24fc1de7a77dc307
Submitter: Zuul
Branch: master

commit ccf76c36bb508a8cfd4e0f3a24fc1de7a77dc307
Author: LIU Yulong <email address hidden>
Date: Fri Mar 29 00:07:11 2019 +0800

    Add log file for neutron-keepalived-state-change

    neutron-keepalived-state-change may not start but have no method
    to find out why. This patch adds the log file for it.

    Change-Id: I688a6e6d0ac42c00d87571484f726e0eae091675
    Related-Bug: #1822155

This issue was fixed in the openstack/neutron 15.0.0.0b1 development milestone.

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

Other bug subscribers