{"record":{"id":"fd40b5af18fcb971","repo":"quarkusio/quarkus","slug":"build-s-failed-s","errorCode":null,"errorMessage":"Build:%s failed! %s","messagePattern":"Build:(.+?) failed! (.+?)","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":550,"sourceCode":"                            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());\n    }\n","sourceCodeStart":532,"sourceCodeEnd":568,"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#L532-L568","documentation":"The OpenShift S2I build started by Quarkus failed. waitForOpenshiftBuild detects Build status Failed and throws IllegalStateException including the build name and the status message reported by the cluster.","triggerScenarios":"During the polling loop, isFailed(updated) becomes true — the build pod itself failed: base-image pull errors, failing S2I steps (dependency download, compile inside the builder image), or a Dockerfile/binary input error, all surfacing as Build status Failed with a message.","commonSituations":"Builder image cannot be pulled due to registry auth/network; Maven/Gradle dependency downloads fail inside the cluster (no internet/egress restrictions); bad application code compiled inside the S2I builder; insufficient quota causing pod eviction.","solutions":["Read the status message in the exception and the full build log: oc logs build/<buildName> to see the failing step.","Fix the root cause in the log: registry credentials, proxy/egress settings, or build errors inside the builder image.","Verify quota and node resources: oc describe quota; check the build pod events.","If a base-image tag was moved/removed, update the S2I image reference or Quarkus version so it resolves.","Re-run the build after fixing to confirm the build reaches Complete."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"oc get build <buildName> -o jsonpath='{.status.phase}'\noc logs build/<buildName> // inspect failing step before rerunning","typeGuard":null,"tryCatchPattern":"try {\n    // quarkus openshift build\n} catch (IllegalStateException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"failed!\")) {\n        String detail = e.getMessage(); // includes Build status message from the cluster\n        // fetch oc logs build/<name>, fix registry/network/build error, rebuild\n    }\n    throw e;\n}","preventionTips":["Pre-pull/verify builder images and registry credentials in the cluster.","Ensure egress/proxy settings allow dependency downloads inside build pods.","Keep application code and dependencies buildable with the target builder image Java version.","Set build resource requests to avoid quota-driven failures."],"tags":["openshift","s2i","build-failed","kubernetes","registry"],"backgroundTag":"openshift-build-failed","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"}