db.dnsdomain_get API calls return no results

Bug #1027998 reported by Sean M. Collins
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Davanum Srinivas (DIMS)

Bug Description

I am trying to track down why DNS domains are not being returned from API calls, from both the python-novaclient library and also from calls in OpenStack to nova/network/manager:NetworkManager._validate_instance_zone_for_dns_domain , which calls self.db.dnsdomain_get, which returns a null set from the database.

2012-07-20 15:47:42 ERROR nova.rpc.amqp [req-4dc9eba4-8f68-463d-a2b0-5d4afcca8d16 923149ed7a08452c96063f3829fef039611ab6c4f3874215986cddb00030498a] Exception during message handling
2012-07-20 15:47:42 TRACE nova.rpc.amqp Traceback (most recent call last):
2012-07-20 15:47:42 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/rpc/amqp.py", line 253, in _rocess_data
2012-07-20 15:47:42 TRACE nova.rpc.amqp rval = node_func(context=ctxt, **node_args)
2012-07-20 15:47:42 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/network/manager.py", line 25, in wrapped
2012-07-20 15:47:42 TRACE nova.rpc.amqp return func(self, context, *args, **kwargs)
2012-07-20 15:47:42 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/network/manager.py", line 32, in allocate_for_instance
2012-07-20 15:47:42 TRACE nova.rpc.amqp **kwargs)
2012-07-20 15:47:42 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/network/manager.py", line 25, in wrapped
2012-07-20 15:47:42 TRACE nova.rpc.amqp return func(self, context, *args, **kwargs)
2012-07-20 15:47:42 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/network/manager.py", line 90, in allocate_for_instance
2012-07-20 15:47:42 TRACE nova.rpc.amqp requested_networks=requested_networks)
2012-07-20 15:47:42 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/network/manager.py", line 21, in _allocate_fixed_ips
2012-07-20 15:47:42 TRACE nova.rpc.amqp vpn=vpn, address=address)
2012-07-20 15:47:42 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/network/manager.py", line 118, in allocate_fixed_ip
2012-07-20 15:47:42 TRACE nova.rpc.amqp if self._validate_instance_zone_for_dns_domain(context, instance_id):
2012-07-20 15:47:42 TRACE nova.rpc.amqp File "/usr/lib/python2.6/site-packages/nova/network/manager.py", line 119, in _validate_instance_zone_for_dns_domain
2012-07-20 15:47:42 TRACE nova.rpc.amqp dns_zone = domainref.availability_zone
2012-07-20 15:47:42 TRACE nova.rpc.amqp AttributeError: 'NoneType' object has no attribute 'availability_zone'
2012-07-20 15:47:42 TRACE nova.rpc.amqp
2012-07-20 15:47:42 ERROR nova.rpc.amqp [req-4dc9eba4-8f68-463d-a2b0-5d4afcca8d16 923149ed7a08452c96063f3829fef039 611ab6c4f3874215986cddb00030498a] Returning exception 'NoneType' object has no attribute 'availability_zone' to caller

stack@devstack:~$ mysql -e "use nova; SELECT * FROM dns_domains"
stack@devstack:~$ nova dns-create-private-domain test1.net
Please input your password for the keyring
stack@devstack:~$ mysql -e "use nova; SELECT * FROM dns_domains"
+---------------------+------------+------------+---------+-----------+---------+-------------------+------------+
| created_at | updated_at | deleted_at | deleted | domain | scope | availability_zone | project_id |
+---------------------+------------+------------+---------+-----------+---------+-------------------+------------+
| 2012-07-19 22:25:09 | NULL | NULL | 0 | test1.net | private | NULL | NULL |
+---------------------+------------+------------+---------+-----------+---------+-------------------+------------+
stack@devstack:~$ nova dns-domains
Please input your password for the keyring

stack@devstack:~$ nova dns-create-public-domain test2.net
Please input your password for the keyring
stack@devstack:~$ mysql -e "use nova; SELECT * FROM dns_domains"
+---------------------+------------+------------+---------+-----------+---------+-------------------+------------+
| created_at | updated_at | deleted_at | deleted | domain | scope | availability_zone | project_id |
+---------------------+------------+------------+---------+-----------+---------+-------------------+------------+
| 2012-07-19 22:25:09 | NULL | NULL | 0 | test1.net | private | NULL | NULL |
| 2012-07-19 22:31:06 | NULL | NULL | 0 | test2.net | public | NULL | NULL |
+---------------------+------------+------------+---------+-----------+---------+-------------------+------------+
stack@devstack:~$ nova dns-domains
Please input your password for the keyring

Revision history for this message
Dan Prince (dan-prince) wrote :

Hi Sean,

Do you have floating_ip_dns_manager and instance_dns_manager set to something other than nova.network.dns_driver.DNSDriver in your nova.conf file?

By default Nova uses dns_driver.DNSDriver which is meant to be an interface only but actually returns empty results sets or 'pass' for many of its functions. This can be a bit confusing (like you mention above).

I think perhaps we should just update that default interface to raise NotImplementedError instead which would make it much more clear that using this functionally requires a bit more configuration.

Changed in nova:
assignee: nobody → Dan Prince (dan-prince)
Dan Prince (dan-prince)
Changed in nova:
status: New → In Progress
importance: Undecided → Low
Dan Prince (dan-prince)
Changed in nova:
status: In Progress → Triaged
assignee: Dan Prince (dan-prince) → nobody
Revision history for this message
Sean M. Collins (scollins) wrote :

I still don't understand how that would affect the db.dnsdomain_get call - which uses the SQLAlchemy backend to query the MySQL database - and that is returning no results.

Changed in nova:
assignee: nobody → Davanum Srinivas (dims-v)
status: Triaged → In Progress
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

i have a review in progress to switch defaults totally. right now the defaults are already set to the correct minidns based instance manager in devstack

https://review.openstack.org/#/c/17494/

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

Reviewed: https://review.openstack.org/17494
Committed: http://github.com/openstack/nova/commit/6b50880c6e9e01c4f4b12579592155dfd94b4b96
Submitter: Jenkins
Branch: master

commit 6b50880c6e9e01c4f4b12579592155dfd94b4b96
Author: Davanum Srinivas <email address hidden>
Date: Tue Dec 4 13:09:09 2012 -0500

    Raise NotImplementedError in dns_driver.DNSDriver.

    Updates dns_driver.DNSDriver so that we raise NotImplementedError
    instead of returning empty result sets or passing. Since this
    class is the default dns_driver for Nova it can be quite
    confusing when it returns empty results (which actually
    causes some HTTP 500 errors as well).

    We really need to switch the default floating/instance
    dns managers to MiniDNS as smoketests fail otherwise we
    currently use nova.network.dns_driver.DNSDriver which is
    not correct

    Fixes LP Bug #1040236
    Fixes LP Bug #1027998

    Change-Id: Id818bb00e0689d96db948872842c07d2cf1edd57

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