manager.py : _validate_instance_zone_for_dns_domain throwing AttributeError: 'NoneType' object has no attribute 'availability_zone' error

Bug #1190718 reported by Justin Shepherd
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Justin Shepherd

Bug Description

Using Devstack

*** USE MiniDNS driver ***

add instance_dns_manager=nova.network.minidns.MiniDNS to [default] section in /etc/nova/nova.conf

*** CREATE PRIVATE DNS DOMAIN ***

stack@test:~/devstack$ nova dns-create-private-domain --availability_zone nova foo.org

stack@test:~/devstack$ nova dns-domains
+---------+---------+---------+-------------------+
| domain | scope | project | availability_zone |
+---------+---------+---------+-------------------+
| foo.org | private | None | nova |
+---------+---------+---------+-------------------+

*** BOOT AN INSTANCE ***
stack@test:~/devstack$ nova boot --flavor 1 --image 5f789010-7e57-465f-950c-ed071c3b75ae "test-instance"

** IMMEDIATELY GOES INTO ERROR STATE ***

The following is the error in nova-network

2013-06-13 19:18:44.632 ERROR nova.openstack.common.rpc.amqp [req-53d54d74-d53c-49be-ac4b-f0ab9d4bc0fe admin admin] Exception during message handling
2013-06-13 19:18:44.632 TRACE nova.openstack.common.rpc.amqp Traceback (most recent call last):
2013-06-13 19:18:44.632 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/openstack/common/rpc/amqp.py", line 433, in _process_data
2013-06-13 19:18:44.632 TRACE nova.openstack.common.rpc.amqp **args)
2013-06-13 19:18:44.632 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/openstack/common/rpc/dispatcher.py", line 172, in dispatch
2013-06-13 19:18:44.632 TRACE nova.openstack.common.rpc.amqp result = getattr(proxyobj, method)(ctxt, **kwargs)
2013-06-13 19:18:44.632 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/network/floating_ips.py", line 188, in deallocate_for_instance
2013-06-13 19:18:44.632 TRACE nova.openstack.common.rpc.amqp super(FloatingIP, self).deallocate_for_instance(context, **kwargs)
2013-06-13 19:18:44.632 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/network/manager.py", line 540, in deallocate_for_instance
2013-06-13 19:18:44.632 TRACE nova.openstack.common.rpc.amqp self.deallocate_fixed_ip(context, fixed_ip['address'], host=host)
2013-06-13 19:18:44.632 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/network/manager.py", line 247, in deallocate_fixed_ip
2013-06-13 19:18:44.632 TRACE nova.openstack.common.rpc.amqp address)
2013-06-13 19:18:44.632 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/network/manager.py", line 894, in deallocate_fixed_ip
2013-06-13 19:18:44.632 TRACE nova.openstack.common.rpc.amqp if self._validate_instance_zone_for_dns_domain(context, instance):
2013-06-13 19:18:44.632 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/network/manager.py", line 802, in _validate_instance_zone_for_dns_domain
2013-06-13 19:18:44.632 TRACE nova.openstack.common.rpc.amqp dns_zone = domainref.availability_zone
2013-06-13 19:18:44.632 TRACE nova.openstack.common.rpc.amqp AttributeError: 'NoneType' object has no attribute 'availability_zone'
2013-06-13 19:18:44.632 TRACE nova.openstack.common.rpc.amqp

Revision history for this message
Justin Shepherd (jshepher) wrote :

Looks like nova.network.manager is calling db.dnsdomain_get and passing 'instance.availability_zone' as the fqdn.

https://github.com/openstack/nova/blob/master/nova/network/manager.py#L795-L800
https://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/api.py#L924-L937

 mysql -u root nova -e "select * from dns_domains"
+---------------------+------------+------------+---------+---------+---------+-------------------+------------+
| created_at | updated_at | deleted_at | deleted | domain | scope | availability_zone | project_id |
+---------------------+------------+------------+---------+---------+---------+-------------------+------------+
| 2013-06-13 19:17:44 | NULL | NULL | 0 | foo.org | private | nova | NULL |
+---------------------+------------+------------+---------+---------+---------+-------------------+------------+

This wont work.. as the fqdn for the domain is 'foo.org' not 'nova'.

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

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

Changed in nova:
assignee: nobody → Justin Shepherd (jshepher)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/32966
Committed: http://github.com/openstack/nova/commit/9f4fa11f1069afcc0e643aa11e28c5a7e683a525
Submitter: Jenkins
Branch: master

commit 9f4fa11f1069afcc0e643aa11e28c5a7e683a525
Author: galstrom21 <email address hidden>
Date: Thu Jun 13 16:26:23 2013 -0500

    Fixing dnsdomain_get call in nova.network.manager

      db.dnsdomain_get() was being passed an availability
      zone instead of a domain.

    fixes: bug #1190718

    Change-Id: Ia8ccf6e84d4b181adaa3b0475e51e3897ac03bd2

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-3 → 2013.2
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.