Bug 50850 - Provisioning App: Users: modify contextID
Provisioning App: Users: modify contextID
Status: VERIFIED FIXED
Product: Z_Internal OX development
Classification: Unclassified
Component: OX-Connector
unspecified
Other Linux
: P5 normal (vote)
: ---
Assigned To: Dirk Wiesenthal
Daniel Tröder
: interim-2
: 50822 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-02-24 17:15 CET by Daniel Tröder
Modified: 2020-03-06 13:00 CET (History)
0 users

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
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 Daniel Tröder univentionstaff 2020-02-24 17:15:14 CET
oxContext was 13, now changing to 12:

root@m66:~# udm users/user modify --dn uid=test5,cn=users,dc=uni,dc=dtr --set oxContext=12

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

2020-02-24 17:07:03 INFO    modify of uid=test5,cn=users,dc=uni,dc=dtr (id: 5e68b6f2-eb6a-1039-9892-396e91e2c316, file: /var/lib/univention-appcenter/listener//ox-connector/2020-02-24-17-07-03-770292.json)
2020-02-24 17:07:04 INFO    conversion of uid=test5,cn=users,dc=uni,dc=dtr (id: 5e68b6f2-eb6a-1039-9892-396e91e2c316, file: /var/lib/univention-appcenter/apps/ox-connector/data/listener/2020-02-24-17-07-03-770292.json)
2020-02-24 17:07:04 INFO    Running trigger
2020-02-24 17:07:06 INFO    univention.ox.backend_base.SoapUser: Deleted user 'test5' (3).
2020-02-24 17:07:06 WARNING Error while processing /var/lib/univention-appcenter/apps/ox-connector/data/listener/2020-02-24-17-07-03-770292.json
2020-02-24 17:07:06 WARNING Traceback (most recent call last):
2020-02-24 17:07:06 WARNING   File "/tmp/univention-ox-connector.listener_trigger", line 909, in run_on_files
2020-02-24 17:07:06 WARNING     f(obj)
2020-02-24 17:07:06 WARNING   File "/tmp/univention-ox-connector.listener_trigger", line 945, in run
2020-02-24 17:07:06 WARNING     modify_user(obj)
2020-02-24 17:07:06 WARNING   File "/tmp/univention-ox-connector.listener_trigger", line 525, in modify_user
2020-02-24 17:07:06 WARNING     return create_user(obj)
2020-02-24 17:07:06 WARNING   File "/tmp/univention-ox-connector.listener_trigger", line 496, in create_user
2020-02-24 17:07:06 WARNING     if obj.attributes.get("isOxUser", "Not") == "Not":
2020-02-24 17:07:06 WARNING AttributeError: 'NoneType' object has no attribute 'get'
2020-02-24 17:07:11 INFO    Running trigger
2020-02-24 17:07:12 INFO    univention.ox.backend_base.SoapUser: Created user 'test5' in context 12 (5).
2020-02-24 17:07:13 INFO    Success! Removing consumed files

=================

The user was successfully deleted in context 13 and created in context 12, but:

* fix traceback
* creation in new context must happen 1st, an old when successful: deletion in old context

=================

When using a non-existent context: the user is successfully deleted in old context but ofc not created in new context. That should not happen:

=================

2020-02-24 17:13:26 INFO    modify of uid=test5,cn=users,dc=uni,dc=dtr (id: 5e68b6f2-eb6a-1039-9892-396e91e2c316, file: /var/lib/univention-appcenter/listener//ox-connector/2020-02-24-17-13-26-469508.json)
2020-02-24 17:13:28 INFO    conversion of uid=test5,cn=users,dc=uni,dc=dtr (id: 5e68b6f2-eb6a-1039-9892-396e91e2c316, file: /var/lib/univention-appcenter/apps/ox-connector/data/listener/2020-02-24-17-13-26-469508.json)
2020-02-24 17:13:28 INFO    Running trigger
2020-02-24 17:13:30 INFO    univention.ox.backend_base.SoapUser: Deleted user 'test5' (5).
2020-02-24 17:13:30 WARNING Error while processing /var/lib/univention-appcenter/apps/ox-connector/data/listener/2020-02-24-17-13-26-469508.json
2020-02-24 17:13:30 WARNING Traceback (most recent call last):
2020-02-24 17:13:30 WARNING   File "/tmp/univention-ox-connector.listener_trigger", line 909, in run_on_files
2020-02-24 17:13:30 WARNING     f(obj)
2020-02-24 17:13:30 WARNING   File "/tmp/univention-ox-connector.listener_trigger", line 945, in run
2020-02-24 17:13:30 WARNING     modify_user(obj)
2020-02-24 17:13:30 WARNING   File "/tmp/univention-ox-connector.listener_trigger", line 525, in modify_user
2020-02-24 17:13:30 WARNING     return create_user(obj)
2020-02-24 17:13:30 WARNING   File "/tmp/univention-ox-connector.listener_trigger", line 496, in create_user
2020-02-24 17:13:30 WARNING     if obj.attributes.get("isOxUser", "Not") == "Not":
2020-02-24 17:13:30 WARNING AttributeError: 'NoneType' object has no attribute 'get'
2020-02-24 17:13:35 INFO    Running trigger
2020-02-24 17:13:36 WARNING Could not find admin password for context 55. Ignoring this task
2020-02-24 17:13:36 INFO    Success! Removing consumed files
Comment 1 Daniel Tröder univentionstaff 2020-02-24 17:17:22 CET
Especially, as it is then not possible to fix the user anymore (except by changing it using two existing contexts):

==============================
root@m66:~# udm users/user modify --dn uid=test5,cn=users,dc=uni,dc=dtr --set oxContext=12
Object modified: uid=test5,cn=users,dc=uni,dc=dtr
==============================
2020-02-24 17:15:37 INFO    modify of uid=test5,cn=users,dc=uni,dc=dtr (id: 5e68b6f2-eb6a-1039-9892-396e91e2c316, file: /var/lib/univention-appcenter/listener//ox-connector/2020-02-24-17-15-37-907950.json)
2020-02-24 17:15:41 INFO    conversion of uid=test5,cn=users,dc=uni,dc=dtr (id: 5e68b6f2-eb6a-1039-9892-396e91e2c316, file: /var/lib/univention-appcenter/apps/ox-connector/data/listener/2020-02-24-17-15-37-907950.json)
2020-02-24 17:15:41 INFO    Running trigger
2020-02-24 17:15:43 WARNING Could not find admin password for context 55. Ignoring this task
2020-02-24 17:15:43 INFO    Success! Removing consumed files
Comment 2 Dirk Wiesenthal univentionstaff 2020-02-25 11:14:58 CET
Switched the order when changing context: first create, then delete.
Comment 3 Dirk Wiesenthal univentionstaff 2020-02-25 11:20:36 CET
*** Bug 50822 has been marked as a duplicate of this bug. ***
Comment 4 Daniel Tröder univentionstaff 2020-03-04 17:33:03 CET
OK: order (1st create, 2nd delete) fixed
OK: groups in old context purged if empty
REOPEN: groups in new context not created/updated
Comment 5 Dirk Wiesenthal univentionstaff 2020-03-06 11:48:56 CET
Fixed in the latest version of the image.
Comment 6 Daniel Tröder univentionstaff 2020-03-06 13:00:09 CET
OK: groups in new context are now created/updated