sysdiagnose icon indicating copy to clipboard operation
sysdiagnose copied to clipboard

[bug] Crash in logarchive parser

Open Te-k opened this issue 1 year ago • 2 comments

Hi, I have this crash when analysing a sysdiagnose either with ps_everywhere or with logarchive parser:

  File "/home/etienne/tools/forensic/sysdiagnose/src/sysdiagnose/parsers/logarchive.py", line 76, in get_result
    self.save_result()
    ~~~~~~~~~~~~~~~~^^
  File "/home/etienne/tools/forensic/sysdiagnose/src/sysdiagnose/parsers/logarchive.py", line 99, in save_result
    LogarchiveParser.parse_all_to_file(self.get_log_files(), self.output_file)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/etienne/tools/forensic/sysdiagnose/src/sysdiagnose/parsers/logarchive.py", line 167, in parse_all_to_file
    LogarchiveParser.parse_folder_to_file(folders[0], output_file)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/etienne/tools/forensic/sysdiagnose/src/sysdiagnose/parsers/logarchive.py", line 200, in parse_folder_to_file
    LogarchiveParser.__convert_using_unifiedlogparser(input_folder, output_file)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/etienne/tools/forensic/sysdiagnose/src/sysdiagnose/parsers/logarchive.py", line 251, in __convert_using_unifiedlogparser
    entry_json = LogarchiveParser.convert_entry_to_unifiedlog_format(json.loads(line))
  File "/home/etienne/tools/forensic/sysdiagnose/src/sysdiagnose/parsers/logarchive.py", line 346, in convert_entry_to_unifiedlog_format
    for key, value in entry.items():
                      ^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'items'

I am using the latest version from git (5156d80f488555b9698b7d59504c72385360fe46) on python 3.13.0

Te-k avatar Nov 30 '24 01:11 Te-k

Is this on a linux or mac system?

cvandeplas avatar Dec 05 '24 15:12 cvandeplas

@Te-k I'm happy to support and solve the issue you have, but would need a tiny bit more info. Disregard my previous question, considering the folder /home it is Linux.

Would you be able to run the code in a debugger and share the content of entry?

Thanks

cvandeplas avatar Dec 17 '24 12:12 cvandeplas