Bug 57094 - MS365: Failure when a licensed to be assigned via group membership is not available in Azure
Summary: MS365: Failure when a licensed to be assigned via group membership is not ava...
Status: NEW
Alias: None
Product: UCS
Classification: Unclassified
Component: Office 365
Version: UCS 5.0
Hardware: Other Linux
: P5 normal
Target Milestone: ---
Assignee: Mail maintainers
QA Contact: Mail maintainers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-28 12:07 CET by Erik Damrose
Modified: 2024-02-28 12:08 CET (History)
0 users

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 1: Will affect a very 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.046
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2024022721000219
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 Erik Damrose univentionstaff 2024-02-28 12:07:17 CET
Licenses for the MS365 connector can be assigned by group membership. The group needs an assigned udm office365/profile object.
If the office365/profile refers to a license name that is not available in azure, no license is assigned and a traceback appears in the listener.log:

The traceback is from the MS365 connector version 4.7 on UCS 4.4, but the code is also present in UCS 5.

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/univention/listener/api_adapter.py", line 166, in _handler
    self._module_handler.create(dn, new)
  File "/usr/lib/univention-directory-listener/system/office365-user.py", line 75, in create
    self.connector.create(udm_object=udm_user)
  File "/usr/lib/python2.7/dist-packages/univention/office365/connector/connector.py", line 519, in create
    self.new_or_reactivate_user(udm_object)
  File "/usr/lib/python2.7/dist-packages/univention/office365/connector/connector.py", line 479, in new_or_reactivate_user
    self._assign_subscription(udm_user=udm_object, azure_user=user_azure)
  File "/usr/lib/python2.7/dist-packages/univention/office365/connector/connector.py", line 456, in _assign_subscription
    deactivate_plan_ids = selected_subs_sku.get_plans_id_from_names(deactivate_plans)
AttributeError: 'NoneType' object has no attribute 'get_plans_id_from_names'

Updating the office365/profile objects to only contain valid licenses fixes the issue. https://help.univention.com/t/22699

We should catch the error and log a helpful message for the administrator.