Add User-Friendly Messaging to Tracebacks (Project Updates)
#8,571 opened on Nov 11, 2020
Repository metrics
- Stars
- (13,071 stars)
- PR merge metrics
- (Avg merge 24d 6h) (30 merged PRs in 30d)
Description
ISSUE TYPE
- Feature Idea
SUMMARY
Per an user's request, they would like to see friendlier messaging around tracebacks, specifically in project updates. The user had a scheduled job that ran during a SCM maintenance window. From the information gathered, it appears Tower (AWX) dispatched the project update to a node that did not have a local clone of the project. As expected, Tower attempted to fetch a clone of the project, however, the attempt failed as the SCM system was offline. Tower reported the following after the update attempt:
Traceback (most recent call last):
File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/tasks.py", line 1255, in run self.pre_run_hook(self.instance, private_data_dir)
File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/tasks.py", line 1761, in pre_run_hook raise RuntimeError(msg)
RuntimeError: The project revision for this job template is unknown due to a failed update.
Before coming to the possible conclusion, the user had trouble diagnosing what caused the failure, given that the project did not have Update Revision on Launch selected or anything that indicated to dynamically pull from SCM. They're wondering if it's possible to expose potential reason(s) for the traceback. Maybe something like this, if possible (similar to PostgreSQL messaging):
Traceback (most recent call last):
File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/tasks.py", line 1255, in run self.pre_run_hook(self.instance, private_data_dir)
File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/tasks.py", line 1761, in pre_run_hook raise RuntimeError(msg)
RuntimeError: The project revision for this job template is unknown due to a failed update. HINT(S): Is Tower able to access the remote SCM system? If Update Revision on Launch is not selected but Tower still attempted an update, did the execution node have a local clone of the project?
See: https://www.postgresql.org/docs/current/plpython-util.html