Bug 56848 - OX Connector cant't handle Context greater than 1215752191
OX Connector cant't handle Context greater than 1215752191
Status: NEW
Product: Z_Internal OX development
Classification: Unclassified
Component: OX-Connector
unspecified
Other Linux
: P5 normal (vote)
: ---
Assigned To: Mail maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2023-11-17 12:46 CET by Lukas Rettler
Modified: 2024-01-29 08:37 CET (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 5: Will affect all installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.171
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 Lukas Rettler univentionstaff 2023-11-17 12:46:33 CET
Version: ox-connector=2.2.7

When a Context greater than 1215752191 is created the following error occur:

```
2023-11-17 11:36:27 INFO    Handling PosixPath('/var/lib/univention-appcenter/apps/ox-connector/data/listener/2023-11-15-23-32-38-719907.json')
2023-11-17 11:36:27 INFO    Creating Object('oxmail/oxcontext', 'cn=99999999999,cn=open-xchange,dc=dev,dc=px2,dc=own-data,dc=org')
2023-11-17 11:36:28 INFO    Error while processing /var/lib/univention-appcenter/apps/ox-connector/data/listener/2023-11-15-23-32-38-719907.json
2023-11-17 11:36:28 WARNING Traceback (most recent call last):
2023-11-17 11:36:28 WARNING   File "/tmp/univention-ox-connector.listener_trigger", line 341, in run_on_files
2023-11-17 11:36:28 WARNING     function(obj)
2023-11-17 11:36:28 WARNING   File "/usr/lib/python3.9/site-packages/univention/ox/provisioning/__init__.py", line 69, in run
2023-11-17 11:36:28 WARNING     create_context(obj)
2023-11-17 11:36:28 WARNING   File "/usr/lib/python3.9/site-packages/univention/ox/provisioning/contexts.py", line 64, in create_context
2023-11-17 11:36:28 WARNING     if context_exists(obj):
2023-11-17 11:36:28 WARNING   File "/usr/lib/python3.9/site-packages/univention/ox/provisioning/contexts.py", line 59, in context_exists
2023-11-17 11:36:28 WARNING     return bool(get_obj_by_name_from_ox(Context, context_id, None))
2023-11-17 11:36:28 WARNING   File "/usr/lib/python3.9/site-packages/univention/ox/provisioning/helpers.py", line 41, in get_obj_by_name_from_ox
2023-11-17 11:36:28 WARNING     return klass.from_ox(context_id, name=name)
2023-11-17 11:36:28 WARNING   File "/usr/lib/python3.9/site-packages/univention/ox/soap/backend.py", line 282, in from_ox
2023-11-17 11:36:28 WARNING     soap_obj = context_service.get_data(context_obj)
2023-11-17 11:36:28 WARNING   File "/usr/lib/python3.9/site-packages/univention/ox/soap/services.py", line 357, in get_data
2023-11-17 11:36:28 WARNING     return self._call_ox('getData', ctx=context_obj, auth=self.credentials.master_credentials)
2023-11-17 11:36:28 WARNING   File "/usr/lib/python3.9/site-packages/univention/ox/soap/services.py", line 163, in _call_ox
2023-11-17 11:36:28 WARNING     return getattr(service, func)(**kwargs)
2023-11-17 11:36:28 WARNING   File "/usr/lib/python3.9/site-packages/zeep/proxy.py", line 46, in __call__
2023-11-17 11:36:28 WARNING     return self._proxy._binding.send(
2023-11-17 11:36:28 WARNING   File "/usr/lib/python3.9/site-packages/zeep/wsdl/bindings/soap.py", line 135, in send
2023-11-17 11:36:28 WARNING     return self.process_reply(client, operation_obj, response)
2023-11-17 11:36:28 WARNING   File "/usr/lib/python3.9/site-packages/zeep/wsdl/bindings/soap.py", line 229, in process_reply
2023-11-17 11:36:28 WARNING     return self.process_error(doc, operation)
2023-11-17 11:36:28 WARNING   File "/usr/lib/python3.9/site-packages/zeep/wsdl/bindings/soap.py", line 329, in process_error
2023-11-17 11:36:28 WARNING     raise Fault(
2023-11-17 11:36:28 WARNING zeep.exceptions.Fault: Context 1215752191 does not exist; exceptionId -165183159-23074
2023-11-17 11:36:28 INFO    This is consecutive error #20526
2023-11-17 11:36:28 INFO    Sleeping for 0 sec
2023-11-17 11:36:28 INFO    Successfully processed 0 files during this run
```
Comment 1 Dirk Wiesenthal univentionstaff 2023-11-17 13:23:30 CET
Actually, it is 4294967295:

If you create a oxcontext with ID 999999999, the ox-connector - before creating the context - asks OX whether this context with that ID already exists. If not, the error message expected by the ox-connector is "Context 999999999 does not exist".

But OX responds with Context 1215752191 does not exist.

Why? Because
  999999999 mod 4294967295 = 1215752191

We should not allow a context ID > int32.MAX

As far as I know, this number does not exist in Python3. It would need to be hard coded into the syntax.
Comment 2 Tim Breidenbach univentionstaff 2024-01-24 14:02:18 CET
I saw this in a another environment. 
Would it be a feature request to prevent the oxmail/oxcontext creation in an syntax check?
Comment 3 Daniel Tröder univentionstaff 2024-01-29 08:37:59 CET
The UDM syntax class "integer" does not support size limits.
You either have to adapt the UDM syntax class and make the OX connector app depend on the UCS errata version or install a custom syntax class.