Bug 39557 - 92univention-management-console-web-server.inst fails if ip is changed during setup
92univention-management-console-web-server.inst fails if ip is changed during...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: SAML
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.1
Assigned To: Stefan Gohmann
Felix Botner
: interim-2
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-15 14:49 CEST by Felix Botner
Modified: 2015-11-17 12:12 CET (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Botner univentionstaff 2015-10-15 14:49:46 CEST
Installed UCS 4.1 appliance, then i started system setup and changed the ip address. 

All seemed find but during join 92univention-management-console-web-server.inst failed.

Configure /usr/lib/univention-install/92univention-management-console-web-server.inst
2015-10-15 14:20:41.021196104+02:00 (in joinscript_init)
Setting ucs/web/overview/entries/admin/umc/icon
Setting ucs/web/overview/entries/admin/umc/link
Create ucs/web/overview/entries/admin/umc/link/de
Setting ucs/web/overview/entries/admin/umc/priority
File: /var/www/ucs-overview/entries.json
Setting ucs/web/overview/entries/admin/umc/label
Setting ucs/web/overview/entries/admin/umc/label/de
Setting ucs/web/overview/entries/admin/umc/description
Setting ucs/web/overview/entries/admin/umc/description/de
File: /var/www/ucs-overview/entries.json
Object created: SAMLServiceProviderIdentifier=https://ucs-9553.aaa.intranet/univention-management-console/saml/metadata,cn=saml-serviceprovider,cn=univention,dc=aaa,dc=intranet
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/saml2/metadata.py", line 83, in create_metadata_string
    config = Config().load_file(configfile, metadata_construction=True)
  File "/usr/lib/python2.7/dist-packages/saml2/config.py", line 372, in load_file
    mod = self._load(config_file)
  File "/usr/lib/python2.7/dist-packages/saml2/config.py", line 366, in _load
    return import_module(tail)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/share/univention-management-console/saml/sp.py", line 21, in <module>
    addresses.extend([y['address'] for x, y in i.all_interfaces])
KeyError: 'address'


This is because the UCR interface config during setup looks like this

interfaces/eth0/address: 10.200.7.189
interfaces/eth0/broadcast: 10.200.7.255
interfaces/eth0/ipv6/acceptRA: false
interfaces/eth0/netmask: 255.255.255.0
interfaces/eth0/network: 10.200.7.0
interfaces/eth0/start: true
interfaces/eth0/type: static
interfaces/eth0_0/broadcast: 10.200.7.255
interfaces/eth0_0/network: 10.200.7.0
interfaces/eth0_0/type: appliance-mode-temporary
interfaces/eth0_0_0/address: 10.200.7.188
interfaces/eth0_0_0/broadcast: 10.200.7.255
interfaces/eth0_0_0/netmask: 255.255.255.0
interfaces/eth0_0_0/network: 10.200.7.0
interfaces/eth0_0_0/type: appliance-mode-temporary


This sure looks odd (and should be fixed in system setup some day) but can easily be fixed in /usr/share/univention-management-console/saml/sp.py (check for address key in interface before accessing in  [y['address'] for x, y in i.all_interfaces])

I'm pretty sure saml does not work this systems.
Comment 1 Stefan Gohmann univentionstaff 2015-10-16 10:19:37 CEST
Fixed with r64536.

Changelog is not required because the code is new in 4.1.
Comment 2 Felix Botner univentionstaff 2015-10-20 09:53:21 CEST
OK, works now
Comment 3 Stefan Gohmann univentionstaff 2015-11-17 12:12:35 CET
UCS 4.1 has been released:
 https://docs.software-univention.de/release-notes-4.1-0-en.html
 https://docs.software-univention.de/release-notes-4.1-0-de.html

If this error occurs again, please use "Clone This Bug".