Flight Review file corrupt Flight core V2

Not sure if this is the correct section to post this, but on the ModalAI flight core V2 we are getting the following logging issue

image

PX4 firmware: 1.13.3
we have tried 2 sd cards
have tried reformatting
not seeing the same thing happen on holybro

cross posted on ModalAI forum: Flight Review Error | ModalAI Forum

Plot Juggler seems to be fine with it

Spun up Flight review locally

This is the output when it fails on this file

Traceback (most recent call last):
  File "/home/atlas/flight_review/app/plot_app/helper.py", line 317, in load_ulog_file
    ulog = ULog(file_name, msg_filter, disable_str_exceptions=False)
  File "/home/atlas/flight_review/app/env/lib/python3.8/site-packages/pyulog/core.py", line 138, in __init__
    self._load_file(log_file, message_name_filter_list)
  File "/home/atlas/flight_review/app/env/lib/python3.8/site-packages/pyulog/core.py", line 825, in _load_file
    self._read_file_definitions()
  File "/home/atlas/flight_review/app/env/lib/python3.8/site-packages/pyulog/core.py", line 866, in _read_file_definitions
    msg_info = self._MessageInfo(data, header)
  File "/home/atlas/flight_review/app/env/lib/python3.8/site-packages/pyulog/core.py", line 564, in __init__
    self.value = ULog.parse_string(data[1+key_len:])
  File "/home/atlas/flight_review/app/env/lib/python3.8/site-packages/pyulog/core.py", line 93, in parse_string
    ret = _parse_string(cstr)
  File "/home/atlas/flight_review/app/env/lib/python3.8/site-packages/pyulog/core.py", line 19, in _parse_string
    return str(cstr, 'utf-8', errors)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 5: invalid start byte
400 POST /upload (::1): Failed to parse the file. It is most likely corrupt.
400 POST /upload (::1) 9.37ms

1 Like

Okay, it seems to be here

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 5: invalid start byte

Unsure why position 5 is giving me an error
I do not see an 0xff in position 5

image

the log file on the right works, the one on the left does not

You could perhaps print the hex version of the string that it is trying to decode? The ‘position 5’ likely doesn’t mean the absolute position of the byte in the whole ulog file, but rather that specific string :thinking:

I got this again from a log file generated from a holybro pixhawk 6c.

so, locally, I can disable string exceptions in helper.py of Flight Review line 317, and this will not throw the error, and allow me to view the file

I still have not drilled down what is the core of the problem…or what it is TRYING to read

It looks like the console output had some crazy text that caused the string parser to shit the bed

It means the log file is corrupt, either the FC writes invalid data, or it happened in the process of retrieving the log. Did you get the log directly from the SD card or downloaded via QGC?
It could be that there’s actually a problem with the ModalAI flight core V2.
How often do you get the problem?

1 Like

Yes, it turned out there was a printf in the firmware change that we had made (for the holybro). I am wondering if there is something similar going on for a flight core v2 module…possibly the uart esc?

Anyways, it happened about 50% of the time. I now know how to debug these in my own local version of flight review. so i will debug and post here the next time it happens