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

Handle broken job log nicely #1332

Open
JabLuszko opened this issue Mar 27, 2023 · 0 comments
Open

Handle broken job log nicely #1332

JabLuszko opened this issue Mar 27, 2023 · 0 comments

Comments

@JabLuszko
Copy link
Contributor

Traceback (most recent call last):
> File "/home/ubuntu/MAD/start.py", line 262, in <module>
    asyncio.run(start(), debug=True)
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
    return future.result()
  File "/home/ubuntu/MAD/start.py", line 150, in start
    await device_updater.start_updater()
  File "/home/ubuntu/MAD/mapadroid/updater/updater.py", line 83, in start_updater
    await self._load_log()
  File "/home/ubuntu/MAD/mapadroid/updater/updater.py", line 68, in _load_log
    issued_job: GlobalJobLogEntry = self._global_job_log_entry_schema.load(issued_job_raw)
  File "/home/ubuntu/mad_env/lib/python3.9/site-packages/marshmallow_dataclass/__init__.py", line 752, in load
    all_loaded = super().load(data, many=many, **kwargs)
  File "/home/ubuntu/mad_env/lib/python3.9/site-packages/marshmallow/schema.py", line 722, in load
    return self._do_load(
  File "/home/ubuntu/mad_env/lib/python3.9/site-packages/marshmallow/schema.py", line 909, in _do_load
    raise exc
marshmallow.exceptions.ValidationError: {'auto_command_settings': {'start_with_init': ['Missing data for required field.'], 'redo_on_error': ['Missing data for required field.'], 'redo': ['Missing data for required field.'], 'algo_value': ['Missing data for required field.'], 'origins': ['Missing data for required field.'], 'job': ['Missing data for required field.']}} 

Catch this marshmallow.exceptions.ValidationError nicely, remove file, re-load empty file(?), show warning, start MAD normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant