Univention Bugzilla – Bug 56421
App Center listener converter does not log broken files
Last modified: 2023-09-13 16:32:20 CEST
./management/univention-appcenter/scripts/univention-appcenter-listener-converter def find_and_convert_files() tries to parse JSON files. If a file is broken due to a power failure or no available disk space, the converter will try to load it during every run and stop immediately. In addition to logging the traceback, the filename should be logged, so that customers and our support can identify the file quickly. 2023-08-10 12:18:17 ERROR Fatal error: Traceback (most recent call last): File "/usr/share/univention-appcenter-listener-converter", line 205, in main find_and_convert_files(app) File "/usr/share/univention-appcenter-listener-converter", line 166, in find_and_convert_files dumped = json.load(open(filename)) File "/usr/lib/python3.7/json/__init__.py", line 296, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "/usr/lib/python3.7/json/__init__.py", line 348, in loads return _default_decoder.decode(s) File "/usr/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.7/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
A broken JSON file will not crash the `univention-appcenter-listener-converter` anymore. When a broken JSON file is found, it will be skipped, and it get logged inside the appropriate logfile located at the path `/var/log/univention/listener_modules/<app id>.log`. univention-appcenter (9.0.9-1) f19a67d80e52 | Bug #56421: Version bump univention-appcenter (9.0.8-6) 3e8da6641154 | Bug #56421: Add logging for broken JSON files of the univention-appcenter-listener-converter
QA: - advisories: OK - code review: OK - (tested with ox-connector) broken JSON files in /var/lib/univention-appcenter/listener/ox-connector are logged and skipped by univention-appcenter-listener-converter: OK waiting for overnight test results...
<https://errata.software-univention.de/#/?erratum=5.0x804>