{"record":{"id":"d76076cb82c4f37f","repo":"quarkusio/quarkus","slug":"build-s-cancelled","errorCode":null,"errorMessage":"Build:%s cancelled!","messagePattern":"Build:(.+?) cancelled!","errorType":"console","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftProcessor.java","lineNumber":548,"sourceCode":"                    build = updated;\n                    try (LogWatch w = client.builds().withName(buildName).withPrettyOutput().watchLog();\n                            Reader reader = new InputStreamReader(w.getOutput())) {\n                        display(reader, openshiftConfig.buildLogLevel());\n                    } catch (IOException | KubernetesClientException ex) {\n                        // This may happen if the LogWatch is closed while we are still reading.\n                        // We shouldn't let the build fail, so let's log a warning and display last few lines of the log\n                        LOG.warn(\"Log stream closed, redisplaying last \" + LOG_TAIL_SIZE + \" entries:\");\n                        try {\n                            display(client.builds().withName(buildName).tailingLines(LOG_TAIL_SIZE).getLogReader(),\n                                    Logger.Level.WARN);\n                        } catch (IOException | KubernetesClientException ignored) {\n                            // Let's ignore this.\n                        }\n                    }\n                } else if (isComplete(updated)) {\n                    return updated;\n                } else if (isCancelled(updated)) {\n                    throw new IllegalStateException(\"Build:\" + buildName + \" cancelled!\");\n                } else if (isFailed(updated)) {\n                    throw new IllegalStateException(\n                            \"Build:\" + buildName + \" failed! \" + updated.getStatus().getMessage());\n                } else if (isError(updated)) {\n                    throw new IllegalStateException(\n                            \"Build:\" + buildName + \" encountered error! \" + updated.getStatus().getMessage());\n                }\n            }\n        }\n        return build;\n    }\n\n    static Optional<String> observedImageReference(Build build) {\n        if (build == null || build.getStatus() == null) {\n            return Optional.empty();\n        }\n        return Optional.ofNullable(build.getStatus().getOutputDockerImageReference())\n                .filter(image -> !image.isBlank());","sourceCodeStart":530,"sourceCodeEnd":566,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftProcessor.java#L530-L566","documentation":"The OpenShift build Quarkus started was cancelled before completing. waitForOpenshiftBuild observes the Build status transition to Cancelled and throws IllegalStateException with the build name, aborting the image build.","triggerScenarios":"During a Quarkus OpenShift image build, the Build status becomes 'Cancelled' — someone/something ran oc cancel-build, the BuildConfig's spec changed causing cancellation, or the build was aborted via the OpenShift console/API while waitForOpenshiftBuild was polling.","commonSituations":"A teammate cancelling a long-running build from the console; automated tooling cancelling duplicate builds of the same BuildConfig; resource-pressure policies cancelling builds; user hitting Ctrl-C and cleaning up via oc cancel-build.","solutions":["Re-run the Quarkus OpenShift build (mvn package -Dquarkus.kubernetes.deploy=true or the container-image goals) after ensuring nothing cancels it.","Stop cancelling the build: check for scripts/jobs that call oc cancel-build for this BuildConfig.","Check build capacity/quota (oc describe quota, node resources) that might trigger cancellation, and build logs (oc logs build/<name>) for the cancellation reason.","If builds run concurrently against the same BuildConfig, serialize your CI jobs so they do not cancel each other."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"oc get buildconfig <name> -n <namespace> // ensure no concurrent jobs/cancel policies will abort the build","typeGuard":null,"tryCatchPattern":"try {\n    // quarkus openshift build\n} catch (IllegalStateException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"cancelled!\")) {\n        // someone cancelled the build: check oc events / who ran oc cancel-build, then re-run\n    }\n    throw e;\n}","preventionTips":["Do not run oc cancel-build against BuildConfigs used by automated pipelines.","Serialize CI jobs that share a BuildConfig.","Check resource quotas/limits that can lead to build cancellation.","Monitor build pods and events in the target namespace."],"tags":["openshift","build","cancelled","kubernetes","ci"],"backgroundTag":"openshift-build-cancelled","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}