diff --git a/.changelog/18621.txt b/.changelog/18621.txt new file mode 100644 index 000000000..bf075ceac --- /dev/null +++ b/.changelog/18621.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: using start/stop from the job page in the UI will no longer fail when the job lacks HCL submission data +``` diff --git a/ui/app/components/job-page/parts/title.js b/ui/app/components/job-page/parts/title.js index f110cdc75..f49acabe7 100644 --- a/ui/app/components/job-page/parts/title.js +++ b/ui/app/components/job-page/parts/title.js @@ -71,8 +71,17 @@ export default class Title extends Component { */ @task(function* (withNotifications = false) { const job = this.job; - const specification = yield job.fetchRawSpecification(); - job.set('_newDefinition', specification.Source); + + // Try to get the submission/hcl sourced specification first. + // In the event that this fails, fall back to the raw definition. + try { + const specification = yield job.fetchRawSpecification(); + job.set('_newDefinition', specification.Source); + } catch { + const definition = yield job.fetchRawDefinition(); + delete definition.Stop; + job.set('_newDefinition', JSON.stringify(definition)); + } try { yield job.parse();