[2.0] MAAS fails to start-up if gethostbyname returns an FQDN

Bug #1614584 reported by Andres Rodriguez on 2016-08-18
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
MAAS
Critical
LaMont Jones
2.1
Critical
LaMont Jones

Bug Description

> > 2016-08-17 14:23:17 [maasserver.start_up] ERROR: Error during start-up.
> >
> > Traceback (most recent call last):
> >
> > File "/usr/lib/python3/dist-packages/maasserver/start_up.py", line 82,
> > in start_up
> >
> > yield deferToDatabase(inner_start_up)
> >
> > File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py",
> > line 246, in inContext
> >
> > result = inContext.theWork()
> >
> > File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py",
> > line 262, in <lambda>
> >
> > inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
> >
> > File "/usr/lib/python3/dist-packages/twisted/python/context.py", line
> > 118, in callWithContext
> >
> > return self.currentContext().callWithContext(ctx, func, *args, **kw)
> >
> > File "/usr/lib/python3/dist-packages/twisted/python/context.py", line
> > 81, in callWithContext
> >
> > return func(*args,**kw)
> >
> > File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py",
> > line 937, in callInContext
> >
> > return func(*args, **kwargs)
> >
> > File "/usr/lib/python3/dist-packages/maasserver/utils/orm.py", line
> > 558, in call_with_connection
> >
> > return func(*args, **kwargs)
> >
> > File "/usr/lib/python3/dist-packages/maasserver/utils/__init__.py",
> > line 165, in call_with_lock
> >
> > return func(*args, **kwargs)
> >
> > File "/usr/lib/python3/dist-packages/maasserver/utils/orm.py", line
> > 602, in call_within_transaction
> >
> > return func_outside_txn(*args, **kwargs)
> >
> > File "/usr/lib/python3/dist-packages/maasserver/utils/orm.py", line
> > 421, in retrier
> >
> > return func(*args, **kwargs)
> >
> > File "/usr/lib/python3.5/contextlib.py", line 30, in inner
> >
> > return func(*args, **kwds)
> >
> > File "/usr/lib/python3/dist-packages/maasserver/start_up.py", line 136,
> > in inner_start_up
> >
> > region_obj = create_region_obj()
> >
> > File "/usr/lib/python3/dist-packages/maasserver/start_up.py", line 152,
> > in create_region_obj
> >
> > region_obj = RegionController.objects.create(hostname=hostname)
> >
> > File "/usr/lib/python3/dist-packages/django/db/models/manager.py", line
> > 127, in manager_method
> >
> > return getattr(self.get_queryset(), name)(*args, **kwargs)
> >
> > File "/usr/lib/python3/dist-packages/django/db/models/query.py", line
> > 348, in create
> >
> > obj.save(force_insert=True, using=self.db)
> >
> > File "/usr/lib/python3/dist-packages/maasserver/models/node.py", line
> > 1332, in save
> >
> > super(Node, self).save(*args, **kwargs)
> >
> > File "/usr/lib/python3/dist-packages/maasserver/models/cleansave.py",
> > line 28, in save
> >
> > self.full_clean()
> >
> > File "/usr/lib/python3/dist-packages/django/db/models/base.py", line
> > 1171, in full_clean
> >
> > raise ValidationError(errors)
> >
> > django.core.exceptions.ValidationError: {'hostname': ['Nonexistant
> > domain.']}

Related branches

Gavin Panella (allenap) on 2016-09-26
Changed in maas:
status: Confirmed → Triaged
Chris Martin (6-chris-z) wrote :

It seems this happens when your MaaS server's hostname (as set in /etc/hostname) isn't in the "Domain" Django model (i.e. maasserver_domain PostgreSQL table).

`maas admin domains create name=mydomain.com` worked around the error for me.

This isn't a great user experience when setting up a new MaaS server. Suggestion: if the hostname includes a domain-part at MaaS install time, then that domain is automatically added to the database by the package configuration script, or something like that.

no longer affects: maas/trunk
no longer affects: maas/2.0
Changed in maas:
milestone: none → 2.2.0
LaMont Jones (lamont) wrote :

Chris - are you saying that /etc/hostname has a fully-qualified domain name? If you can provide me (either in the bug, or privately) the actual values, that would be helpful.

LaMont Jones (lamont) on 2016-12-07
summary: - [2.0] MAAS fails to start-up if machines contains a domain
+ [2.0] MAAS fails to start-up if gethostbyname returns an FQDN
Changed in maas:
status: Triaged → Fix Committed
Changed in maas:
assignee: nobody → LaMont Jones (lamont)
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers