Bug 56421 - App Center listener converter does not log broken files
App Center listener converter does not log broken files
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: App Center
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-5-errata
Assigned To: Mika Westphal
Christian Castens
https://git.knut.univention.de/univen...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2023-08-11 12:28 CEST by Erik Damrose
Modified: 2023-09-13 16:32 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.143
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2023081021000198
Bug group (optional): bitesize
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Damrose univentionstaff 2023-08-11 12:28:08 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)
Comment 2 Mika Westphal univentionstaff 2023-09-08 14:32:55 CEST
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
Comment 3 Christian Castens univentionstaff 2023-09-08 14:36:13 CEST
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...