systemd .service files fail to start openstack services running on python3

Bug #1564150 reported by Alberto Murillo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.service
Fix Released
Undecided
Alberto Murillo

Bug Description

This is due to oslo_service/systemd.py that sends a string rather than a "byte-like object"
python3 is more explicit on types.

# cat /etc/systemd/system/multi-user.target.wants/neutron-metadata-agent.service
[Unit]
Description=OpenStack Neutron Metadata Agent
After=syslog.target network.target

[Service]
Type=notify
User=neutron
ExecStart=/usr/bin/neutron-metadata-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/metadata_agent.ini
PrivateTmp=false
NotifyAccess=all
KillMode=process

[Install]
WantedBy=multi-user.target

# systemctl start neutron-metadata-agent.service
Job for neutron-metadata-agent.service failed because the control process exited with error code. See "systemctl status neutron-metadata-agent.service" and "journalctl -xe" for details.

CRITICAL neutron [req-908250bc-26d7-40df-b11d-1edb2bc609a6 - - - - -] TypeError: a bytes-like object is required, not 'str'
ERROR neutron Traceback (most recent call last):
ERROR neutron File "/usr/bin/neutron-metadata-agent", line 10, in <module>
ERROR neutron sys.exit(main())
ERROR neutron File "/usr/lib/python3.5/site-packages/neutron/cmd/eventlet/agents/metadata.py", line 17, in main
ERROR neutron metadata_agent.main()
ERROR neutron File "/usr/lib/python3.5/site-packages/neutron/agent/metadata_agent.py", line 41, in main
ERROR neutron proxy.run()
ERROR neutron File "/usr/lib/python3.5/site-packages/neutron/agent/metadata/agent.py", line 304, in run
ERROR neutron server.wait()
ERROR neutron File "/usr/lib/python3.5/site-packages/neutron/wsgi.py", line 223, in wait
ERROR neutron self._server.wait()
ERROR neutron File "/usr/lib/python3.5/site-packages/oslo_service/service.py", line 540, in wait
ERROR neutron systemd.notify_once()
ERROR neutron File "/usr/lib/python3.5/site-packages/oslo_service/systemd.py", line 67, in notify_once
ERROR neutron _sd_notify(True, 'READY=1')
ERROR neutron File "/usr/lib/python3.5/site-packages/oslo_service/systemd.py", line 43, in _sd_notify
ERROR neutron sock.sendall(msg)
ERROR neutron File "/usr/lib/python3.5/site-packages/eventlet/greenio/base.py", line 385, in sendall
ERROR neutron tail = self.send(data, flags)
ERROR neutron File "/usr/lib/python3.5/site-packages/eventlet/greenio/base.py", line 379, in send
ERROR neutron return self._send_loop(self.fd.send, data, flags)
ERROR neutron File "/usr/lib/python3.5/site-packages/eventlet/greenio/base.py", line 366, in _send_loop
ERROR neutron return send_method(data, *args)
ERROR neutron TypeError: a bytes-like object is required, not 'str'

versions:
neutron-8.0.0.0rc2.tar.gz
oslo.service-1.7.0.tar.gz

Changed in oslo.service:
assignee: nobody → Alberto Murillo (powerbsd-o)
Revision history for this message
Alberto Murillo (powerbsd-o) wrote :
Elena Ezhova (eezhova)
Changed in oslo.service:
status: New → Fix Committed
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/oslo.service 1.9.0

This issue was fixed in the openstack/oslo.service 1.9.0 release.

Changed in oslo.service:
status: Fix Committed → Fix Released
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.