When running toolforge build-show sometimes the status does not include the 'steps' and the cli exits with KeyError:
toolsbeta.test@toolsbeta-sgebastion-05:~$ toolforge build-show test-buildpacks-pipelinerun-7h7c7 Name: test-buildpacks-pipelinerun-7h7c7 Start time: 2022-09-27T08:09:22Z End time: running Status: ok(Running) ... Steps: Step: clone - unknown({'container': 'step-clone', 'imageID': 'docker-pullable://docker-registry.tools.wmflabs.org/toolforge-tektoncd-pipeline-cmd-git-init@sha256:bbb7ec459178f708644694417f9426e6c599b5aaab1b01e4c3863e8294de6758', 'name': 'clone', 'terminated': {'containerID': 'docker://1e41000998d695044380fa50748a8309b742380ddb6cc1350d7cb29bc5001c06', 'exitCode': 0, 'finishedAt': '2022-09-27T08:09:43Z', 'message': '[{"key":"commit","value":"a03aa93d58961f09e63e29c0c4105ad69945f8ed","resourceRef":{}},{"key":"url","value":"https://github.com/david-caro/wm-lol.git","resourceRef":{}}]', 'reason': 'Completed', 'startedAt': '2022-09-27T08:09:43Z'}}) ... toolsbeta.test@toolsbeta-sgebastion-05:~$ toolforge build-show test-buildpacks-pipelinerun-7h7c7 Traceback (most recent call last): File "/usr/bin/toolforge", line 8, in <module> sys.exit(main()) File "/usr/lib/python3/dist-packages/toolforge_cli/cli.py", line 438, in main toolforge() File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__ return self.main(*args, **kwargs) File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/usr/lib/python3/dist-packages/toolforge_cli/cli.py", line 409, in build_show click.echo(_run_to_details_str(run=run, k8s_client=k8s_client)) File "/usr/lib/python3/dist-packages/toolforge_cli/cli.py", line 167, in _run_to_details_str details_str += "\n".join(" " + line for line in _get_task_details_lines(run=run, k8s_client=k8s_client)) File "/usr/lib/python3/dist-packages/toolforge_cli/cli.py", line 131, in _get_task_details_lines tasks_details_lines.extend(" " + line for line in _get_step_details_lines(task=task)) File "/usr/lib/python3/dist-packages/toolforge_cli/cli.py", line 104, in _get_step_details_lines for step in task["status"]["steps"]: KeyError: 'steps'
The actual status has the keys:
['completionTime', 'conditions', 'podName', 'startTime', 'taskSpec']
The conditions hold the reason why it failed:
"conditions": [ { "lastTransitionTime": "2022-09-27T08:09:58Z", "message": "The node was low on resource: memory. Container step-export was using 7804Ki, which exceeds its request of 0. Container step-results was using 6756Ki, which exceeds its request o f 0. Container step-build was using 26352Ki, which exceeds its request of 0. ", "reason": "Failed", "status": "False", "type": "Succeeded" } ]