← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1714068] [NEW] AttributeError in get_device_details when segment=None

 

Public bug reported:

Found an AttributeError in this tempest log file:

http://logs.openstack.org/67/347867/52/check/gate-tempest-dsvm-neutron-
dvr-ubuntu-xenial/64d8d9a/logs/screen-q-agt.txt.gz

Aug 29 18:57:12.585412 ubuntu-xenial-rax-iad-10687932 neutron-openvswitch-agent[28658]: ERROR neutron.agent.rpc [None req-0de9bdcb-9659-4971-9e03-4e2849af0169 None None] Failed to get details for device 4fe2030b-4af8-47e7-8dd3-52b544918e16: AttributeError: 'NoneType' object has no attribute 'network_type'
Aug 29 18:57:12.585578 ubuntu-xenial-rax-iad-10687932 neutron-openvswitch-agent[28658]: ERROR neutron.agent.rpc Traceback (most recent call last):
Aug 29 18:57:12.585712 ubuntu-xenial-rax-iad-10687932 neutron-openvswitch-agent[28658]: ERROR neutron.agent.rpc   File "/opt/stack/new/neutron/neutron/agent/rpc.py", line 216, in get_devices_details_list_and_failed_devices
Aug 29 18:57:12.585858 ubuntu-xenial-rax-iad-10687932 neutron-openvswitch-agent[28658]: ERROR neutron.agent.rpc     self.get_device_details(context, device, agent_id, host))
Aug 29 18:57:12.585987 ubuntu-xenial-rax-iad-10687932 neutron-openvswitch-agent[28658]: ERROR neutron.agent.rpc   File "/opt/stack/new/neutron/neutron/agent/rpc.py", line 244, in get_device_details
Aug 29 18:57:12.586162 ubuntu-xenial-rax-iad-10687932 neutron-openvswitch-agent[28658]: ERROR neutron.agent.rpc     'network_type': segment.network_type,
Aug 29 18:57:12.586289 ubuntu-xenial-rax-iad-10687932 neutron-openvswitch-agent[28658]: ERROR neutron.agent.rpc AttributeError: 'NoneType' object has no attribute 'network_type'
Aug 29 18:57:12.586414 ubuntu-xenial-rax-iad-10687932 neutron-openvswitch-agent[28658]: ERROR neutron.agent.rpc

>From the same log just a second earlier, we can see that the port was
updated, and the 'segment' field of the port binding_level was cleared:

Aug 29 18:57:11.569684 ubuntu-xenial-rax-iad-10687932 neutron-
openvswitch-agent[28658]: DEBUG neutron.agent.resource_cache [None req-
1d914886-cbd7-4568-9290-bcbc98bd7ba6 None None] Resource Port 4fe2030b-
4af8-47e7-8dd3-52b544918e16 updated (revision_number 4->5). Old fields:
{'status': u'DOWN', 'binding_levels':
[PortBindingLevel(driver='openvswitch',host='ubuntu-xenial-rax-
iad-10687932',level=0,port_id=4fe2030b-
4af8-47e7-8dd3-52b544918e16,segment=NetworkSegment(ef53b2b6-f51e-495b-
9dda-b174fbed1122))]} New fields: {'status': u'ACTIVE',
'binding_levels': [PortBindingLevel(driver='openvswitch',host='ubuntu-
xenial-rax-iad-10687932',level=0,port_id=4fe2030b-
4af8-47e7-8dd3-52b544918e16,segment=None)]} {{(pid=28658)
record_resource_update
/opt/stack/new/neutron/neutron/agent/resource_cache.py:185}}

The code in question doesn't check if 'segment' is valid before using
it, and I'm not sure if such a simple change as that is appropriate to
fix it.

This code was added in the push notifications changes:

commit c3db9d6b0b990da6664955e4ce1c72758dc600e1
Author: Kevin Benton <kevin@xxxxxxxxxx>
Date:   Sun Jan 22 17:01:47 2017 -0800

    Use push-notificates for OVSPluginAPI
    
    Replace the calls to the OVSPluginAPI info retrieval functions
    with reads directly from the push notification cache.
    
    Since we now depend on the cache for the source of truth, the
    'port_update'/'port_delete'/'network_update' handlers are configured
    to be called whenever the cache receives a corresponding resource update.
    The OVS agent will no longer subscribe to topic notifications for ports
    or networks from the legacy notification API.
    
    Partially-Implements: blueprint push-notifications
    Change-Id: Ib2234ec1f5d328649c6bb1c3fe07799d3e351f48

** Affects: neutron
     Importance: Medium
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1714068

Title:
  AttributeError in get_device_details when segment=None

Status in neutron:
  New

Bug description:
  Found an AttributeError in this tempest log file:

  http://logs.openstack.org/67/347867/52/check/gate-tempest-dsvm-
  neutron-dvr-ubuntu-xenial/64d8d9a/logs/screen-q-agt.txt.gz

  Aug 29 18:57:12.585412 ubuntu-xenial-rax-iad-10687932 neutron-openvswitch-agent[28658]: ERROR neutron.agent.rpc [None req-0de9bdcb-9659-4971-9e03-4e2849af0169 None None] Failed to get details for device 4fe2030b-4af8-47e7-8dd3-52b544918e16: AttributeError: 'NoneType' object has no attribute 'network_type'
  Aug 29 18:57:12.585578 ubuntu-xenial-rax-iad-10687932 neutron-openvswitch-agent[28658]: ERROR neutron.agent.rpc Traceback (most recent call last):
  Aug 29 18:57:12.585712 ubuntu-xenial-rax-iad-10687932 neutron-openvswitch-agent[28658]: ERROR neutron.agent.rpc   File "/opt/stack/new/neutron/neutron/agent/rpc.py", line 216, in get_devices_details_list_and_failed_devices
  Aug 29 18:57:12.585858 ubuntu-xenial-rax-iad-10687932 neutron-openvswitch-agent[28658]: ERROR neutron.agent.rpc     self.get_device_details(context, device, agent_id, host))
  Aug 29 18:57:12.585987 ubuntu-xenial-rax-iad-10687932 neutron-openvswitch-agent[28658]: ERROR neutron.agent.rpc   File "/opt/stack/new/neutron/neutron/agent/rpc.py", line 244, in get_device_details
  Aug 29 18:57:12.586162 ubuntu-xenial-rax-iad-10687932 neutron-openvswitch-agent[28658]: ERROR neutron.agent.rpc     'network_type': segment.network_type,
  Aug 29 18:57:12.586289 ubuntu-xenial-rax-iad-10687932 neutron-openvswitch-agent[28658]: ERROR neutron.agent.rpc AttributeError: 'NoneType' object has no attribute 'network_type'
  Aug 29 18:57:12.586414 ubuntu-xenial-rax-iad-10687932 neutron-openvswitch-agent[28658]: ERROR neutron.agent.rpc

  From the same log just a second earlier, we can see that the port was
  updated, and the 'segment' field of the port binding_level was
  cleared:

  Aug 29 18:57:11.569684 ubuntu-xenial-rax-iad-10687932 neutron-
  openvswitch-agent[28658]: DEBUG neutron.agent.resource_cache [None
  req-1d914886-cbd7-4568-9290-bcbc98bd7ba6 None None] Resource Port
  4fe2030b-4af8-47e7-8dd3-52b544918e16 updated (revision_number 4->5).
  Old fields: {'status': u'DOWN', 'binding_levels':
  [PortBindingLevel(driver='openvswitch',host='ubuntu-xenial-rax-
  iad-10687932',level=0,port_id=4fe2030b-
  4af8-47e7-8dd3-52b544918e16,segment=NetworkSegment(ef53b2b6-f51e-495b-
  9dda-b174fbed1122))]} New fields: {'status': u'ACTIVE',
  'binding_levels': [PortBindingLevel(driver='openvswitch',host='ubuntu-
  xenial-rax-iad-10687932',level=0,port_id=4fe2030b-
  4af8-47e7-8dd3-52b544918e16,segment=None)]} {{(pid=28658)
  record_resource_update
  /opt/stack/new/neutron/neutron/agent/resource_cache.py:185}}

  The code in question doesn't check if 'segment' is valid before using
  it, and I'm not sure if such a simple change as that is appropriate to
  fix it.

  This code was added in the push notifications changes:

  commit c3db9d6b0b990da6664955e4ce1c72758dc600e1
  Author: Kevin Benton <kevin@xxxxxxxxxx>
  Date:   Sun Jan 22 17:01:47 2017 -0800

      Use push-notificates for OVSPluginAPI
      
      Replace the calls to the OVSPluginAPI info retrieval functions
      with reads directly from the push notification cache.
      
      Since we now depend on the cache for the source of truth, the
      'port_update'/'port_delete'/'network_update' handlers are configured
      to be called whenever the cache receives a corresponding resource update.
      The OVS agent will no longer subscribe to topic notifications for ports
      or networks from the legacy notification API.
      
      Partially-Implements: blueprint push-notifications
      Change-Id: Ib2234ec1f5d328649c6bb1c3fe07799d3e351f48

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1714068/+subscriptions


Follow ups