Fix TypeError when trying to update an arp entry for ports with allowed_address_pairs on DVR router

Bug #1566046 reported by Swaminathan Vasudevan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Swaminathan Vasudevan

Bug Description

TypeError is seen when trying to update an arp entry for ports with allowed_address_pairs on DVR router.
This was seen in the master branch while I was testing the allowed_address_pair with floatingips on DVR router.

plugin.update_arp_entry_for_dvr_service_port(context, port)
^[[01;31m2016-03-30 12:06:00.910 TRACE neutron.callbacks.manager ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/db/l3_dvr_db.py", line 775, in update_arp_entry_for_dvr_service_port
^[[01;31m2016-03-30 12:06:00.910 TRACE neutron.callbacks.manager ^[[01;35m^[[00m    self.l3_rpc_notifier.add_arp_entry)
^[[01;31m2016-03-30 12:06:00.910 TRACE neutron.callbacks.manager ^[[01;35m^[[00m  File "/opt/stack/neutron/neutron/db/l3_dvr_db.py", line 729, in _generate_arp_table_and_notify_agent
^[[01;31m2016-03-30 12:06:00.910 TRACE neutron.callbacks.manager ^[[01;35m^[[00m    ip_address = fixed_ip['ip_address']
^[[01;31m2016-03-30 12:06:00.910 TRACE neutron.callbacks.manager ^[[01;35m^[[00mTypeError: string indices must be integers

How to reproduce it.

1. Create a vrrp-network
2. Create a vrrp-subnet
3. Create a dvr router
4. Attach the vrrp-subnet to the router
5. Create security group rules for the vrrp-net and add rules to it.
6. Now create a VM on the vrrp-subnet
8. Now create a vrrp-port (allowed_address_pair) on the vrrp-subnet
9. Associate a floatingip to the vrrp-port.
10. Now update the VM port with the allowed_address_pair IP.

You should see this in the neutron-server logs.

Changed in neutron:
assignee: nobody → Swaminathan Vasudevan (swaminathan-vasudevan)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

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

Reviewed: https://review.openstack.org/301410
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=3d127dd767659e371b72acf04728fb3a2e1025a6
Submitter: Jenkins
Branch: master

commit 3d127dd767659e371b72acf04728fb3a2e1025a6
Author: Swaminathan Vasudevan <email address hidden>
Date: Mon Apr 4 15:35:53 2016 -0700

    DVR: Fix TypeError in arp update with allowed_address_pairs

    There is a TyperError seen when trying to update an arp entry
    for the DVR service port that has associated allowed address
    pairs.

    The _get_allowed_address_pair_fixed_ips were not returing the
    fixed_ips dictionary but just returning the fixed_ip string.

    This caused the TypeError to occur. In addition to the fixed_ip
    it should also return the subnet_id for arp_update and it was
    returning it.

    This patch fixes the issues mentioned above.

    Closes-Bug: #1566046
    Change-Id: I35d3145682e23e087c17129bb9556946e0aa801c

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

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/313050

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

Reviewed: https://review.openstack.org/313050
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=ca690cc4fc9590e9a868e02f737ca9f379b1a37d
Submitter: Jenkins
Branch: stable/mitaka

commit ca690cc4fc9590e9a868e02f737ca9f379b1a37d
Author: Swaminathan Vasudevan <email address hidden>
Date: Mon Apr 4 15:35:53 2016 -0700

    DVR: Fix TypeError in arp update with allowed_address_pairs

    There is a TyperError seen when trying to update an arp entry
    for the DVR service port that has associated allowed address
    pairs.

    The _get_allowed_address_pair_fixed_ips were not returing the
    fixed_ips dictionary but just returning the fixed_ip string.

    This caused the TypeError to occur. In addition to the fixed_ip
    it should also return the subnet_id for arp_update and it was
    returning it.

    This patch fixes the issues mentioned above.

    Closes-Bug: #1566046
    Change-Id: I35d3145682e23e087c17129bb9556946e0aa801c
    (cherry picked from commit 3d127dd767659e371b72acf04728fb3a2e1025a6)

tags: added: in-stable-mitaka
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/318292

Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/neutron 8.1.1

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

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/neutron 9.0.0.0b1

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

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

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/327018

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (stable/liberty)

Change abandoned by Ihar Hrachyshka (<email address hidden>) on branch: stable/liberty
Review: https://review.openstack.org/318292
Reason: Wrong Change-Id. Superseded by https://review.openstack.org/327018

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

Reviewed: https://review.openstack.org/327018
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=5104a314370e4b109e5051e9a6bbc295fb5286b6
Submitter: Jenkins
Branch: stable/liberty

commit 5104a314370e4b109e5051e9a6bbc295fb5286b6
Author: Swaminathan Vasudevan <email address hidden>
Date: Mon Apr 4 15:35:53 2016 -0700

    DVR: Fix TypeError in arp update with allowed_address_pairs

    There is a TyperError seen when trying to update an arp entry
    for the DVR service port that has associated allowed address
    pairs.

    The _get_allowed_address_pair_fixed_ips were not returing the
    fixed_ips dictionary but just returning the fixed_ip string.

    This caused the TypeError to occur. In addition to the fixed_ip
    it should also return the subnet_id for arp_update and it was
    returning it.

    This patch fixes the issues mentioned above.

    Closes-Bug: #1566046
    (cherry picked from commit 3d127dd767659e371b72acf04728fb3a2e1025a6)

    Conflicts:
     neutron/db/l3_dvr_db.py
     neutron/db/l3_dvrscheduler_db.py
     neutron/tests/functional/services/l3_router/test_l3_dvr_router_plugin.py

    Change-Id: I35d3145682e23e087c17129bb9556946e0aa801c

tags: added: in-stable-liberty
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/neutron 7.1.2

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

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.