neutron-rpc-server service ignores logging options in config files or arguments

Bug #2030904 reported by Takashi Kajinami
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Takashi Kajinami

Bug Description

While testing the deployment of neutron api by httpd + mod_wsgi[1], I noticed the log file for rpc-server service is not created even though the service is started with the proper arguments.

[1] https://review.opendev.org/c/openstack/puppet-openstack-integration/+/890924

example build:
https://zuul.opendev.org/t/openstack/build/4054295a0c6c444799516eb8ece7d757

The rpc-server.log file is not created

https://storage.gra.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/zuul_opendev_logs_405/890924/3/check/puppet-openstack-integration-7-scenario001-tempest-centos-9-stream/4054295/logs/neutron/index.html

According to ps, the rpc-server is started with --log-file

https://storage.gra.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/zuul_opendev_logs_405/890924/3/check/puppet-openstack-integration-7-scenario001-tempest-centos-9-stream/4054295/logs/ps.txt

```
neutron 76975 1 76975 0.2 0.3 124096 31732 /usr/bin/python3 /usr/bin/neutron-rpc-server --config-file /usr/share/neutron/neutron-dist.conf --config-dir /usr/share/neutron/server --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini --config-dir /etc/neutron/conf.d/common --config-dir /etc/neutron/conf.d/neutron-rpc-server --log-file /var/log/neutron/rpc-server.log
```

Digging into the code, I found out that setup_logging, which should be used to initialize logger based on config options as well as arguments, is not called in the code path for rcp-server.
It seems the method is not called for wsgi script which is used when api is run by WSGI mechanism such as uwsgi or mod_wsgi. Because of this I don't see the log file for api servcice is created, either.

Changed in neutron:
assignee: nobody → Takashi Kajinami (kajinamit)
summary: - neutron-rpc-server service ignores logging options in config files
+ neutron-rpc-server service ignores logging options in config files or
+ arguments
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/890937

Changed in neutron:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/890937
Committed: https://opendev.org/openstack/neutron/commit/afcce6d7493faaa2acf94c01268a2551a1300d31
Submitter: "Zuul (22348)"
Branch: master

commit afcce6d7493faaa2acf94c01268a2551a1300d31
Author: Takashi Kajinami <email address hidden>
Date: Thu Aug 10 03:54:25 2023 +0900

    Initialize logger for rpc-server and wsgi script

    Currently logger is not properly initialized according to config
    options or process arguments when the neutron-rpc-server script or
    the api wsgi script is used. Because of this neutron does not generate
    the log files as expected when we deploy api using WSGI and use
    neutron-rpc-server, instead of the monolithic neutron-server.

    This ensures the logger is initialized even when these two scripts
    are used.

    Closes-Bug: #2030904
    Related-Bug: #1693691
    Change-Id: I13bcd36c237555e0ca60d5ffc214b8f3bf6e478f

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 23.0.0.0b3

This issue was fixed in the openstack/neutron 23.0.0.0b3 development milestone.

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.