Problem: UCS@school - ID Broker Plugin - ModuleNotFoundError: lazy_object_proxy

UCS@school - ID Broker Plugin ModuleNotFoundError: lazy_object_proxy

Problem:

A school authority installation was performed according to the documentation:
https://docs.software-univention.de/idbroker-school-authority-manual/installation.html

The installation itself and the first test step (API access) work correctly.

During the configuration step, adding the school_authority succeeds without any errors.

However, when running initial_sync.py, the process fails and does not continue.

Command used:

univention-app shell ucsschool-id-connector \
/var/lib/univention-appcenter/apps/ucsschool-id-connector/conf/plugins/packages/idbroker/initial_sync.py --dry-mode

Error message:

Traceback (most recent call last):
  File "/var/lib/univention-appcenter/apps/ucsschool-id-connector/conf/plugins/packages/idbroker/initial_sync.py", line 42, in <module>
    import lazy_object_proxy
ModuleNotFoundError: No module named 'lazy_object_proxy'

Environment

UCS: 5.0-10 errata1344
Installed: prometheus-node-exporter=2.0.1 radius=5.0 samba4=4.16
ucsschool=5.0 v4 ucsschool-id-connector=3.0.4
4.4/openid-connect-provider=2.2-konnect-0.33.11-2

The ID Broker Plugin installed:
id-broker-id-connector-plugin 1.3.18


Investigation

Inside the ID connector container, the module lazy-object-proxy was expected to be present.
Verification command:

pip install lazy-object-proxy

On a reference system, the module is already installed:

Requirement already satisfied: lazy-object-proxy in /venv/lib/python3.11/site-packages (1.10.0)

However, the script header in:

/var/lib/univention-appcenter/apps/ucsschool-id-connector/conf/plugins/packages/idbroker/initial_sync.py

contains:

#!/usr/bin/python3

But inside the container, python3 resolves to:

/venv/bin/python3

Therefore, the script is executed using the wrong Python interpreter, which does not have the required modules installed.

Additionally, all related scripts originate from the Univention ID Broker Plugin, currently installed in an outdated version.

Verification of script ownership:

dpkg -S create_idbroker_client.py
id-broker-id-connector-plugin: /var/lib/univention-appcenter/apps/ucsschool-id-connector/conf/plugins/packages/idbroker/create_idbroker_client.py

Version check:

apt-cache policy id-broker-id-connector-plugin

This revealed that the system was using an old version of the plugin because the ucsschool app itself was outdated.


Solution:

The package id-broker-id-connector-plugin depends on ucsschool.
Since ucsschool was outdated, the plugin also remained in an older version.

Updating ucsschool updates the plugin automatically.

Steps to fix the issue

univention-app update
univention-app upgrade ucsschool

After upgrading, the correct plugin version was installed and the scripts executed successfully with the correct Python environment.


Resolution

After the update, the correct version is shown:

apt-cache policy id-broker-id-connector-plugin
id-broker-id-connector-plugin:
  Installed:           2.2.4
  Candidate:           2.2.4
  Version table:
 *** 2.2.4 500
        500 https://appcenter.software-univention.de/univention-repository/5.2/maintained/component ucsschool_20250902122950/all/ Packages
        100 /var/lib/dpkg/status
     2.2.3 500
     2.2.2 500
     1.6.14 500
     1.6.5 500

After updating UCS School, the ID Broker connector plugin was upgraded to the correct version and the initial_sync.py script worked without errors.