Bug 39417 - appcenter/query: 'NoneType' object has no attribute 'id'
appcenter/query: 'NoneType' object has no attribute 'id'
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - App-Center
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.1
Assigned To: Dirk Wiesenthal
Stefan Gohmann
: interim-2
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-28 10:03 CEST by Florian Best
Modified: 2015-11-17 12:12 CET (History)
1 user (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
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 Florian Best univentionstaff 2015-09-28 10:03:56 CEST
Die Ausführung des Kommandos appcenter/query ist fehlgeschlagen:

Traceback (most recent call last):
  File "%PY2.7%/univention/management/console/base.py", line 301, in execute
    function(self, request)
  File "%PY2.7%/univention/management/console/modules/appcenter/__init__.py", line 103, in _decorated
    return func(self, request, *a, **kwargs)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 318, in _response
    result = _multi_response(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 462, in _response
    return list(function(self, iterator, *nones))
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 284, in _fake_func
    yield function(self, *args)
  File "%PY2.7%/univention/management/console/modules/appcenter/__init__.py", line 177, in query
    props = application.to_dict(self.package_manager, domainwide_managed, hosts)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 648, in wrapper
    return func(*args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/appcenter/app_center.py", line 969, in to_dict
    res['config'] = configure.list_config(self.to_app())
  File "%PY2.7%/univention/appcenter/actions/configure.py", line 104, in list_config
    cls.debug('Finding all configuration options for %s' % app.id)
AttributeError: 'NoneType' object has no attribute 'id'


Remark:
Auf einem UCS 4.1 "einfach" das AppCenter aufgerufen

Version:
4.1-0 errata0 (Vahr)
Comment 1 Dirk Wiesenthal univentionstaff 2015-09-28 10:12:52 CEST
This is due to a context switch between the old legacy Application class from the UMC module and the new App class from the App Center lib.

The frontend should use the new App class wherever possible. The old class may be used in sensitive areas where it is well tested.

More specifically, the problem here was that the ini file was flawed. The old class accepted it anyway, using some default values, the new class refused to get initialized. Hence the NoneType error.
Comment 2 Dirk Wiesenthal univentionstaff 2015-10-16 11:40:40 CEST
I have cut the old Application class where possible and used the new App class. The installation routine still uses the old class because I do not want to introduce instability in such a critical part of the App Center.

The initial traceback should be gone.

univention-management-console-module-appcenter 5.0.6-23.470.201510160126
Comment 3 Stefan Gohmann univentionstaff 2015-10-27 12:19:41 CET
I wasn't able to reproduce it.
Comment 4 Stefan Gohmann univentionstaff 2015-11-17 12:12:41 CET
UCS 4.1 has been released:
 https://docs.software-univention.de/release-notes-4.1-0-en.html
 https://docs.software-univention.de/release-notes-4.1-0-de.html

If this error occurs again, please use "Clone This Bug".