diff --git a/0001-Don-t-crash-in-_checkImageState-if-there-s-no-image..patch b/0001-Don-t-crash-in-_checkImageState-if-there-s-no-image..patch new file mode 100644 index 0000000..04dffc4 --- /dev/null +++ b/0001-Don-t-crash-in-_checkImageState-if-there-s-no-image..patch @@ -0,0 +1,36 @@ +From 74c34cec10efe19fc591fc0cdc4d2132e31e8b2d Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Wed, 20 Jul 2022 16:04:08 -0700 +Subject: [PATCH] Don't crash in _checkImageState if there's no image.os_plugin + +We've seen some tasks lately where Koji crashed trying to do +`image.os_plugin.abort()`, e.g.: + +https://koji.fedoraproject.org/koji/taskinfo?taskID=89750587 +https://koji.fedoraproject.org/koji/taskinfo?taskID=89671944 + +The fix seems fairly simple: only try and abort if os_plugin +actually exists. + +Signed-off-by: Adam Williamson +--- + builder/kojid | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/builder/kojid b/builder/kojid +index e7ba1888..de6859dd 100755 +--- a/builder/kojid ++++ b/builder/kojid +@@ -4164,7 +4164,8 @@ class BaseImageTask(OzImageTask): + if scrnshot: + ext = scrnshot[-3:] + self.uploadFile(scrnshot, remoteName='screenshot.%s' % ext) +- image.os_plugin.abort() # forcibly tear down the VM ++ if image.os_plugin: ++ image.os_plugin.abort() # forcibly tear down the VM + # TODO abort when a task is CANCELLED + if not self.session.checkUpload('', os.path.basename(self.ozlog)): + self.tlog.removeHandler(self.fhandler) +-- +2.37.1 + diff --git a/koji.spec b/koji.spec index e1cfaec..4f08c47 100644 --- a/koji.spec +++ b/koji.spec @@ -9,13 +9,18 @@ Name: koji Version: 1.29.1 -Release: 1%{?dist} +Release: 2%{?dist} # the included arch lib from yum's rpmUtils is GPLv2+ License: LGPLv2 and GPLv2+ Summary: Build system tools URL: https://pagure.io/koji/ Source0: https://releases.pagure.org/koji/koji-%{version}.tar.bz2 +# https://pagure.io/koji/pull-request/3445 +# Don't crash on image build failure path if an imagefactory thing +# isn't there +Patch0: 0001-Don-t-crash-in-_checkImageState-if-there-s-no-image..patch + # Not upstreamable Patch100: fedora-config.patch @@ -347,6 +352,9 @@ done %systemd_postun kojira.service %changelog +* Wed Jul 20 2022 Adam Williamson - 1.29.1-2 +- Backport MR #3445 to fix a koji crash in image builds + * Tue Jul 12 2022 Kevin Fenzi - 1.29.1-1 - Update to 1.29.1. Fiex rhbz#2106294