Bug 54642 - [o365] UMC wizard does not open when UCR office365/adconnection/wizard has invalid values
[o365] UMC wizard does not open when UCR office365/adconnection/wizard has in...
Status: REOPENED
Product: UCS
Classification: Unclassified
Component: Office 365
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: Julia Bremer
Erik Damrose
:
Depends on: 52568
Blocks:
  Show dependency treegraph
 
Reported: 2022-04-05 18:12 CEST by Erik Damrose
Modified: 2022-06-27 17:22 CEST (History)
1 user (show)

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?: 5: Blocking further progress on the daily work
User Pain: 0.114
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Error handling, Regression, Usability, Workaround is available
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 2022-04-05 18:12:16 CEST
If UCR office365/adconnection/wizard is set to an invalid id, the following traceback is logged and the UMC wizard is closed without an error popup. I tried opening the module while using the portal.

05.04.22 17:25:20.283  MAIN        ( ERROR   ) : Interner Server-Fehler in "office365/query".
Request: office365/query

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 344, in __error_handling
    six.reraise(etype, exc, etraceback)
  File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 247, in execute
    function.__func__(self, request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 321, in _response
    result = _multi_response(self, request)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 181, in _response
    return function(self, request)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 443, in _response
    return list(function(self, iterator, *nones))
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 289, in _fake_func
    yield function(self, *args)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/office365/__init__.py", line 92, in query
    'initialized': AzureAuth.is_initialized(self.adconnection_alias),
  File "/usr/lib/python3/dist-packages/univention/office365/azure_auth.py", line 410, in is_initialized
    tokens = cls.load_tokens(adconnection_alias)
  File "/usr/lib/python3/dist-packages/univention/office365/azure_auth.py", line 452, in load_tokens
    return JsonStorage(AzureADConnectionHandler.get_conf_path('TOKEN_FILE', adconnection_alias)).read()
  File "/usr/lib/python3/dist-packages/univention/office365/azure_auth.py", line 357, in read
    with open(self.filename, "r") as fd:
TypeError: expected str, bytes or os.PathLike object, not NoneType


If UCR office365/adconnection/wizard is unset, an error is logged, as it was implemented at the original bug 52568, but the error is not shown in UMC, and the module is closed.

05.04.22 17:32:07.331  MAIN        ( ERROR   ) : Interner Server-Fehler in "office365/query".
Request: office365/query

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 344, in __error_handling
    six.reraise(etype, exc, etraceback)
  File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 247, in execute
    function.__func__(self, request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 321, in _response
    result = _multi_response(self, request)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 181, in _response
    return function(self, request)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 443, in _response
    return list(function(self, iterator, *nones))
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 289, in _fake_func
    yield function(self, *args)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/office365/__init__.py", line 92, in query
    'initialized': AzureAuth.is_initialized(self.adconnection_alias),
  File "/usr/lib/python3/dist-packages/univention/office365/azure_auth.py", line 410, in is_initialized
    tokens = cls.load_tokens(adconnection_alias)
  File "/usr/lib/python3/dist-packages/univention/office365/azure_auth.py", line 452, in load_tokens
    return JsonStorage(AzureADConnectionHandler.get_conf_path('TOKEN_FILE', adconnection_alias)).read()
  File "/usr/lib/python3/dist-packages/univention/office365/azure_auth.py", line 114, in get_conf_path
    raise ValueError(_('No AD connection alias specified\n') + extra_info)
ValueError: Kein AD-Verbindungsalias angegeben
Der Grund dafür könnte sein, dass die Univention Configuration Registry Variable office365/adconnection/wizard nicht gesetzt ist.
Wenn nicht, können Sie den Standardwert setzen "defaultADconnection"
Zu prüfender Befehl: ucr get office365/adconnection/wizard
Befehl zum Setzen: "ucr set office365/adconnection/wizard=defaultADconnection"
Comment 1 Julia Bremer univentionstaff 2022-06-27 16:59:21 CEST
Not reproducible in v4.3 (UCS4) and 5.1 (UCS5) of the microsoft 365 connector any more.
Comment 2 Erik Damrose univentionstaff 2022-06-27 17:22:58 CEST
I can still reproduce the issue. The error gets logged to /v/l/u/management-console-web-server.log

With the new app versions the following traceback gets logged:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 344, in __error_handling
    six.reraise(etype, exc, etraceback)
  File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 247, in execute
    function.__func__(self, request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 321, in _response
    result = _multi_response(self, request)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 181, in _response
    return function(self, request)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 443, in _response
    return list(function(self, iterator, *nones))
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 289, in _fake_func
    yield function(self, *args)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/office365/__init__.py", line 95, in query
    account = AzureAccount(self.adconnection_alias)
  File "/usr/lib/python3/dist-packages/univention/office365/microsoft/account.py", line 93, in __init__
    logger.error("get_conf_path called with None in alias argument")
AttributeError: 'NoneType' object has no attribute 'error'