Reviewed: https://review.opendev.org/c/openstack/neutron/+/926566 Committed: https://opendev.org/openstack/neutron/commit/b9ca288a5d387acf01464e80b3d8b7b42ce9a9ae Submitter: "Zuul (22348)" Branch: master
commit b9ca288a5d387acf01464e80b3d8b7b42ce9a9ae Author: Brian Haley <haleyb....@gmail.com> Date: Mon Aug 19 13:48:55 2024 -0400 Log a warning if pid file could not be read in l3-agent A formatting error can sometimes be seen in the l3-agent log while spawning the state change monitor if the pid file is empty. Log a warning to that effect instead so an admin is aware in case there is an issue observed with the router. Closes-bug: #2077351 Change-Id: Ic599c2419ca204a5e10654cb4bef66e6770cbcd7 ** Changed in: neutron Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to neutron. https://bugs.launchpad.net/bugs/2077351 Title: "Error formatting log line" sometimes seen in l3-agent log Status in neutron: Fix Released Bug description: While looking at another issue, I noticed this error in the l3-agent log: Aug 19 14:53:06.339086 np0038216951 neutron-keepalived-state-change[103857]: INFO neutron.common.config [-] Logging enabled! Aug 19 14:53:06.339318 np0038216951 neutron-keepalived-state-change[103857]: INFO neutron.common.config [-] /opt/stack/data/venv/bin/neutron-keepalived-state-change version 25.0.0.0b2.dev120 Aug 19 14:53:06.339942 np0038216951 neutron-keepalived-state-change[103857]: DEBUG neutron.common.config [-] command line: /opt/stack/data/venv/bin/neutron-keepalived-state-change --router_id=2a06f3a4-8964-4200-97e8-a9d635f31fba --namespace=qrouter-2a06f3a4-8964-4200-97e8-a9d635f31fba --conf_dir=/opt/stack/data/neutron/ha_confs/2a06f3a4-8964-4200-97e8-a9d635f31fba --log-file=/opt/stack/data/neutron/ha_confs/2a06f3a4-8964-4200-97e8-a9d635f31fba/neutron-keepalived-state-change.log --monitor_interface=ha-b1ac3293-17 --monitor_cidr=169.254.0.132/24 --pid_file=/opt/stack/data/neutron/external/pids/2a06f3a4-8964-4200-97e8-a9d635f31fba.monitor.pid.neutron-keepalived-state-change-monitor --state_path=/opt/stack/data/neutron --user=1001 --group=1001 {{(pid=103857) setup_logging /opt/stack/neutron/neutron/common/config.py:123}} Aug 19 14:53:06.352377 np0038216951 neutron-l3-agent[62158]: ERROR neutron.agent.linux.utils [-] Unable to convert value in /opt/stack/data/neutron/external/pids/2a06f3a4-8964-4200-97e8-a9d635f31fba.monitor.pid.neutron-keepalived-state-change-monitor Aug 19 14:53:06.352377 np0038216951 neutron-l3-agent[62158]: DEBUG neutron.agent.l3.ha_router [-] Error formatting log line msg='Router *(router_id)s *(process)s pid *(pid)d' err=TypeError('*d format: a real number is required, not NoneType') {{(pid=62158) spawn_state_change_monitor /opt/stack/neutron/neutron/agent/l3/ha_router.py:453}} The code in question is printing the PID as %(pid)d so when it is None it generates a TypeError. I think in this case the pid file has simply not been written yet and the process is still spawning, so we should print a warning to that effect. That way if the admin does see an issue with that router there is something to indicate why. To manage notifications about this bug go to: https://bugs.launchpad.net/neutron/+bug/2077351/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp