{"record":{"id":"c696915aa2b88f2e","repo":"quarkusio/quarkus","slug":"error-creating-the-openshift-binary-build-archive","errorCode":null,"errorMessage":"Error creating the openshift binary build archive.","messagePattern":"Error creating the openshift binary build archive\\.","errorType":"console","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftProcessor.java","lineNumber":405,"sourceCode":"        createContainerImageAndGetObservedReference(kubernetesClientBuilder, openshiftManifests, openshiftConfig, base,\n                output, additional);\n    }\n\n    private static Optional<String> createContainerImageAndGetObservedReference(\n            KubernetesClientBuilder kubernetesClientBuilder,\n            GeneratedFileSystemResourceBuildItem openshiftManifests,\n            ContainerImageOpenshiftConfig openshiftConfig,\n            String base,\n            Path output,\n            Path... additional) {\n        File tar;\n        try {\n            File original = Packaging.packageFile(output, base, additional);\n            //Let's rename the archive and give it a more descriptive name, as it may appear in the logs.\n            tar = Files.createTempFile(\"quarkus-\", \"-openshift\").toFile();\n            Files.move(original.toPath(), tar.toPath(), StandardCopyOption.REPLACE_EXISTING);\n        } catch (Exception e) {\n            throw new RuntimeException(\"Error creating the openshift binary build archive.\", e);\n        }\n\n        try (KubernetesClient client = kubernetesClientBuilder.build()) {\n            OpenShiftClient openShiftClient = toOpenshiftClient(client);\n            KubernetesList kubernetesList = Serialization\n                    .unmarshalAsList(new ByteArrayInputStream(openshiftManifests.getData()));\n\n            List<HasMetadata> buildResources = kubernetesList.getItems().stream()\n                    .filter(i -> i instanceof BuildConfig || i instanceof ImageStream || i instanceof Secret)\n                    .collect(Collectors.toList());\n\n            applyOpenshiftResources(openShiftClient, buildResources);\n            return openshiftBuild(buildResources, tar, openshiftConfig, kubernetesClientBuilder);\n        } finally {\n            try {\n                tar.delete();\n            } catch (Exception e) {\n                LOG.warn(\"Unable to delete temporary file \" + tar.toPath().toAbsolutePath(), e);","sourceCodeStart":387,"sourceCodeEnd":423,"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#L387-L423","documentation":"OpenshiftProcessor.createContainerImageAndGetObservedReference packages the Quarkus application output (runner jar/classes plus additional files) into a binary build archive that is uploaded to OpenShift for a binary S2I build. Any failure during Packaging.packageFile or while renaming the archive via a temp file move is wrapped in this RuntimeException.","triggerScenarios":"Calling the OpenShift image build path (openshiftBuildFromJar, builtContainerImage, or createContainerImage) when Packaging.packageFile cannot read/write the packaged output (missing runner artifact, locked file, full disk) or Files.move onto the 'quarkus-*-openshift' temp file fails.","commonSituations":"Running the build without a previously produced runner jar in binary mode; disk quota exhaustion in the temp directory; file permission problems or antivirus locking the output jar on Windows; corrupt/incomplete build output.","solutions":["Read the 'Caused by' exception: it names the actual I/O failure (missing file, disk full, permissions) and fix that root cause.","Run the package phase first (mvn package) so the runner jar/classes exist before the OpenShift binary build.","Free disk space or point java.io.tmpdir at a directory with capacity and write permissions.","On Windows, ensure no process (IDE, antivirus) holds a lock on target/ artifacts, then retry the build.","Clean the build output (mvn clean) and rebuild to rule out stale/corrupt packaging artifacts."],"exampleFix":"// before: building OpenShift image without packaging\n./mvnw quarkus:build -Dquarkus.container-image.build=true\n\n// after: package first, then build image\n./mvnw clean package -Dquarkus.container-image.build=true","handlingStrategy":"try-catch","validationCode":"Path runner = Path.of(\"target\", \"quarkus-app\", \"quarkus-run.jar\");\nif (Files.notExists(runner)) {\n    throw new IllegalStateException(\"Run 'mvn package' before the OpenShift binary build: missing \" + runner);\n}\nFiles.getFileStore(Path.of(System.getProperty(\"java.io.tmpdir\"))).getTotalSpace(); // tmpdir reachable","typeGuard":null,"tryCatchPattern":"try {\n    // trigger openshift image build\n} catch (RuntimeException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"Error creating the openshift binary build archive.\")) {\n        Throwable root = e.getCause();\n        // inspect root: missing file / disk full / permissions and retry after cleanup\n    }\n    throw e;\n}","preventionTips":["Always run the package phase (mvn package) before triggering OpenShift binary builds.","Monitor disk space on build machines; keep the temp directory writable.","On Windows, exclude target/ from antivirus real-time locking.","Run mvn clean periodically to avoid stale/corrupt output."],"tags":["openshift","container-image","io","packaging","s2i"],"backgroundTag":"archive-creation-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"}