[2.2] Rack registration fails if machine has domain in hostname

Bug #1686757 reported by Blake Rouse
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Critical
Данило Шеган

Bug Description

Everything works fine when:

$ cat /etc/hostname
maas

Doesn't work at all when:

$ cat /etc/hostname
maas.domain.bad

=> /var/log/maas/rackd.log <==
2017-04-27 15:05:17 provisioningserver.rpc.clusterservice: [info] Rack controller REJECTED by the region (via my-maas:pid=343).
2017-04-27 15:05:17 ClusterClient,client: [info] ClusterClient connection lost (HOST:IPv6Address(TCP, '::ffff:192.168.122.2', 53074) PEER:IPv6Address(TCP, '::ffff:192.168.122.2', 5252))

==> /var/log/maas/regiond.log <==
2017-04-27 15:05:17 maasserver.rpc.regionservice: [info] Rack controller 'xyxgyy' disconnected.
2017-04-27 15:05:17 RegionServer,19,::ffff:192.168.122.2: [info] RegionServer connection lost (HOST:IPv6Address(TCP, '::ffff:192.168.122.2', 5252) PEER:IPv6Address(TCP, '::ffff:192.168.122.2', 53074))
2017-04-27 15:05:17 maasserver.rpc.regionservice: [critical] Failed to register rack controller 'xyxgyy' into the database. Connection will be dropped.

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 588, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1184, in gotResult
    _inlineCallbacks(r, g, deferred)
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1126, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/lib/python3/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
--- <exception caught here> ---
  File "/usr/lib/python3/dist-packages/maasserver/rpc/regionservice.py", line 613, in register
    process, rack_controller, self.host)
  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 875, in callInContext
    return func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 232, in wrapper
    result = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/utils/orm.py", line 686, in call_within_transaction
    return func_outside_txn(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/utils/orm.py", line 504, 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/rpc/regionservice.py", line 1289, in registerConnection
    process=process, address=host.host, port=host.port)
  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 334, in get
    self.model._meta.object_name
maasserver.models.regioncontrollerprocessendpoint.DoesNotExist: RegionControllerProcessEndpoint matching query does not exist.

==> /var/log/maas/rackd.log <==
2017-04-27 15:05:17 provisioningserver.rpc.clusterservice: [info] Rack controller REJECTED by the region (via my-maas:pid=309).
2017-04-27 15:05:17 ClusterClient,client: [info] ClusterClient connection lost (HOST:IPv6Address(TCP, '::ffff:192.168.122.2', 40954) PEER:IPv6Address(TCP, '::ffff:192.168.122.2', 5250))

==> /var/log/maas/regiond.log <==
2017-04-27 15:05:17 maasserver.rpc.regionservice: [info] Rack controller 'xyxgyy' disconnected.
2017-04-27 15:05:17 RegionServer,19,::ffff:192.168.122.2: [info] RegionServer connection lost (HOST:IPv6Address(TCP, '::ffff:192.168.122.2', 5250) PEER:IPv6Address(TCP, '::ffff:192.168.122.2', 40954))

Related branches

Changed in maas:
milestone: 2.2.0rc3 → 2.2.0rc4
assignee: nobody → Данило Шеган (danilo)
Changed in maas:
status: Triaged → In Progress
Revision history for this message
Данило Шеган (danilo) wrote :

I've originally managed to reproduce this, but don't seem to be able to anymore. I've tried both with my existing local MAAS server, and with a MAAS setup using the following:

  uvt-kvm create --ssh-public-key-file ~/.ssh/authorized_keys maas1
  uvt-kvm ssh --insecure maas1 sudo apt-add-repository ppa:maas/next-proposed
  uvt-kvm ssh --insecure maas1 sudo apt update
  uvt-kvm ssh --insecure maas1 sudo apt install maas

  uvt-kvm create --ssh-public-key-file ~/.ssh/authorized_keys maas2
  uvt-kvm ssh --insecure maas2 sudo apt-add-repository ppa:maas/next-proposed
  uvt-kvm ssh --insecure maas2 sudo apt update
  uvt-kvm ssh --insecure maas2 sudo apt install maas-rack-controller
  echo maas2.test | uvt-kvm ssh --insecure maas2 sudo tee /etc/hostname

I reboot the "maas2" VM and attempt to register it as a rack controller on the first (use "uvt-kvm ip maas1/2" to find out IP address for each).

I get none of the tracebacks, but the domain name is not being created, so I'll re-focus on that part of the bug.

Changed in maas:
status: In Progress → 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.

Other bug subscribers

Remote bug watches

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