Problem: OX Connector Failure After Installing or Upgrading to Provisioning Service
After installing the Nubus Provisioning Service or upgrading the OX Connector to version 4.0.0, the OX Connector may fail to start, enter a restart loop, or function incorrectly. This is cau
sed by a combination of two primary issues: a failed database migration and a failure in applying initial app settings.
Symptoms
You may encounter one or more of the following symptoms:
1. Container Restart Loop & Persistent Configuration Loss
The ox-connector container may continuously restart. During this state, any configuration changes made via univention-app configure may not be saved, and only default values will be show
n.
2. Validation Error (Missing Configuration)
The connector may crash with a Pydantic validation error:
sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) NOT NULL constraint failed: tasks.attrs
[SQL: INSERT INTO tasks (obj_id, udm_module, dn, attrs, status, num_errors, created_at) VALUES (?, ?, ?, ?, ?, ?, ?)]
[parameters: ('<uuid>', 'oxresources/oxresources', 'cn=test,cn=oxresources,cn=open-xchange,<ldap/base>', None, 'new', 0, '<ts>')]
3. Invalid URL Error (Incorrect Base URL)
The PROVISIONING_API_BASE_URL may be incorrectly set (e.g., missing the hostname), leading to:
aiohttp.client_exceptions.InvalidUrlClientError: https:///univention/provisioning/v1/subscriptions/...
Because ucr variable ox/connector/provisioning-server might not be set.
Root Causes
Two distinct bugs contribute to this failure:
- Bug 60018 (Primary Root Cause): A required database table migration failed during the update process. This caused the OX Connector container to crash and restart continuously. Because the container was not stable, configuration changes were not persisted to the database, making it appear as though settings were being ignored.
- Bug 59781: A bug in the App Center prevented initial default values of new settings from being applied during app upgrades. This meant that even if the container were stable, it would lack critical required parameters.
Solution
1. Apply Latest Erratas
Ensure your system is updated with the latest erratas to resolve both the database migration issue and the App Center settings bug (specifically Errata 5.2x617 and subsequent fixes for Bug 60018).
Run the standard UCS update process:
univention-upgrade
Or use the workaround from Bug 60018 for the time beeing. Make sure sqlite3 is installed on your server for the workaround.
cp /var/lib/univention-appcenter/apps/ox-connector/data/ox-connector.db{,.bak} # just in case
sqlite3 /var/lib/univention-appcenter/apps/ox-connector/data/ox-connector.db <<EOF
BEGIN;
CREATE TABLE tasks_new (
id INTEGER PRIMARY KEY AUTOINCREMENT,
obj_id VARCHAR NOT NULL,
udm_module VARCHAR NOT NULL,
dn VARCHAR NOT NULL,
attrs VARCHAR,
status VARCHAR NOT NULL DEFAULT 'new',
num_errors INTEGER NOT NULL DEFAULT 0,
created_at DATETIME
);
INSERT INTO tasks_new SELECT * FROM tasks;
DROP TABLE tasks;
ALTER TABLE tasks_new RENAME TO tasks;
CREATE INDEX tasks_created_at ON tasks (created_at);
COMMIT;
EOF
2. Set the Provisioning Server UCR Variable
In addition to the app settings, the following UCR variable must be set to ensure the connector can locate the provisioning server:
ucr set ox/connector/provisioning-server="$(ucr get ldap/master)"
3. Re-configure the OX Connector
Once the erratas are applied and the UCR variable is set, re-configure the OX Connector to ensure all required parameters are correctly written to the database:
univention-app configure ox-connector \
--set OX_SOAP_SERVER="https://<your-ox-server>" \
--set OX_IMAP_SERVER="imap://<your-ox-server>:143" \
--set OX_SMTP_SERVER="smtp://<your-ox-server>:587" \
--set OX_MASTER_PASSWORD="<password>" \
--set DEFAULT_CONTEXT="10" \
--set OX_LANGUAGE="de_DE" \
--set LOCAL_TIMEZONE="Europe/Berlin" \
--set OX_MASTER_ADMIN=oxadminmaster \
--set OX_CONNECTOR_LOG_LEVEL=INFO \
--set MAX_ACKNOWLEDGEMENT_RETRIES="3"
4. Verify and Restart
Restart the service and check the logs to confirm the container is now stable:
univention-app restart ox-connector
univention-app logs ox-connector
# or
docker logs -f <container_id>
References
- Bugzilla (Combined List): Bugs 59781 & 60018
- Errata: 5.2x617