Bug 50671 - O365: UDM modules not yet available in join script during installation - Traceback while trying to open O365 Assistant
O365: UDM modules not yet available in join script during installation - Trac...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Office 365
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4-7-errata
Assigned To: Felix Botner
Julia Bremer
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-12-23 08:17 CET by Ingo Steuwer
Modified: 2021-01-11 12:51 CET (History)
8 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 6: Setup Problem: Issue for the setup process
Who will be affected by this bug?: 3: Will affect average number of 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.206
Enterprise Customer affected?: Yes
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2020090321000581,2020011021001062,2020032021000201,2020062921000555, 2020030221000182, 2020050921000166, 2020050921000175, 2020051021000109, 2020051221000909
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 Ingo Steuwer univentionstaff 2019-12-23 08:17:19 CET
UCS 4.4-3 Errata 413

Steps:
- configured new UCS DC Master from UCs 4.4-3 image
- installed O365 connector 
- clicked on "open" on the O365 Connector page in the App Center

Traceback:


Interner Server-Fehler in "office365/query".
Request: office365/query

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/univention/management/console/base.py", line 358, in __error_handling
    six.reraise(etype, exc, etraceback)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/base.py", line 261, in execute
    function.__func__(self, request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 321, in _response
    result = _multi_response(self, request)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 181, in _response
    return function(self, request)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 443, in _response
    return list(function(self, iterator, *nones))
  File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 289, in _fake_func
    yield function(self, *args)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/office365/__init__.py", line 91, in query
    'initialized': AzureAuth.is_initialized(self.adconnection_alias),
  File "/usr/lib/pymodules/python2.7/univention/office365/azure_auth.py", line 376, in is_initialized
    tokens = cls.load_tokens(adconnection_alias)
  File "/usr/lib/pymodules/python2.7/univention/office365/azure_auth.py", line 418, in load_tokens
    return JsonStorage(AzureADConnectionHandler.get_conf_path('TOKEN_FILE', adconnection_alias)).read()
  File "/usr/lib/pymodules/python2.7/univention/office365/azure_auth.py", line 98, in get_conf_path
    conf_dir = os.path.join(ADCONNECTION_CONF_BASEPATH, adconnection_alias)
  File "/usr/lib/python2.7/posixpath.py", line 68, in join
    if b.startswith('/'):
AttributeError: 'NoneType' object has no attribute 'startswith'
Comment 1 Ingo Steuwer univentionstaff 2019-12-23 08:33:29 CET
The reason is a timing issue:

The O365 join script running during installation fails, from join.log:

----
Terminating running univention-cli-server processes.
Object exists: cn=office365,dc=univention-gmbh,dc=intranet
Object exists: cn=profiles,cn=office365,dc=univention-gmbh,dc=intranet
Object exists: cn=ad-connections,cn=office365,dc=univention-gmbh,dc=intranet
unknown module office365/profile.

Available Modules are:
  appcenter/app
  computers/computer
  computers/domaincontroller_backup
  computers/domaincontroller_master
  computers/domaincontroller_slave
[..]
----

The join script is marked as not executed. Calling "univention-run-joinscripts" later is successfull and afterwards the UMC module of the O365 App starts.
Comment 2 Christian Castens univentionstaff 2020-03-12 11:13:17 CET
reported again: Version: 4.4-3 errata413 (Blumenthal)
Ticket#2020011021001062
Remark: Internal server error during "office365/query".
Comment 4 Christian Castens univentionstaff 2020-08-10 09:54:45 CEST
Reported again:

Version: 4.4-3 errata455 (Blumenthal)

Traceback(28b9fbe8e815358326c62adc5102f772):
Interner Server-Fehler in "office365/query".
Request: office365/query
Role: domaincontroller_master
Comment 5 Christian Castens univentionstaff 2020-08-10 09:55:38 CEST
Reported again

Version: 4.4-4 errata589 (Blumenthal)

Traceback(28b9fbe8e815358326c62adc5102f772):
Internal server error during "office365/query".
Request: office365/query

Role: domaincontroller_master
Comment 6 Christian Castens univentionstaff 2020-08-10 09:56:26 CEST
Reported again

Version: 4.4-4 errata589 (Blumenthal)

Traceback(28b9fbe8e815358326c62adc5102f772):
Internal server error during "office365/query".
Request: office365/query

Role: domaincontroller_master
Comment 7 Christian Castens univentionstaff 2020-08-10 09:57:08 CEST
Reported again

Version: 4.4-4 errata589 (Blumenthal)

Traceback(28b9fbe8e815358326c62adc5102f772):
Internal server error during "office365/query".
Request: office365/query

Role: domaincontroller_master
Comment 8 Christian Castens univentionstaff 2020-08-10 09:58:01 CEST
Reported again

Version: 4.4-4 errata589 (Blumenthal)

Traceback(28b9fbe8e815358326c62adc5102f772):
Interner Server-Fehler in "office365/query".
Request: office365/query

Role: domaincontroller_master
Comment 9 Riya Bhattacharjee univentionstaff 2020-09-08 14:01:10 CEST
Ticket#2020090321000581 — [UMC-Feedback] Traceback

Bitte nehmen Sie sich einen Augenblick Zeit, um die folgenden
Informationen bereitzustellen:

1) Schritte, um den Fehler zu reproduzieren
2) erwartetes Ergebnis
3) beobachtetes Ergebnis

----------
UCS Version: 4.4-5 errata652 (Blumenthal)

Interner Server-Fehler in "office365/query".
AttributeError: 'NoneType' object has no attribute 'startswith'
if b.startswith('/'):
File "/usr/lib/python2.7/posixpath.py", line 68, in join
conf_dir = os.path.join(ADCONNECTION_CONF_BASEPATH, adconnection_alias)
File "/usr/lib/pymodules/python2.7/univention/office365/azure_auth.py",
line 98, in get_conf_path
return JsonStorage(AzureADConnectionHandler.get_conf_path('TOKEN_FILE',
adconnection_alias)).read()
File "/usr/lib/pymodules/python2.7/univention/office365/azure_auth.py",
line 418, in load_tokens
tokens = cls.load_tokens(adconnection_alias)
File "/usr/lib/pymodules/python2.7/univention/office365/azure_auth.py",
line 376, in is_initialized
'initialized': AzureAuth.is_initialized(self.adconnection_alias),
File
"/usr/lib/pymodules/python2.7/univention/management/console/modules/office365/__init__.py",
line 91, in query
yield function(self, *args)
File
"/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py",
line 289, in _fake_func
return list(function(self, iterator, *nones))
File
"/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py",
line 443, in _response
return function(self, request)
File
"/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py",
line 181, in _response
result = _multi_response(self, request)
File
"/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py",
line 321, in _response
function.__func__(self, request, *args, **kwargs)
File
"/usr/lib/python2.7/dist-packages/univention/management/console/base.py",
line 262, in execute
six.reraise(etype, exc, etraceback)
File
"/usr/lib/python2.7/dist-packages/univention/management/console/base.py",
line 359, in __error_handling
Traceback (most recent call last):

Request: office365/query
Interner Server-Fehler in "office365/query".

--
Comment 10 Julia Bremer univentionstaff 2020-12-08 10:20:28 CET
I had this problem ~3 times in one day while trying to test the wizard
Comment 11 Max Pohle univentionstaff 2020-12-14 14:06:01 CET
I can confirm this bug and even after a reboot it is not possible to open the app.  

A known hotfix is to run `univention-run-join-scripts`
Comment 12 Julia Bremer univentionstaff 2020-12-14 17:31:41 CET
When this happened to me, I noticed that 
`udm office365/profile list` did not work, the module was not found.

But
`/usr/lib/python2.7/dist-packages/univention/admincli/admin.py office365/profile list` found the module without showing any error.
Executing  "kill -9" on the running univention-cli-server process resolved this.
Comment 13 Erik Damrose univentionstaff 2020-12-14 17:39:10 CET
We think that the module is installed correctly, but the ucs_registerLDAPExtension call fails to terminate the univention-cli-server
Comment 14 Julia Bremer univentionstaff 2020-12-14 17:43:10 CET
(In reply to Erik Damrose from comment #13)
> We think that the module is installed correctly, but the
> ucs_registerLDAPExtension call fails to terminate the univention-cli-server

Yeah, that's what I thought too.
Comment 15 Felix Botner univentionstaff 2020-12-15 14:28:10 CET
Added 

 pidof -x univention-cli-server && stop_udm_cli_server

to the join script (40univention-office365.inst) just before the udm calls.

9553acb4ab1d34253bc47bd243dfd6f447e3ea30 - univention-office365

Successful build
Package: univention-office365
Version: 2.0.2-92A~4.4.0.202012151414
Branch: ucs_4.4-0
Scope: office365
Comment 16 Julia Bremer univentionstaff 2021-01-04 09:56:06 CET
Couldn't reproduce issue with the added workaround: OK
When reproducing the error, module office365/profile is not found by udm,
after executing 
'''
. /usr/share/univention-lib/all.sh
pidof -x univention-cli-server && stop_udm_cli_server
''' 
the module is found again.
Build: OK

Verified
Comment 17 Erik Damrose univentionstaff 2021-01-11 12:51:46 CET
Released with App Version Univention Microsoft 365 Connector v3.3