Bug 52568 - office365/query, AttributeError: 'NoneType' object has no attribute 'startswith'
office365/query, AttributeError: 'NoneType' object has no attribute 'startswith'
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Office 365
UCS 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: Esteban
Erik Damrose
:
: 54080 (view as bug list)
Depends on:
Blocks: 54642
  Show dependency treegraph
 
Reported: 2021-01-08 13:55 CET by Christian Castens
Modified: 2022-05-12 11:06 CEST (History)
8 users (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?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.229
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2022040521000288, 2020120921000591, 2021021521000489, 2021062021000186, 2021110821000172
Bug group (optional): Error handling, External feedback
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Castens univentionstaff 2021-01-08 13:55:40 CET
Version: 4.4-6 errata814 (Blumenthal)

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

Traceback (most recent call last):
  File "%PY2.7%/univention/management/console/base.py", line 359, in __error_handling
    six.reraise(etype, exc, etraceback)
  File "%PY2.7%/univention/management/console/base.py", line 262, in execute
    function.__func__(self, request, *args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 321, in _response
    result = _multi_response(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 181, in _response
    return function(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 443, in _response
    return list(function(self, iterator, *nones))
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 289, in _fake_func
    yield function(self, *args)
  File "%PY2.7%/univention/management/console/modules/office365/__init__.py", line 91, in query
    'initialized': AzureAuth.is_initialized(self.adconnection_alias),
  File "%PY2.7%/univention/office365/azure_auth.py", line 376, in is_initialized
    tokens = cls.load_tokens(adconnection_alias)
  File "%PY2.7%/univention/office365/azure_auth.py", line 418, in load_tokens
    return JsonStorage(AzureADConnectionHandler.get_conf_path('TOKEN_FILE', adconnection_alias)).read()
  File "%PY2.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'

Role: domaincontroller_backup
Comment 1 Christina Scheinig univentionstaff 2021-03-10 16:54:42 CET
I customer tries to open the AD Connection
univention-app info
UCS: 4.4-7 errata907
Installed: apple-school-manager=2.2.3 office365=3.4 samba4=4.10 ucsschool=4.4 v8

ucr get server/role
domaincontroller_backup

and gets the same traceback:

nterner 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 359, in __error_handling
    six.reraise(etype, exc, etraceback)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/base.py", line 262, 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 92, 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 2 Christina Scheinig univentionstaff 2021-03-10 17:06:14 CET
The configuration of the app is not possible.
Comment 3 Christina Scheinig univentionstaff 2021-03-10 17:12:37 CET
(In reply to Christina Scheinig from comment #2)
> The configuration of the app is not possible.

The app was installed on a backup server before, but this was broken and replaced by this.
With the first installation also office365=3.4 the configuration was still possible.
Comment 4 Christina Scheinig univentionstaff 2021-03-11 09:36:59 CET
After rerunning the joinscript the error still occurs.

The udm module shows the subscription

 udm office365/profile list

DN: office365ProfileName=Default Office 365 Subscription,cn=profiles,cn=office365,dc=example,dc=com
  name: Default Office 365 Subscription
  subscription: ENTERPRISEPACK
Comment 6 Julia Bremer univentionstaff 2021-03-12 09:12:01 CET
Please ignore my previous comment, I misunderstood the problem. 
--------------------------------------------------

The ucr variable office365/adconnection/wizard did not exist. Setting it to 

office365/adconnection/wizard: defaultADconnection

like it is on my test system made it so the wizard could be opened successfully.

Comment 7 Erik Damrose univentionstaff 2021-03-15 12:51:47 CET
How to reproduce this issue? The app joinscript creates the default connection, which sets the UCRv

/usr/share/univention-office365/scripts/manage_adconnections create defaultADconnection --makedefault
Comment 10 Erik Damrose univentionstaff 2021-11-18 18:25:20 CET
*** Bug 54080 has been marked as a duplicate of this bug. ***
Comment 11 Esteban univentionstaff 2021-12-21 07:17:47 CET
Added new checks and messages in case of empty default value for adconnection.
Updated translations.

univention-office365 (2.0.2-161)
21a9f7643ed6 | Bug #52568: changelog
ffd01c46c374 | Bug #52568: Fix for office365/query, AttributeError: 'NoneType' object has no attribute 'startswith'
Comment 12 Erik Damrose univentionstaff 2022-04-05 19:17:46 CEST
Published with UCS 4.4 app version 4.2