Bug 44607 - 'NoneType' object has no attribute 'categories'
'NoneType' object has no attribute 'categories'
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Setup wizard
UCS 4.2
Other Linux
: P5 normal (vote)
: UCS 4.2-2-errata
Assigned To: Dirk Wiesenthal
Eduard Mai
:
: 45434 (view as bug list)
Depends on:
Blocks: 45796
  Show dependency treegraph
 
Reported: 2017-05-16 13:13 CEST by Florian Best
Modified: 2017-11-29 13:41 CET (History)
3 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?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.206
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Ticket number: 2017102721000271, 2017103021000658, 2017101821000449, 2017091821000344, 2017100721000335, 2017051321000628, 2017070621000432, 2017072421000551, 2017092121000918
Bug group (optional): 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 2017-05-16 13:13:28 CEST
Die Ausführung des Kommandos setup/apps/query wizard ist fehlgeschlagen:

Traceback (most recent call last):
  File "%PY2.7%/univention/management/console/base.py", line 249, in execute
    function.__func__(self, request, *args, **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 192, in _response
    return function(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 440, in _response
    return list(function(self, iterator, *nones))
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 286, in _fake_func
    yield function(self, *args)
  File "%PY2.7%/univention/management/console/modules/setup/__init__.py", line 724, in apps_query
    return util.get_apps(True)
  File "%PY2.7%/univention/management/console/modules/setup/util.py", line 771, in get_apps
    return [get.to_dict(app) for app in Apps().get_all_apps() if app.is_ucs_component()]
  File "%PY2.7%/univention/appcenter/app.py", line 1050, in is_ucs_component
    return 'UCS components' in app.categories
AttributeError: 'NoneType' object has no attribute 'categories'

Version: 4.2-0 errata0 (Lesum)
Comment 1 Florian Best univentionstaff 2017-05-16 13:13:56 CEST
Maybe this was UCS 4.2 RC?
Comment 2 Florian Best univentionstaff 2017-07-07 16:40:54 CEST
Reported again, 4.2-0 errata0 (Lesum)
Comment 3 Florian Best univentionstaff 2017-07-26 15:13:51 CEST
Version: 4.2-1 errata99 (Lesum)

Traceback (most recent call last):
  File "%PY2.7%/univention/management/console/base.py", line 249, in execute
    function.__func__(self, request, *args, **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 192, in _response
    return function(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 440, in _response
    return list(function(self, iterator, *nones))
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 286, in _fake_func
    yield function(self, *args)
  File "%PY2.7%/univention/management/console/modules/appcenter/__init__.py", line 198, in query
    info = domain.to_dict(apps)
  File "%PY2.7%/univention/appcenter/actions/domain.py", line 109, in to_dict
    app_dict = get.to_dict(app)
  File "%PY2.7%/univention/appcenter/actions/get.py", line 115, in to_dict
    ret['is_ucs_component'] = app.is_ucs_component()
  File "%PY2.7%/univention/appcenter/app.py", line 1080, in is_ucs_component
    return 'UCS components' in app.categories
AttributeError: 'NoneType' object has no attribute 'categories'
Comment 4 Dirk Wiesenthal univentionstaff 2017-09-21 21:08:31 CEST
The traceback can only occur when .apps.de.json and .apps.en.json differ (more than regarding the obvious localized texts that is...) and the German cache has a new App that the English one does not.
Comment 5 Dirk Wiesenthal univentionstaff 2017-09-21 21:09:03 CEST
*** Bug 45434 has been marked as a duplicate of this bug. ***
Comment 6 Dirk Wiesenthal univentionstaff 2017-09-25 12:36:33 CEST
Fixed in
  univention-appcenter 6.0.10-8A~4.2.0.201709251234

I now do a touch on the downloaded .all.tar once it was extracted. The cache now checks the mtime of this archive instead of the actual json cache file.
Comment 7 Dirk Wiesenthal univentionstaff 2017-09-25 13:40:40 CEST
My theory is that the cache is *building* while the all.tar archive is unpacking (that means that the cache will be outdated because it does not yet have all the new ini files available). The cache finished reading the ini files after the archive is finished unpacking and then saves its already outdated cache in a cache file.

If this happens while a new App is added, this traceback occurs.
Comment 8 Felix Botner univentionstaff 2017-09-25 18:32:52 CEST
OK - update, and the appcenter in general seems to work
OK - jenkins tests
OK - YAML
Comment 9 Stefan Gohmann univentionstaff 2017-09-27 06:43:58 CEST
Several updater and app center tests fail in Jenkins since a few days:

http://jenkins.knut.univention.de:8080/job/UCS-4.2/job/UCS-4.2-2/job/AutotestJoin/SambaVersion=s3,Systemrolle=member/27/testReport/

 20_appcenter.75_umc_query_app_data.test
 09_updater.22minor.test
 09_updater.23major.test
 09_updater.27updateto.test
 09_updater.28errors.test
 09_updater.37version-max.test
 09_updater.49component-version-current-dep.test
 20_appcenter.100_settings.test

I see the following traceback in updater.log so I guess these changes are relevant:

2017-09-26 19:43:54,415 DEBUG:univention.appcenter.actions.upgrade-search.progress:100
Cannot load cache: mtimes of cache files do not match: 1506467606.2867403 != None
2017-09-26 19:43:54,416 DEBUG:univention.appcenter.cache:Cannot load cache: mtimes of cache files do not match: 1506467606.2867403 != None
Traceback in univention-upgrade:
Traceback (most recent call last):
  File "/usr/sbin/univention-upgrade", line 434, in do_update
    update_available = performUpdate(options, checkForUpdates=options.check, silent=False)
  File "/usr/sbin/univention-upgrade", line 138, in performUpdate
    if func(options, checkForUpdates, silent):
  File "/usr/sbin/univention-upgrade", line 270, in do_app_updates
    new_apps = list(app_upgrade.iter_upgradable_apps())
  File "/usr/lib/pymodules/python2.7/univention/appcenter/actions/upgrade.py", line 104, in iter_upgradable_apps
    for app in Apps().get_all_locally_installed_apps():
  File "/usr/lib/pymodules/python2.7/univention/appcenter/app_cache.py", line 77, in get_all_locally_installed_apps
    for app in self.get_every_single_app():
  File "/usr/lib/pymodules/python2.7/univention/appcenter/app_cache.py", line 490, in get_every_single_app
    for app in app_cache.get_every_single_app():
  File "/usr/lib/pymodules/python2.7/univention/appcenter/app_cache.py", line 447, in get_every_single_app
    ret.extend(app_cache.get_every_single_app())
  File "/usr/lib/pymodules/python2.7/univention/appcenter/app_cache.py", line 333, in get_every_single_app
    if self._save_cache():
  File "/usr/lib/pymodules/python2.7/univention/appcenter/app_cache.py", line 213, in _save_cache
    os.utime(cache_file, (archive_modified, archive_modified))
TypeError: an integer is required
Comment 10 Dirk Wiesenthal univentionstaff 2017-09-27 14:17:30 CEST
Yes, fixed in
  univention-appcenter 6.0.10-12A~4.2.0.201709271345

From what I understand, this actually might have been a problem with this change in combination with the also new support for 4.3-Apps during the upgrade to 4.3. See Bug#45429.
Comment 11 Eduard Mai univentionstaff 2017-10-04 18:43:16 CEST
Advisory - OK
Code and functionality - OK
The regression shown in comment #9 is addressed with commit b83206118345f6363a4e2a0c88b020eddcc2a82e. Cases where where the modification time is not existent are now handled correctly.
Comment 12 Florian Best univentionstaff 2017-10-12 20:14:35 CEST
Version: 4.2-1 errata118 (Lesum)
Comment 13 Florian Best univentionstaff 2017-10-12 21:28:55 CEST
Version: 4.2-2 errata52 (Lesum)
Comment 14 Arvid Requate univentionstaff 2017-10-18 12:02:45 CEST
<http://errata.software-univention.de/ucs/4.2/199.html>