[DHCP] DHCP agent failing in ``DHCPResourceUpdate.__lt__`` method

Bug #2071426 reported by Rodolfo Alonso
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Rodolfo Alonso

Bug Description

The method ``DHCPResourceUpdate.__lt__`` is now failing because the port resource provided has no "fixed_ips" field:
"""
Jun 26 06:45:14.140484 np0037811679 neutron-dhcp-agent[60430]: File "/opt/stack/neutron/neutron/agent/dhcp/agent.py", line 90, in __lt__
Jun 26 06:45:14.140484 np0037811679 neutron-dhcp-agent[60430]: fixed_ip in self.resource['fixed_ips'])
Jun 26 06:45:14.140580 np0037811679 neutron-dhcp-agent[60430]: KeyError: 'fixed_ips'
"""

I'm setting the importance of this bug to High because I found 127.759 hits of this error in the last year: https://opensearch.logs.openstack.org/_dashboards/app/data-explorer/discover#?_a=(discover:(columns:!(_source),interval:y,isDirty:!f,sort:!()),metadata:(indexPattern:'94869730-aea8-11ec-9e6a-83741af3fdcd',view:discover))&_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-12M,to:now))&_q=(filters:!(),query:(language:kuery,query:'message:%22KeyError:%20!'fixed_ips!'%22'))

Snippet: https://paste.opendev.org/show/bRaANqkfcNVWrciDTcui/

Log: https://storage.gra.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/zuul_opendev_logs_ddd/922074/4/check/neutron-tempest-plugin-openvswitch/ddda876/controller/logs/screen-q-dhcp.txt

Changed in neutron:
importance: Undecided → High
assignee: nobody → Rodolfo Alonso (rodolfo-alonso-hernandez)
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/+/923026

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

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

commit b0081ac6c0eca93f7589f5c910d0f6385d83dd47
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Fri Jun 28 12:20:37 2024 +0000

    Add the port "fixed_ips" information in the DHCP RPC

    In [1], a method to process the DHCP events in the correct order was
    implemented. That method checks the port events in order to match
    the "fixed_ips" field. That implies the Neutron server provides this
    information in the port event, sent via RPC.

    However in [2], the "fixed_ips" information was removed from the
    ``DhcpAgentNotifyAPI._after_router_interface_deleted``, causing a
    periodic error in the ``DHCPResourceUpdate.__lt__`` method, as reported
    in the LP bug. This patch is restoring this field in the RPC message.

    [1]https://review.opendev.org/c/openstack/neutron/+/773160
    [2]https://review.opendev.org/c/openstack/neutron/+/639814

    Closes-Bug: #2071426
    Change-Id: If1362b9b91794e74e8cf6bb233e661fba9fb3b26

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/2024.1)

Fix proposed to branch: stable/2024.1
Review: https://review.opendev.org/c/openstack/neutron/+/923561

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/2023.2)

Fix proposed to branch: stable/2023.2
Review: https://review.opendev.org/c/openstack/neutron/+/923562

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/2023.1)

Fix proposed to branch: stable/2023.1
Review: https://review.opendev.org/c/openstack/neutron/+/923563

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/2024.1)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/923561
Committed: https://opendev.org/openstack/neutron/commit/94d86ba8b895b2f223363268020390be387f2818
Submitter: "Zuul (22348)"
Branch: stable/2024.1

commit 94d86ba8b895b2f223363268020390be387f2818
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Fri Jun 28 12:20:37 2024 +0000

    Add the port "fixed_ips" information in the DHCP RPC

    In [1], a method to process the DHCP events in the correct order was
    implemented. That method checks the port events in order to match
    the "fixed_ips" field. That implies the Neutron server provides this
    information in the port event, sent via RPC.

    However in [2], the "fixed_ips" information was removed from the
    ``DhcpAgentNotifyAPI._after_router_interface_deleted``, causing a
    periodic error in the ``DHCPResourceUpdate.__lt__`` method, as reported
    in the LP bug. This patch is restoring this field in the RPC message.

    [1]https://review.opendev.org/c/openstack/neutron/+/773160
    [2]https://review.opendev.org/c/openstack/neutron/+/639814

    Closes-Bug: #2071426
    Change-Id: If1362b9b91794e74e8cf6bb233e661fba9fb3b26
    (cherry picked from commit b0081ac6c0eca93f7589f5c910d0f6385d83dd47)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/2023.2)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/923562
Committed: https://opendev.org/openstack/neutron/commit/94a1baa63d942fb6d1b5d91ee299ea29010c0641
Submitter: "Zuul (22348)"
Branch: stable/2023.2

commit 94a1baa63d942fb6d1b5d91ee299ea29010c0641
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Fri Jun 28 12:20:37 2024 +0000

    Add the port "fixed_ips" information in the DHCP RPC

    In [1], a method to process the DHCP events in the correct order was
    implemented. That method checks the port events in order to match
    the "fixed_ips" field. That implies the Neutron server provides this
    information in the port event, sent via RPC.

    However in [2], the "fixed_ips" information was removed from the
    ``DhcpAgentNotifyAPI._after_router_interface_deleted``, causing a
    periodic error in the ``DHCPResourceUpdate.__lt__`` method, as reported
    in the LP bug. This patch is restoring this field in the RPC message.

    [1]https://review.opendev.org/c/openstack/neutron/+/773160
    [2]https://review.opendev.org/c/openstack/neutron/+/639814

    Closes-Bug: #2071426
    Change-Id: If1362b9b91794e74e8cf6bb233e661fba9fb3b26
    (cherry picked from commit b0081ac6c0eca93f7589f5c910d0f6385d83dd47)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/2023.1)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/923563
Committed: https://opendev.org/openstack/neutron/commit/182b5acbdf3d4f3396282b4b66f1ab942be70a28
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit 182b5acbdf3d4f3396282b4b66f1ab942be70a28
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Fri Jun 28 12:20:37 2024 +0000

    Add the port "fixed_ips" information in the DHCP RPC

    In [1], a method to process the DHCP events in the correct order was
    implemented. That method checks the port events in order to match
    the "fixed_ips" field. That implies the Neutron server provides this
    information in the port event, sent via RPC.

    However in [2], the "fixed_ips" information was removed from the
    ``DhcpAgentNotifyAPI._after_router_interface_deleted``, causing a
    periodic error in the ``DHCPResourceUpdate.__lt__`` method, as reported
    in the LP bug. This patch is restoring this field in the RPC message.

    [1]https://review.opendev.org/c/openstack/neutron/+/773160
    [2]https://review.opendev.org/c/openstack/neutron/+/639814

    Closes-Bug: #2071426
    Change-Id: If1362b9b91794e74e8cf6bb233e661fba9fb3b26
    (cherry picked from commit b0081ac6c0eca93f7589f5c910d0f6385d83dd47)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 24.0.1

This issue was fixed in the openstack/neutron 24.0.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 22.2.0

This issue was fixed in the openstack/neutron 22.2.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 23.2.0

This issue was fixed in the openstack/neutron 23.2.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 25.0.0.0rc1

This issue was fixed in the openstack/neutron 25.0.0.0rc1 release candidate.

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.