Problem: OX Connector 3.0.1 Listener Trigger fails with `ModuleNotFoundError` after Upgrade

OX Connector 3.0.1 – Listener Trigger fails with ModuleNotFoundError after Upgrade

Problem

After upgrading the OX Connector App from version 2.3.5 to 3.0.1, the LDAP listener processing stopped working. The log file /var/log/univention/listener_modules/ox-connector.log showed a fatal error related to the listener trigger mechanism, followed by repeated ModuleNotFoundError: No module named 'univention.ox.provisioning.models' exceptions for every processed LDAP object.


Environment

UCS Version:

  • 5.2-4 errata353
  • ox-connector=3.0.1

Problem Description

After upgrading the OX Connector App from 2.3.5 to 3.0.1, the following fatal error appears in:

/var/log/univention/listener_modules/ox-connector.log

Initial Fatal Error

2026-02-18 16:18:54 ERROR   univention-appcenter-listener-converter.main:189  Fatal error:
Traceback (most recent call last):
  File "/usr/share/univention-appcenter-listener-converter", line 187, in main
    run_trigger(app)
  File "/usr/share/univention-appcenter-listener-converter", line 66, in run_trigger
    open(docker.path(script_name), 'w')
FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/docker/overlay2/1d7e2c5f213bf83df67678d670d071c1fa0baa30f2fbe07ad38b12be36004437/merged/tmp/univention-ox-connector.listener_trigger'

After this initial error, every LDAP object that is processed triggers the following:

2026-02-19 12:13:16 WARNING Traceback (most recent call last):
2026-02-19 12:13:16 WARNING   File "/tmp/univention-ox-connector.listener_trigger", line 56, in <module>
2026-02-19 12:13:16 WARNING     from univention.ox.provisioning.models import TriggerObject
2026-02-19 12:13:16 WARNING ModuleNotFoundError: No module named 'univention.ox.provisioning.models'

As a result, LDAP provisioning to OX is no longer executed.


Investigation

1. Service Status and Health Check

The following helper script was running periodically:

/usr/local/sbin/monit_helper.sh oxconnector

Process list excerpt (around 05:30):

root     2065307  2.5  0.0   9264  4348 ?        Ss   05:30   0:00  \_ /bin/bash /usr/local/sbin/monit_helper.sh oxconnector
root     2065310  105  0.3 109844 50372 ?        R    05:30   0:00  |   \_ /usr/bin/python3 /usr/bin/univention-app shell ox-connector /usr/local/share/ox-connector/resources/get_current_error.py

This helper script periodically calls the internal OX Connector health check as documented in the official troubleshooting guide:
https://docs.software-univention.de/ox-connector-app/2.3.5/troubleshooting.html#health-check

The health check returns:

{"errors": "0"}

This indicates that the OX Connector service itself is running correctly.

Therefore, the issue is not related to the runtime state of the container but specifically to the listener trigger execution.


2. Verifying the Python Module Inside the Container

Test inside the OX Connector container:

/oxp # python3 -c "import univention.ox.provisioning.models"

Result:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'univention.ox.provisioning.models'

However:

/oxp # python3 -c "import univention.ox.provisioning"
/oxp #

No error occurred.

This confirms that:

  • The base module univention.ox.provisioning exists.
  • The submodule univention.ox.provisioning.models does not exist in the container image of version 3.0.1.

Root Cause

The file:

/tmp/univention-ox-connector.listener_trigger

is not part of the OX Connector Docker image.

Instead, it is dynamically copied into the container by:

univention-appcenter-listener-converter@ox-connector.service

The relevant logic is implemented in:

/usr/share/univention-appcenter-listener-converter

Specifically in the run_trigger() function.

The source file for the trigger script is located in:

/var/cache/univention-appcenter/appcenter.software-univention.de/5.2/ox-connector_20251001132312.listener_trigger

In this case, an incompatible version of the listener_trigger file was published in the App Center branch for OX Connector 3.0.1.

The deployed trigger file contained the following import:

from univention.ox.provisioning.models import TriggerObject

However, the module univention.ox.provisioning.models is not available in the OX Connector 3.0.1 container image.

As a result, every execution of the listener trigger inside the container fails with:

ModuleNotFoundError: No module named 'univention.ox.provisioning.models'

The health check does not detect this issue because it does not execute the listener trigger script.


Solution

Running:

univention-app update

followed by restarting the listener converter service:

systemctl restart univention-appcenter-listener-converter@ox-connector.service

resolved the issue.

After the update:

  • A corrected listener_trigger file was deployed.
  • No further ModuleNotFoundError occurred.
  • LDAP provisioning resumed normally.
  • No additional errors appeared in:
/var/log/univention/listener_modules/ox-connector.log

Conclusion

The issue was caused by a version mismatch between:

  • The OX Connector 3.0.1 container image
  • The dynamically deployed listener_trigger script from the App Center cache

The container itself was running correctly (as verified by the health check), but LDAP provisioning failed due to an incompatible trigger script.

If similar behavior occurs after an app upgrade:

  1. Check /var/log/univention/listener_modules/<app>.log
  2. Verify Python module availability inside the container
  3. Inspect /var/cache/univention-appcenter/ for trigger files
  4. Run univention-app update
  5. Restart univention-appcenter-listener-converter@<app>.service