{"record":{"id":"2b6f4a3d7a20ea4f","repo":"quarkusio/quarkus","slug":"unable-to-create-archive-archivepath","errorCode":null,"errorMessage":"Unable to create archive: ${archivePath}","messagePattern":"Unable to create archive: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/pkg/jar/ParallelCommonsCompressArchiveCreator.java","lineNumber":313,"sourceCode":"                // we add the manifest directly to the final archive to make sure it is the first element added\n                // (except for the META-INF/ directory that is allowed first)\n                ByteArrayOutputStream baos = new ByteArrayOutputStream();\n                manifest.write(baos);\n                byte[] manifestBytes = baos.toByteArray();\n\n                ZipArchiveEntry manifestEntry = new ZipArchiveEntry(\"META-INF/MANIFEST.MF\");\n                normalizeTimestampsAndPermissions(manifestEntry);\n                manifestEntry.setSize(manifestBytes.length);\n                archive.putArchiveEntry(manifestEntry);\n                archive.write(manifestBytes);\n                archive.closeArchiveEntry();\n            }\n\n            directories.writeTo(archive);\n            directories.close();\n            scatterZipCreator.writeTo(archive);\n        } catch (IOException | InterruptedException | ExecutionException e) {\n            throw new IllegalStateException(\"Unable to create archive: \" + archivePath, e);\n        }\n        try {\n            Files.deleteIfExists(tempDirectory);\n        } catch (Exception e) {\n            // noop, it's not a big deal to keep this directory around\n        }\n    }\n\n    private static class DoNotShutdownDelegatingExecutorService implements ExecutorService {\n\n        private final ExecutorService delegate;\n\n        private DoNotShutdownDelegatingExecutorService(ExecutorService delegate) {\n            this.delegate = delegate;\n        }\n\n        @Override\n        public void shutdown() {","sourceCodeStart":295,"sourceCodeEnd":331,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/pkg/jar/ParallelCommonsCompressArchiveCreator.java#L295-L331","documentation":"Thrown when closing the ParallelCommonsCompressArchiveCreator fails to finalize the jar archive: writing scattered/directory entries to the ZipArchiveOutputStream raised an IOException, the scatter zip threads were interrupted, or a parallel write task failed with ExecutionException.","triggerScenarios":"JarOutputStream close() during fast-jar packaging while scatterZipCreator.writeTo(archive) or directories.writeTo fails; disk full on the output volume; another process holding/locking the target jar; thread interruption during packaging.","commonSituations":"Full or quota-limited disk in CI; target jar locked by a running application or IDE; slow/flaky filesystems (NFS, network shares); OOM killing scatter threads.","solutions":["Check free disk space and permissions in the target build directory.","Ensure no other process (running app, IDE, antivirus) holds the output jar; stop the app and rebuild.","Re-run ./mvnw clean package to remove stale partial artifacts.","Inspect the wrapped cause (IOException vs InterruptedException vs ExecutionException) for the real problem.","Avoid building onto network filesystems; use local storage."],"exampleFix":"// before\n$ mvn package  # fails: Unable to create archive: .../quarkus-app/...jar\n// after\n$ mvn clean package  # after freeing disk space / stopping the process locking the jar","handlingStrategy":"try-catch","validationCode":"import java.nio.file.*;\nPath jar = Path.of(\"target/quarkus-app/quarkus-run.jar\");\nif (!Files.isWritable(jar.getParent())) throw new IllegalStateException(\"Build output not writable\");\nif (Files.getUsableSpace(jar.getParent()) < 512L*1024*1024) throw new IllegalStateException(\"Low disk\");","typeGuard":null,"tryCatchPattern":"try {\n    // packaging build\n} catch (IllegalStateException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"Unable to create archive\")) {\n        log.error(\"Archive finalize failed\", e.getCause());\n        // free disk / unlock jar / mvn clean and retry\n    } else throw e;\n}","preventionTips":["Monitor disk space in CI agents.","Stop dev-mode apps and IDE file watchers holding the target jar.","Build on local filesystems, not NFS.","Run mvn clean after any failed package attempt."],"tags":["packaging","archive","io"],"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-14T00:17:10.932Z"}