maas cluster name should not / can not have trailing '.'

Bug #1433622 reported by Scott Moser
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Critical
Mike Pontillo

Bug Description

A user installed a maas and configured cluster zone name to be: 'cluster.mallards.'

that caused many issues, one such as shown in regiond.log like this:

2015-03-18 13:55:45 [maas.dns] INFO: Generating new DNS zone file for cluster.mallards.
2015-03-18 13:55:45 [maas.dns] ERROR: Reloading BIND zone u'cluster.mallards.' failed: Command `rndc -c /etc/bind/maas/rndc.conf.maas reload cluster.mallards.` returned non-zero exit status 1:
rndc: 'reload' failed: empty label
2015-03-18 13:55:45 [HTTPChannel,0,127.0.0.1] /usr/lib/python2.7/dist-packages/django/http/response.py:330: exceptions.DeprecationWarning: Using mimetype keyword argument is deprecated, use content_type instead
2015-03-18 13:55:45 [HTTPChannel,0,127.0.0.1] No handlers could be found for logger "django.request"
2015-03-18 13:55:45 [HTTPChannel,0,127.0.0.1] 500 Error - /MAAS/api/1.0/nodes/node-761b65be-cd69-11e4-ae5d-001b21006d7f/
        Traceback (most recent call last):
          File "/usr/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 206, in __call__
            response = self.get_response(request)
          File "/usr/lib/python2.7/dist-packages/maasserver/utils/views.py", line 124, in get_response
            response = get_response(request)
          File "/usr/lib/python2.7/dist-packages/maasserver/utils/views.py", line 105, in get_response
            return django_get_response(request)
          File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 194, in get_response
            response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
        --- <exception caught here> ---
          File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 118, in get_response
            response = middleware_method(request, e)
          File "/usr/lib/python2.7/dist-packages/maasserver/middleware.py", line 240, in process_exception
            self.RETRY_AFTER_SERVICE_UNAVAILABLE)
        exceptions.AttributeError: 'APIErrorsMiddleware' object has no attribute 'RETRY_AFTER_SERVICE_UNAVAILABLE'

2015-03-18 13:55:45 [-] 127.0.0.1 - - [18/Mar/2015:13:55:45 +0000] "DELETE /MAAS/api/1.0/nodes/node-761b65be-cd69-11e4-ae5d-001b21006d7f/ HTTP/1.1" 500 223 "-" "Python-httplib2/0.8 (gzip)"

the api request that showed this would look like:
$ maas admin node delete node-761b65be-cd69-11e4-ae5d-001b21006d7f
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>Error: Internal server error</title>
  </head>
  <body>
    <h2>
      Internal server error.
    </h2>
  </body>
</html>

Related branches

Revision history for this message
Blake Rouse (blake-rouse) wrote :

The actual error here is this:

2015-03-18 13:55:45 [maas.dns] ERROR: Reloading BIND zone u'cluster.mallards.' failed: Command `rndc -c /etc/bind/maas/rndc.conf.maas reload cluster.mallards.` returned non-zero exit status 1:
rndc: 'reload' failed: empty label

The other error bug is 1433625.

summary: - maas cluster name shouldnot / can not have trailing '.'
+ maas cluster name with ending '.' breaks dns
Changed in maas:
status: New → Triaged
importance: Undecided → Critical
milestone: none → next
Scott Moser (smoser)
summary: - maas cluster name with ending '.' breaks dns
+ maas cluster name should not / can not have trailing '.'
Changed in maas:
assignee: nobody → Ricardo Bánffy (rbanffy)
Changed in maas:
assignee: Ricardo Bánffy (rbanffy) → nobody
assignee: nobody → Mike Pontillo (mpontillo)
Changed in maas:
milestone: next → 1.8.0
Revision history for this message
Mike Pontillo (mpontillo) wrote :

I proposed a fix for this as follows:

https://code.launchpad.net/~mpontillo/maas/bug-1433622-disallow-absolute-fqdn-cluster-names/+merge/254826

The first part of the fix was to disallow "." at the end of the name (and other invalid domain names). Then I took the next step and changed the code to change a domain like "maas." to "maas" under the hood.

Changed in maas:
status: Triaged → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.