Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Crash in logarchive parser #126

Open
Te-k opened this issue Nov 30, 2024 · 2 comments
Open

[bug] Crash in logarchive parser #126

Te-k opened this issue Nov 30, 2024 · 2 comments
Assignees
Labels
bug Something isn't working parsers question Further information is requested

Comments

@Te-k
Copy link

Te-k commented Nov 30, 2024

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 (5156d80) on python 3.13.0

@cvandeplas
Copy link
Contributor

Is this on a linux or mac system?

@cvandeplas cvandeplas self-assigned this Dec 5, 2024
@cvandeplas
Copy link
Contributor

@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 cvandeplas added bug Something isn't working question Further information is requested parsers labels Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working parsers question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants