Bug 46846 - gapps group sync doesn't handle computer objects
Summary: gapps group sync doesn't handle computer objects
Status: RESOLVED WONTFIX
Alias: None
Product: UCS
Classification: Unclassified
Component: Google Apps for Work
Version: UCS 4.2
Hardware: Other Linux
: P5 normal
Target Milestone: ---
Assignee: Mail maintainers
QA Contact: Mail maintainers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-18 09:21 CEST by Daniel Tröder
Modified: 2020-07-03 20:52 CEST (History)
1 user (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?: 2: Will only affect a few 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.069
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Customer ID:
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 2018-04-18 09:21:50 CEST
A customer/forum member got this traceback (https://help.univention.com/t/sync-additional-emailaddresses-as-alias/8522/3):

===========================================================================
Traceback (most recent call last):
  File "/usr/lib/univention-directory-listener/system/google-apps-group.py", line 152, in handler
    if "univentionGoogleAppsObjectID" in old or ol.udm_group_has_google_users(dn):
  File "/usr/lib/pymodules/python2.7/univention/googleapps/listener.py", line 542, in udm_group_has_google_users
    udm_user = self.get_udm_user(userdn)
  File "/usr/lib/pymodules/python2.7/univention/googleapps/listener.py", line 423, in get_udm_user
    user = usersmod.object(None, lo, po, userdn)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/users/user.py", line 1450, in __init__
    univention.admin.handlers.simpleLdap.__init__(self, co, lo, position, dn, superordinate, attributes=attributes)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 796, in __init__
    raise univention.admin.uexceptions.noObject(self.dn)
univention.admin.uexceptions.noObject: cn=DESKTOP-N85GVHG,cn=Computers,dc=xxx,dc=xxx
12.04.18 17:01:29.075  LISTENER    ( WARN    ) : handler: google-apps-group (failed)
===========================================================================

The listener module code expected a users/user object, but found a computer object instead. The listeners LDAP filter is '(objectClass=posixGroup)', so that should have been expected.

Fix group listener to ignore computer (or for that matter - any) objects that are not users/user.
Comment 1 Megachip 2018-08-16 13:32:49 CEST
16.08.18 12:33:42.630  LISTENER    ( PROCESS ) : gafw: Modified google account of user 'a.xxx'.
16.08.18 12:33:42.662  LISTENER    ( PROCESS ) : updating 'uid=a.xxx,cn=users,dc=xxx,dc=xxx' command m
16.08.18 12:36:04.693  LISTENER    ( PROCESS ) : updating 'cn=xxx-nb-009,cn=computers,dc=xxx,dc=xxx' command m
16.08.18 12:36:35.661  LISTENER    ( PROCESS ) : updating 'uid=a.xxx,cn=users,dc=xxx,dc=xxx' command m
Traceback (most recent call last):
  File "/usr/lib/univention-directory-listener/system/google-apps-user.py", line 345, in handler
    ol.modify_google_user(old, new)
  File "/usr/lib/pymodules/python2.7/univention/googleapps/listener.py", line 172, in modify_google_user
    self._fix_user_resource(resource)
  File "/usr/lib/pymodules/python2.7/univention/googleapps/listener.py", line 746, in _fix_user_resource
    resource[k] = _multiply_if_has_list(resource[k])
  File "/usr/lib/pymodules/python2.7/univention/googleapps/listener.py", line 721, in _multiply_if_has_list
    raise RuntimeError("Unexpected type {!r} for item {!r} in property {!r}.".format(type(p), p, prop))
RuntimeError: Unexpected type <type 'str'> for item 'xxx@xxx.xxx' in property [].
16.08.18 12:36:35.679  LISTENER    ( WARN    ) : handler: google-apps-user (failed)
16.08.18 12:36:45.266  LISTENER    ( PROCESS ) : updating 'uid=a.xxx,cn=users,dc=xxx,dc=xxx' command m
Comment 2 Daniel Tröder univentionstaff 2018-08-16 14:25:04 CEST
@Megachip: are you sure that was a computer account? The are usually not located below cn=users,$ldap_base.
Comment 3 Megachip 2018-08-16 14:34:20 CEST
(In reply to Daniel Tröder from comment #2)
> @Megachip: are you sure that was a computer account? The are usually not
> located below cn=users,$ldap_base.

No, I think the bug seems to be the format the gapps module submitted:

    raise RuntimeError("Unexpected type {!r} for item {!r} in property {!r}.".format(type(p), p, prop))
RuntimeError: Unexpected type <type 'list'> for item ['xxx@xxx.xxx', 'yyy@xxx.xxx'] in property [].

Not sure, if the maschine exception is related to gapps thing. Possible it just happens to the same time.
Comment 4 Daniel Tröder univentionstaff 2018-08-16 15:15:54 CEST
You error is unrelated to this bug. This bug is about the groups handler. Your bug is about the user handler. But thank you for reporting it anyway.
I have opened a separate bug for the error on your system: Bug #47599.
Comment 5 Ingo Steuwer univentionstaff 2020-07-03 20:52:35 CEST
This issue has been filed against UCS 4.2.

UCS 4.2 is out of maintenance and many UCS components have changed in later releases. Thus, this issue is now being closed.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen it and update the UCS version. In this case please provide detailed information on how this issue is affecting you.