{"record":{"id":"d9c2585830ca1f97","repo":"quarkusio/quarkus","slug":"build-s-encountered-error-s","errorCode":null,"errorMessage":"Build:%s encountered error! %s","messagePattern":"Build:(.+?) encountered error! (.+?)","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":553,"sourceCode":"                        // 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());\n    }\n\n    public static Predicate<HasMetadata> distinctByResourceKey() {\n        Map<Object, Boolean> seen = new ConcurrentHashMap<>();\n        return t -> seen.putIfAbsent(t.getApiVersion() + \"/\" + t.getKind() + \":\" + t.getMetadata().getName(),","sourceCodeStart":535,"sourceCodeEnd":571,"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#L535-L571","documentation":"The OpenShift build encountered an internal error. waitForOpenshiftBuild checks isError(updated) and throws IllegalStateException containing the build name and the cluster-reported error message, distinguishing this failure mode from a build that merely Failed (which would point at the build steps themselves).","triggerScenarios":"During polling, the Build status transitions to Error — infrastructure-level problems such as the build pod being killed, node failures, controller errors, or API server issues during the build rather than a failure of the build script itself.","commonSituations":"Node reboot/preemption killing the build pod; OpenShift control-plane instability; image stream/controller errors during build; resource exhaustion (OOM) on the build pod.","solutions":["Read the exception's status message and cluster events: oc get events and oc describe build <buildName> to identify the infrastructure failure.","Check node and control-plane health (oc get nodes, openshift-controller-manager logs) and re-run the build once the cluster is healthy.","Increase build pod resources if OOM-killed (adjust build pod resources via BuildConfig or Quarkus config).","Retry the Quarkus OpenShift build; Error states are often transient infrastructure failures.","If persistent, open an issue with the OpenShift administrators including the build name from the exception."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"oc get nodes // verify node health\noc get events -n <namespace> | grep -i build","typeGuard":null,"tryCatchPattern":"try {\n    // quarkus openshift build\n} catch (IllegalStateException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"encountered error!\")) {\n        // infrastructure-level failure: check node/controller health, retry with backoff\n    }\n    throw e;\n}","preventionTips":["Monitor node and control-plane health in the build cluster.","Give build pods adequate memory/CPU to avoid OOM kills.","Use retries with backoff for transient infrastructure errors in CI.","Keep the OpenShift cluster and its controllers up to date."],"tags":["openshift","build-error","kubernetes","infrastructure","cluster"],"backgroundTag":"openshift-build-error","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}