Problem: SAML SP Setup FileNotFoundError

Problem

The join process fails with a FileNotFoundError within the SAML Service Provider setup module, often occurring when attempting to modify or remove SAML bindings.
Symptom (Traceback):

E: Value 'maintained' incompatible for 'repository/online/component/customX/parts'
curl: (3) URL using bad/illegal format or missing URL
…
Create umc/saml/idp-server
Module: setup_saml_sp
Try to download idp metadata (1/60)
…
Try to download idp metadata (60/60)
Traceback (most recent call last):
  File "/usr/sbin/ucr", line 17, in <module>
    sys.exit(ub.main(sys.argv[1:]))
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/univention/config_registry/frontend.py", line 804, in main
    result = handler_func(args, cmd_opts)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/univention/config_registry/frontend.py", line 170, in handler_set
    _run_changed(ucr, changed, "" if quiet else 'W: %s is overridden by scope "%s"')
  File "/usr/lib/python3/dist-packages/univention/config_registry/frontend.py", line 233, in _run_changed
    handlers(list(visible), (ucr, visible))
  File "/usr/lib/python3/dist-packages/univention/config_registry/handler.py", line 1020, in __call__
    handler(arg)
  File "/usr/lib/python3/dist-packages/univention/config_registry/handler.py", line 573, in __call__
    run_module(self.module, 'handler', ucr, changed)
  File "/usr/lib/python3/dist-packages/univention/config_registry/handler.py", line 180, in run_module
    f(ucr, changes)
  File "/etc/univention/templates/modules/setup_saml_sp.py", line 43, in handler
    remove_saml_logout_soap_binding(config_registry, saml_idp)
  File "/etc/univention/templates/modules/setup_saml_sp.py", line 59, in remove_saml_logout_soap_binding
    with open(filename) as xmlfile:
         ^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/univention-management-console/saml/idp/.xml'
Unsetting umc/saml/idp-server
Module: setup_saml_sp
umc/saml/idp-server not set, nothing to do

Investigation

The FileNotFoundError /usr/share/univention-management-console/saml/idp/.xml indicates that the variable used to define the IDP filename is empty, causing the script to look for a file with no name other than the extension. This typically happens when umc/saml/idp-server is not correctly set or is being unset during the join process.

Solution

  1. Verify that the umc/saml/idp-server UCR variable is correctly configured if a SAML IDP is required for the environment.