{"record":{"id":"ff5e1a5d2069325c","repo":"quarkusio/quarkus","slug":"unable-to-save-enhanced-dockerfile-contents-to-dis-ff5e1a","errorCode":null,"errorMessage":"Unable to save enhanced Dockerfile contents to disk","messagePattern":"Unable to save enhanced Dockerfile contents to disk","errorType":"console","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"extensions/container-image/container-image-podman/deployment/src/main/java/io/quarkus/container/image/podman/deployment/PodmanProcessor.java","lineNumber":215,"sourceCode":"        Path outputDirectory = outputTargetBuildItem.getOutputDirectory();\n\n        Path aotFile = requestBuildItem.getAotFile();\n        String aotEnhancedDockerfileContent = \"\"\"\n                FROM %s\n\n                # Add the app.aot file to the working directory\n                COPY %s %s\n\n                # Set the JAVA_TOOL_OPTIONS environment variable\n                ENV JAVA_TOOL_OPTIONS=\"-XX:AOTCache=%s\"\n                \"\"\".formatted(baseImage, outputDirectory.relativize(aotFile),\n                requestBuildItem.getContainerWorkingDirectory(), aotFile.getFileName());\n\n        Path aotEnhancedDockerfile = outputDirectory.resolve(\"Dockerfile.aot\");\n        try {\n            Files.write(aotEnhancedDockerfile, aotEnhancedDockerfileContent.getBytes());\n        } catch (IOException e) {\n            throw new UnsupportedOperationException(\"Unable to save enhanced Dockerfile contents to disk\", e);\n        }\n\n        String executableName = getExecutableName(podmanConfig, ContainerRuntime.PODMAN);\n        var dockerBuildArgs = getPodmanBuildArgs(enhancedImage, new DockerfilePaths() {\n            @Override\n            public Path dockerfilePath() {\n                return aotEnhancedDockerfile;\n            }\n\n            @Override\n            public Path dockerExecutionPath() {\n                return outputDirectory;\n            }\n        }, containerImageConfig,\n                podmanConfig, false);\n\n        LOG.infof(\"Executing the following command to build image: '%s %s'\", executableName,\n                String.join(\" \", dockerBuildArgs));","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/container-image/container-image-podman/deployment/src/main/java/io/quarkus/container/image/podman/deployment/PodmanProcessor.java#L197-L233","documentation":"The Podman AOT-optimized container image build generates an enhanced Dockerfile (Dockerfile.aot) into the build output directory. If writing that file fails with an IOException, PodmanProcessor throws UnsupportedOperationException wrapping it, because the AOT build cannot proceed without the persisted Dockerfile.","triggerScenarios":"Executing the Podman AOT image build (buildAotOptimizedContainerImageBuildItem) when Files.write cannot create/write outputDirectory/Dockerfile.aot — output directory does not exist and cannot be created, no write permission, disk full, or the path is a directory/file locked.","commonSituations":"Running the build from a read-only working directory or CI workspace with restricted permissions; disk quota exceeded on the machine running the build; target/ directory deleted or replaced by a file while the build runs; Windows file locks.","solutions":["Read the 'Caused by' IOException to see the exact filesystem problem and fix it (permissions, space, path).","Ensure the build output directory (target/) exists and is writable; run mvn clean to reset a corrupted output tree.","Free disk space or move the build to a volume with sufficient capacity.","On CI, verify the workspace user has write access to the project directory (chown/adjust runner permissions).","Close IDE/antivirus handles locking files on Windows and retry."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"Path outDir = Path.of(\"target\");\nif (!Files.isDirectory(outDir) || !Files.isWritable(outDir)) {\n    throw new IllegalStateException(\"Build output directory missing or not writable: \" + outDir.toAbsolutePath());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure the CI runner user owns the workspace and target/ is writable.","Monitor disk space on build machines; expand or clean volumes as needed.","Avoid pointing the build at read-only mounts.","Run mvn clean if the output tree becomes corrupted."],"tags":["podman","container-image","io","dockerfile","aot"],"backgroundTag":"file-write-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"}