osbuild-worker: print stacktrace in case osbuild job panics

This commit is contained in:
Sanne Raymaekers 2024-06-06 10:49:11 +02:00
parent 4df04643ab
commit a769d73745

View file

@ -13,6 +13,7 @@ import (
"os/exec"
"path"
"path/filepath"
"runtime/debug"
"strings"
"github.com/osbuild/images/pkg/arch"
@ -373,6 +374,7 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error {
defer func() {
if r := recover(); r != nil {
logWithId.Errorf("Recovered from panic: %v", r)
logWithId.Errorf("%s", debug.Stack())
osbuildJobResult.JobError = clienterrors.WorkerClientError(
clienterrors.ErrorJobPanicked,