{"record":{"id":"c6148fbcc8ef8373","repo":"quarkusio/quarkus","slug":"unable-to-setup-environment-for-generating-kuberne","errorCode":null,"errorMessage":"Unable to setup environment for generating Kubernetes resources","messagePattern":"Unable to setup environment for generating Kubernetes resources","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesProcessor.java","lineNumber":125,"sourceCode":"            List<ConfiguratorBuildItem> configurators,\n            List<ConfigurationSupplierBuildItem> configurationSuppliers,\n            List<DecoratorBuildItem> decorators,\n            BuildProducer<DekorateOutputBuildItem> dekorateSessionProducer,\n            Optional<CustomProjectRootBuildItem> customProjectRoot,\n            Optional<CustomKubernetesOutputDirBuildItem> customOutputDir,\n            BuildProducer<GeneratedFileSystemResourceBuildItem> generatedResourceProducer,\n            BuildProducer<GeneratedKubernetesResourceBuildItem> generatedKubernetesResourceProducer,\n            BuildProducer<KubernetesOutputDirectoryBuildItem> outputDirectoryBuildItemBuildProducer) {\n\n        List<ConfiguratorBuildItem> allConfigurators = new ArrayList<>(configurators);\n        List<ConfigurationSupplierBuildItem> allConfigurationSuppliers = new ArrayList<>(configurationSuppliers);\n        List<DecoratorBuildItem> allDecorators = new ArrayList<>(decorators);\n\n        final Path root;\n        try {\n            root = Files.createTempDirectory(\"quarkus-kubernetes\");\n        } catch (IOException e) {\n            throw new RuntimeException(\"Unable to setup environment for generating Kubernetes resources\", e);\n        }\n\n        Map<String, Object> config = KubernetesConfigUtil.toMap(kubernetesConfig, openshiftConfig, knativeConfig);\n        Set<String> deploymentTargets = kubernetesDeploymentTargets.getEntriesSortedByPriority().stream()\n                .map(DeploymentTargetEntry::getName)\n                .collect(Collectors.toSet());\n\n        Path artifactPath = getRunner(outputTarget, packageConfig);\n\n        try {\n            // by passing false to SimpleFileWriter, we ensure that no files are actually written during this phase\n            Optional<Project> optionalProject = KubernetesCommonHelper.createProject(applicationInfo, customProjectRoot,\n                    artifactPath);\n            optionalProject.ifPresent(project -> {\n                Set<String> targets = new HashSet<>();\n                targets.add(COMMON);\n                targets.addAll(deploymentTargets);\n                final Map<String, String> generatedResourcesMap;","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesProcessor.java#L107-L143","documentation":"During the Kubernetes resource generation build step, Quarkus creates a temporary working directory (Files.createTempDirectory) to hold generated manifests. If the filesystem cannot provide a temp directory (IOException), the build aborts with this RuntimeException.","triggerScenarios":"Files.createTempDirectory(\"quarkus-kubernetes\") throws IOException during the kubernetes build step — e.g. the java.io.tmpdir is read-only, full, or missing.","commonSituations":"Disk-full CI runners or containers with read-only /tmp; restrictive TMPDIR/java.io.tmpdir permissions; containers running with a read-only root filesystem and no writable tmp mount.","solutions":["Free disk space on the volume backing the temp directory.","Ensure /tmp (or java.io.tmpdir) exists and is writable by the build user (e.g. add a writable emptyDir tmp mount in the build container).","Set -Djava.io.tmpdir=/some/writable/dir for the Maven/Gradle build process."],"exampleFix":"// before\nMAVEN_OPTS=\"-Xmx4g\" ./mvnw package // /tmp full or read-only\n// after\nmkdir -p /workspace/tmp && MAVEN_OPTS=\"-Xmx4g -Djava.io.tmpdir=/workspace/tmp\" ./mvnw package","handlingStrategy":"validation","validationCode":"// Check temp dir writability before building\nPath tmp = Path.of(System.getProperty(\"java.io.tmpdir\"));\nif (!Files.isDirectory(tmp) || !Files.isWritable(tmp)) {\n    throw new IllegalStateException(\"Temp dir not writable: \" + tmp + \" — set -Djava.io.tmpdir\");\n}\nFiles.createTempFile(\"quarkus-preflight\", \".tmp\"); // probe write","typeGuard":null,"tryCatchPattern":"try {\n    ./mvnw package\n} — outside Java: preflight the build container:\nif [ ! -w \"${TMPDIR:-/tmp}\" ]; then export JAVA_TOOL_OPTIONS=\"$JAVA_TOOL_OPTIONS -Djava.io.tmpdir=/workspace/tmp\"; fi","preventionTips":["Give build containers a writable tmp volume (emptyDir mount at /tmp).","Monitor disk space on CI runners.","Set an explicit writable -Djava.io.tmpdir in build images."],"tags":["filesystem","temp-directory","build","io"],"backgroundTag":"temp-dir-unwritable","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"}