Univention Bugzilla – Full Text Bug Listing |
Summary: | AppCenter is unable to load if syntax error in license_types.ini | ||
---|---|---|---|
Product: | UCS | Reporter: | Florian Best <best> |
Component: | UMC - App-Center | Assignee: | Dirk Wiesenthal <wiesenthal> |
Status: | CLOSED FIXED | QA Contact: | Florian Best <best> |
Severity: | normal | ||
Priority: | P5 | CC: | wiesenthal |
Version: | UCS 4.1 | ||
Target Milestone: | UCS 4.1-1-errata | ||
Hardware: | Other | ||
OS: | Linux | ||
See Also: | https://forge.univention.org/bugzilla/show_bug.cgi?id=38633 | ||
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: |
Description
Florian Best
2016-03-10 06:40:58 CET
Using more general ParsingError instead of MissingSectionHeaderError in univention-appcenter 5.0.20-22.133.201603140023 Now these files are ignored (actually they are treated as emtpy). Holds for every ini file (license_types, categories, ratings, but also every App ini). This would result in untranslated categories and so on, but not in tracebacks. Apps are not shown if the ini is malformed (because the Parser is emtpy and ID= is missing). Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/univention/management/console/base.py", line 283, in execute function(self, request) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/decorators.py", line 318, in _response result = _multi_response(self, request) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/decorators.py", line 462, in _response return list(function(self, iterator, *nones)) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/decorators.py", line 284, in _fake_func yield function(self, *args) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/appcenter/__init__.py", line 191, in query return domain.to_dict(apps) File "/usr/lib/pymodules/python2.7/univention/appcenter/actions/domain.py", line 106, in to_dict app_dict = get.to_dict(app) File "/usr/lib/pymodules/python2.7/univention/appcenter/actions/docker_get.py", line 45, in to_dict ret = super(Get, cls).to_dict(app) File "/usr/lib/pymodules/python2.7/univention/appcenter/actions/get.py", line 112, in to_dict ret['is_ucs_component'] = app.is_ucs_component() File "/usr/lib/pymodules/python2.7/univention/appcenter/app.py", line 621, in is_ucs_component self._is_ucs_component = 'UCS Components' in app.categories AttributeError: 'NoneType' object has no attribute 'categories' There is a inconistent behaviour in RawConfigParser. Working around it now. Also include categories.ini to use _read_ini_file. Fixed an error along the lines which I thought was the cause of the traceback. Fixed one more bug that happened when after dev scripts, no license_types.ini were found on the server. ("local app center") license_types: OK, malformed license-types is ignored categories: OK, malformed categories.ini causes the categories not to be translated ratings: OK, malformed ratings.ini causes the ratings to not being displayed App ini: OK, malformed app.ini causes the app to not be present. REOPEN: there is no error message in the logfiles about broken license-types, categories, ratings. Even the app.ini logfile message is really short and only a WARNing. Added app_logger.warn('Could not read %s' % filename) Writing the whole exception string can be a bit irritating. ParsingError has some special formatting. (In reply to Dirk Wiesenthal from comment #6) > Added > app_logger.warn('Could not read %s' % filename) > > Writing the whole exception string can be a bit irritating. ParsingError has > some special formatting. It's not written into /var/log/univention/management-console-module-appcenter.log. The exception details are also important. str(exc) is now logged as debug in appcenter.log. In umc-m-appcenter.log you will find 15.03.16 14:44:18.124 MODULE ( PROCESS ) : Could not read /var/cache/univention-appcenter/....meta The str(exc) is not logged, because logging works via the PackageManager in UMC and it does not support debug, only PROCESS and ERROR. Should be enough in appcenter.log if we need the information. (In reply to Dirk Wiesenthal from comment #8) > str(exc) is now logged as debug in appcenter.log. In umc-m-appcenter.log you > will find > > 15.03.16 14:44:18.124 MODULE ( PROCESS ) : Could not read > /var/cache/univention-appcenter/....meta > > The str(exc) is not logged, because logging works via the PackageManager in > UMC and it does not support debug, only PROCESS and ERROR. Should be enough > in appcenter.log if we need the information. Hm. I'm still somehow unsatisfied: Now "univention-app list" tells me for 4 apps "Could not read /var/cache/univention-appcenter/$APP.meta". Are they supposed to exists or is this an error? Why don't they exists? Logging the exception as DEBUG is not really nice as it is an ERROR! If we need the debug information somewhen they are not present with the default debug level. IOError, OSError are ignored (because the reason is probably a missing file, which may happen for .meta files (which is no real problem of the App Center, but the App Center catalogue). ParsingError is logged as warning with complete str(exc) OK: Fix OK: YAML |