bluerobotics / BlueOS

The open source platform for ROV, USV, robotic system operation, development, and expansion.
https://blueos.cloud/docs/
Other
168 stars 80 forks source link

Bootstrap doesnt handle JSON decode errors when reading the startup file #1377

Closed Williangalvani closed 1 year ago

Williangalvani commented 1 year ago
Traceback (most recent call last):
  File "/main.py", line 22, in <module>
    bootstrapper.run()
  File "/bootstrap/bootstrap.py", line 236, in run
    for image in self.read_config_file():
  File "/bootstrap/bootstrap.py", line 62, in read_config_file
    config = json.load(config_file)
  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)

Reported by @NickNothom

Williangalvani commented 1 year ago

maybe we should have a broad except in here after all https://github.com/bluerobotics/BlueOS-docker/blob/master/bootstrap/bootstrap/bootstrap.py#L68

Williangalvani commented 1 year ago

fixed by #1459