Bug 44394 - UnboundLocalError: local variable 'guessed_domain' referenced before assignment
UnboundLocalError: local variable 'guessed_domain' referenced before assignment
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Setup wizard
UCS 4.2
Other Linux
: P5 normal (vote)
: UCS 4.2-0-errata
Assigned To: Florian Best
Richard Ulmer
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-04-18 12:51 CEST by Florian Best
Modified: 2017-06-19 15:04 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 6: Setup Problem: Issue for the setup process
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.103
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2017040121000616
Bug group (optional): External feedback
Max CVSS v3 score:
klaeser: Patch_Available+


Attachments
Patch (666 bytes, patch)
2017-04-24 13:21 CEST, Alexander Kläser
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2017-04-18 12:51:54 CEST
Version: 4.1-4 errata324 (Vahr)

Traceback(a90e0c857791708c14bfa0477f32506d):
Execution of command 'setup/validate wizard' has failed:

Traceback (most recent call last):
  File "%PY2.7%/univention/management/console/base.py", line 283, in execute
    function(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 318, in _response
    result = _multi_response(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 462, in _response
    return list(function(self, iterator, *nones))
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 284, in _fake_func
    yield function(self, *args)
  File "%PY2.7%/univention/management/console/modules/setup/__init__.py", line 515, in validate
    guessed_domain = guess_domain(obj)
  File "%PY2.7%/univention/management/console/modules/setup/__init__.py", line 502, in guess_domain
    if guessed_domain:
UnboundLocalError: local variable 'guessed_domain' referenced before assignment
Comment 1 Alexander Kläser univentionstaff 2017-04-24 13:21:36 CEST
Created attachment 8800 [details]
Patch
Comment 2 Florian Best univentionstaff 2017-05-29 17:25:24 CEST
It's reproducible with the following curl request:

curl -i http://Administrator:univention@localhost/univention/command/setup/validate -H 'X-Requested-With: xmlhttprequest' -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"options": {"values": {"ad/member": true, "nameserver1":"127.0.0.1", "domainname": "school.local", "hostname": "master60", "ad/address":"1.2.3.4"}}, "flavor": "wizard"}'

I happens only in a scenario where you select to join a Active directory domain and enter a e.g. not reachable IP address.

univention-system-setup (10.0.10-19):
r79938 | Bug #44394: don't crash at validation if joining into a AD domain and the AD server is not reachable

univention-system-setup.yaml:
r79941 | YAML Bug #44035 Bug #44394 Bug #43273
Comment 3 Richard Ulmer univentionstaff 2017-05-30 12:56:28 CEST
I got no traceback when doing the curl-request with the fix anymore. -> Verified.

Note: To reproduce the behavior I also had to remove /var/univention-join/joined before executing the curl request.
Comment 4 Janek Walkenhorst univentionstaff 2017-06-19 15:04:52 CEST
<http://errata.software-univention.de/ucs/4.2/50.html>