You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**IMPORTANT: Please apply the relevant labels, for example if this issue is needed as a backported fix add the label LTS fix (Long term support fix)
Issue Description
If an error occurs in a custom post analysis hook, the traceback from the post analysis hook is not exposed in NRMC (presumably due to the way the Oasis API works but not sure). The MDK shows it but the logs in NRMC only show the final log message without the traceback.
Steps to Reproduce (Bugs only)
Raise an exception in the post analysis run method.
Run an analysis via the API.
See that the traceback is not included in any logs.
Version / Environment information
oasislmf 2.3.10
Oasis Platform 2.3.10
Example data / logs
run_traceback.log - no error shown
...
COMPLETED: oasislmf.computation.generate.losses.run in 6.67s
RUNNING: oasislmf.computation.hooks.post_analysis.run
Store file: /var/log/oasis/tasks/analysis_1_5aeb6b5f-7552-4c5d-8e10-4d476e2851c8.log -> /shared-fs/287717fb68e243288cc78470305f66dd.log
oasislmf model run - stacktrace is visible
...
2024-12-04 10:45:36,256 [INFO] oasislmf.computation.base losses@771:run [2705397] Losses generated in .../test_constant_damage_ratio0/run
COMPLETED: oasislmf.computation.generate.losses.run in 6.61s
2024-12-04 10:45:36,257 [INFO] oasislmf log@128:wrapper [2705397] COMPLETED: oasislmf.computation.generate.losses.run in 6.61s
80%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 4/5 [00:09<00:02, 2.60s/it]RUNNING: oasislmf.computation.hooks.post_analysis.run
2024-12-04 10:45:36,260 [INFO] oasislmf log@104:wrapper [2705397] RUNNING: oasislmf.computation.hooks.post_analysis.run
80%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 4/5 [00:09<00:02, 2.34s/it]
Traceback (most recent call last):
File "/home/me/venvs/my_venv/bin/oasislmf", line 8, in <module>
sys.exit(main())
File "/home/me/venvs/my_venv/lib/python3.10/site-packages/oasislmf/cli/root.py", line 54, in main
sys.exit(RootCmd().run())
File "/home/me/venvs/my_venv/lib/python3.10/site-packages/oasislmf/cli/root.py", line 42, in run
return super(OasisBaseCommand, self).run(args=args)
File "/home/me/venvs/my_venv/lib/python3.10/site-packages/argparsetree/cmd.py", line 159, in run
return cmd_cls(sub_command_name).run(args)
File "/home/me/venvs/my_venv/lib/python3.10/site-packages/argparsetree/cmd.py", line 159, in run
return cmd_cls(sub_command_name).run(args)
File "/home/me/venvs/my_venv/lib/python3.10/site-packages/argparsetree/cmd.py", line 161, in run
return self.action(args) or 0
File "/home/me/venvs/my_venv/lib/python3.10/site-packages/oasislmf/cli/command.py", line 150, in action
manager_method(**_kwargs)
File "/home/me/venvs/my_venv/lib/python3.10/site-packages/oasislmf/utils/log.py", line 123, in wrapper
result = func(*args, **kwargs)
File "/home/me/venvs/my_venv/lib/python3.10/site-packages/oasislmf/manager.py", line 94, in interface
return computation_cls(**kwargs).run()
File "/home/me/venvs/my_venv/lib/python3.10/site-packages/oasislmf/utils/log.py", line 123, in wrapper
result = func(*args, **kwargs)
File "/home/me/venvs/my_venv/lib/python3.10/site-packages/oasislmf/computation/run/model.py", line 99, in run
cmd[0](**cmd[1]).run()
File "/home/me/venvs/my_venv/lib/python3.10/site-packages/oasislmf/utils/log.py", line 123, in wrapper
result = func(*args, **kwargs)
File "/home/me/venvs/my_venv/lib/python3.10/site-packages/oasislmf/computation/hooks/post_analysis.py", line 48, in run
_class(**kwargs).run()
File "/home/me/repos/mypackage/mypackage/oasis/postanalysis.py", line 25, in run
raise Exception("Error!!!!!!!!!")
Exception: Error!!!!!!!!!
The text was updated successfully, but these errors were encountered:
**IMPORTANT: Please apply the relevant labels, for example if this issue is needed as a backported fix add the label
LTS fix
(Long term support fix)Issue Description
If an error occurs in a custom post analysis hook, the traceback from the post analysis hook is not exposed in NRMC (presumably due to the way the Oasis API works but not sure). The MDK shows it but the logs in NRMC only show the final log message without the traceback.
Steps to Reproduce (Bugs only)
run
method.Version / Environment information
Example data / logs
run_traceback.log
- no error shownoasislmf model run
- stacktrace is visibleThe text was updated successfully, but these errors were encountered: