enlist tries to enlist invalid hostname if dns not setup properly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Committed
|
Undecided
|
Andres Rodriguez |
Bug Description
looking at console output of an enlisting server i see:
=== Wed, 09 Apr 2014 19:44:59 +0000: successfully enlisted to 'http://
{"hostname": ["Name contains disallowed characters: u';; connection timed out; no servers could be reached'
2014-04-09 19:45:09,935 - util.py[DEBUG]: Writing to /var/lib/
2014-04-09 19:45:09,936 - helpers.py[DEBUG]: Running config-
thkey_fingerpri
this seems to be a result of the following code in contrib/
host=""
ip=$(ifconfig eth0 | awk '$1 == "inet" { sub("addr:","",$2); print $2; }') &&
[ -n "${ip}" ] && host=$(dig +short -x $ip) && host=${host%.}
in this failure case, dig exited failure (probably '9') but wrote to stdout:
;; connection timed out; no servers could be reached
so we need to fix the above to just do
[ -n "${ip}" ] && host=$(dig +short -x $ip) && host=${host%.} || host=""
Related branches
- Jeroen T. Vermeulen (community): Approve
-
Diff: 14 lines (+2/-1)1 file modifiedcontrib/preseeds_v2/enlist_userdata (+2/-1)
Changed in maas: | |
assignee: | nobody → Andres Rodriguez (andreserl) |
Changed in maas: | |
status: | New → Fix Committed |
maas server responds somewhat non-ideally with:
ERROR 2014-04-09 21:00:56,156 maasserver ####### ####### ####### ####### #### Exception: {'hostname': [u"Name contains disallowed characters: u';; connection timed out; no servers could be reached'."]} ####### ####### ####### ####### #### python2. 7/dist- packages/ django/ core/handlers/ base.py" , line 114, in get_response callback( request, *callback_args, **callback_kwargs) python2. 7/dist- packages/ django/ views/decorator s/vary. py", line 19, in inner_func python2. 7/dist- packages/ piston/ resource. py", line 167, in __call__ handler( e, request, meth, em_format) python2. 7/dist- packages/ piston/ resource. py", line 165, in __call__ python2. 7/dist- packages/ maasserver/ api_support. py", line 189, in dispatch python2. 7/dist- packages/ maasserver/ api.py" , line 576, in new node(request) python2. 7/dist- packages/ maasserver/ api.py" , line 547, in create_node (form.errors)
ERROR 2014-04-09 21:00:56,156 maasserver Traceback (most recent call last):
File "/usr/lib/
response = wrapped_
File "/usr/lib/
response = func(*args, **kwargs)
File "/usr/lib/
result = self.error_
File "/usr/lib/
result = meth(request, *args, **kwargs)
File "/usr/lib/
return function(self, request, *args, **kwargs)
File "/usr/lib/
return create_
File "/usr/lib/
raise ValidationError
ValidationError: {'hostname': [u"Name contains disallowed characters: u';; connection timed out; no servers could be reached'."]}