Create subnet from subnetpool fails in stable/liberty

Bug #1495191 reported by Frode Nordahl
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
Frode Nordahl

Bug Description

Horizon message:
Error: Failed to create subnet "" for network "None": Request Failed: internal server error while processing your request.

Neutron API message:
2015-09-13 08:30:19.545 DEBUG neutron.api.v2.base [req-9e0ac82f-7bec-4627-bce4-da79637de47f demo a73d9746878b47e6b3ac4dfd57d212bd] Request body: {u'subnet': {u'name': u'subnet3', u'enable_dhcp': True, u'network_id': u'ad740c45-436a-4c65-ad13-982e034279be', u'tenant_id': u'a73d9746878b47e6b3ac4dfd57d212bd', u'ip_version': 4, u'prefixlen': u'24', u'cidr': None, u'subnetpool_id': u'48806e89-553f-4479-81e2-62120d07f972'}} from (pid=25643) prepare_request_body /opt/stack/neutron/neutron/api/v2/base.py:620
2015-09-13 08:30:19.600 ERROR neutron.api.v2.resource [req-9e0ac82f-7bec-4627-bce4-da79637de47f demo a73d9746878b47e6b3ac4dfd57d212bd] create failed
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource Traceback (most recent call last):
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/resource.py", line 83, in resource
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource result = method(request=request, **args)
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 146, in wrapper
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource ectxt.value = e.inner_exc
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 195, in __exit__
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 136, in wrapper
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource return f(*args, **kwargs)
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/base.py", line 491, in create
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource obj = obj_creator(request.context, **kwargs)
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/plugins/ml2/plugin.py", line 835, in create_subnet
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource result, mech_context = self._create_subnet_db(context, subnet)
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/plugins/ml2/plugin.py", line 824, in _create_subnet_db
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource result = super(Ml2Plugin, self).create_subnet(context, subnet)
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/db_base_plugin_v2.py", line 667, in create_subnet
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource return self._create_subnet(context, subnet, subnetpool_id)
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/db_base_plugin_v2.py", line 583, in _create_subnet
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource subnetpool_id)
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/ipam_non_pluggable_backend.py", line 446, in allocate_subnet
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource subnet['cidr'])
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/ipam_backend_mixin.py", line 52, in _gateway_ip_str
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource return str(netaddr.IPNetwork(cidr_net).network + 1)
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/netaddr/ip/__init__.py", line 923, in __init__
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource implicit_prefix, flags)
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/netaddr/ip/__init__.py", line 818, in parse_ip_network
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource raise TypeError('unexpected type %s for addr arg' % type(addr))
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource TypeError: unexpected type <type 'NoneType'> for addr arg
2015-09-13 08:30:19.600 TRACE neutron.api.v2.resource

Analysis:
When we create a subnet with subnetpool cidr is set to None. A recent change in Neutron or netaddr now makes this an error.

Proposed fix:
Update Horizon Neutron Client bindings and make cidr and ip_version optional.
Update Horizon networks workflow to only pass cidr and ip_version fields if they are used instead of passing along "None".

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

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

Changed in horizon:
assignee: nobody → Frode Nordahl (fnordahl)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/222904
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=8064dcc4858d4463626eb795e9bfd97ba66649c9
Submitter: Jenkins
Branch: master

commit 8064dcc4858d4463626eb795e9bfd97ba66649c9
Author: Frode Nordahl <email address hidden>
Date: Sun Sep 13 10:42:28 2015 +0200

    Do not pass along cidr and ip_version to create_subnet when not used

    A recent change in Neutron or netaddr makes it an error to send create_subnet
    message with cidr set to None.

    This patch updates Horizon code to make the cidr and ip_version parameters
    optional and updates the handling of these values from the subnet create
    workflow.

    Change-Id: Icd55a3629422d60470182591449cf726d52575a6
    Closes-Bug: 1495191

Changed in horizon:
status: In Progress → Fix Committed
tags: added: liberty-rc-potential
David Lyle (david-lyle)
Changed in horizon:
importance: Undecided → Medium
tags: added: liberty-rc2-potential
removed: liberty-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

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

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

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

Frode Nordahl (fnordahl)
summary: - Create subnet from subnetpool fails in recent devstack
+ Create subnet from subnetpool fails in stable/liberty
David Lyle (david-lyle)
Changed in horizon:
milestone: none → liberty-rc2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/liberty)

Reviewed: https://review.openstack.org/229399
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=33122a97ce34ef3d0154c8a3efec6fa721aa4061
Submitter: Jenkins
Branch: stable/liberty

commit 33122a97ce34ef3d0154c8a3efec6fa721aa4061
Author: Frode Nordahl <email address hidden>
Date: Sun Sep 13 10:42:28 2015 +0200

    Do not pass along cidr and ip_version to create_subnet when not used

    A recent change in Neutron or netaddr makes it an error to send create_subnet
    message with cidr set to None.

    This patch updates Horizon code to make the cidr and ip_version parameters
    optional and updates the handling of these values from the subnet create
    workflow.

    Change-Id: Icd55a3629422d60470182591449cf726d52575a6
    Closes-Bug: 1495191
    (cherry picked from commit 8064dcc4858d4463626eb795e9bfd97ba66649c9)

tags: added: in-stable-liberty
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: liberty-rc2 → 8.0.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/235270
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=a7a85333d5dcbd39e13ae6c0bf650ecba0c4ca65
Submitter: Jenkins
Branch: master

commit 593f0b78eea8efbb6d833d66acc7ab4dc852159b
Author: OpenStack Proposal Bot <email address hidden>
Date: Thu Oct 8 06:09:44 2015 +0000

    Imported Translations from Zanata

    For more information about this automatic import see:
    https://wiki.openstack.org/wiki/Translations/Infrastructure

    Change-Id: I400c33fd114af0da3db3251d5d89e43234f1254c

commit 07a548e166c39752aa497bd2a072a0cae0aad527
Author: OpenStack Proposal Bot <email address hidden>
Date: Wed Oct 7 06:43:44 2015 +0000

    Imported Translations from Zanata

    For more information about this automatic import see:
    https://wiki.openstack.org/wiki/Translations/Infrastructure

    Change-Id: I7fa1294feebf590f6aca4948479df05cdc6f8cd8

commit 78703ac2159087b1935319f0f9aec155d2ed4d1d
Author: Doug Fish <email address hidden>
Date: Mon Oct 5 18:29:34 2015 +0000

    Update Horizon language list for Liberty

    Update to include languages at or above 90% completion
    for Horizon. List is
    Chinese (China) zh-CN
    Czech cs
    English (Australia) en-AU
    German de
    Korean (South Korea) ko-KR
    Polish (Poland) pl-PL
    Spanish es
    Japanese ja
    Russian ru
    Portuguese (Brazil) pt-BR
    French fr
    Turkish (Turkey) tr-TR
    Chinese (Taiwan) zh-TW

    Change-Id: I144fbfbe9cf505e9279cb78732e1b8e656abda88
    Closes-bug: #1502326

commit 17c935b05e1c1e8c885c0b658a97a542b5896826
Author: OpenStack Proposal Bot <email address hidden>
Date: Tue Oct 6 06:27:54 2015 +0000

    Imported Translations from Zanata

    For more information about this automatic import see:
    https://wiki.openstack.org/wiki/Translations/Infrastructure

    Change-Id: I62e3327e2c0e16de0493b3416f1baa503f458ba2

commit 33122a97ce34ef3d0154c8a3efec6fa721aa4061
Author: Frode Nordahl <email address hidden>
Date: Sun Sep 13 10:42:28 2015 +0200

    Do not pass along cidr and ip_version to create_subnet when not used

    A recent change in Neutron or netaddr makes it an error to send create_subnet
    message with cidr set to None.

    This patch updates Horizon code to make the cidr and ip_version parameters
    optional and updates the handling of these values from the subnet create
    workflow.

    Change-Id: Icd55a3629422d60470182591449cf726d52575a6
    Closes-Bug: 1495191
    (cherry picked from commit 8064dcc4858d4463626eb795e9bfd97ba66649c9)

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

This issue was fixed in the openstack/horizon 9.0.0.0b1 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.