{"record":{"id":"87588028a7f0e4c6","repo":"JetBrains/intellij-community","slug":"cannot-create-temporary-file","errorCode":null,"errorMessage":"Cannot create temporary file","messagePattern":"Cannot create temporary file","errorType":"exception","errorClass":"CantRunException","httpStatus":null,"severity":"error","filePath":"java/java-impl/src/com/intellij/javadoc/JavadocGeneratorRunProfile.java","lineNumber":355,"sourceCode":"      }\n      catch (CantRunException e) {\n        FileUtil.delete(argsFile);\n        throw e;\n      }\n\n      myArgFileFilter.setPath(argsFile.getPath(), cs);\n      parameters.add(\"@\" + argsFile.getPath());\n      OSProcessHandler.deleteFileOnTermination(cmdLine, argsFile);\n      cmdLine.setCharset(cs);\n    }\n\n    private static @NotNull File createTempArgsFile() throws CantRunException {\n      File argsFile;\n      try {\n        argsFile = FileUtil.createTempFile(\"javadoc_args\", null);\n      }\n      catch (IOException e) {\n        throw new CantRunException(JavaBundle.message(\"javadoc.generate.temp.file.error\"), e);\n      }\n      return argsFile;\n    }\n\n    private @Unmodifiable @NotNull List<VirtualFile> findSourceRoots(@NotNull Set<Module> modules) {\n      OrderEnumerator sourcePathEnumerator = ProjectRootManager.getInstance(myProject).orderEntries(modules);\n      if (!myConfiguration.OPTION_INCLUDE_LIBS) {\n        sourcePathEnumerator = sourcePathEnumerator.withoutSdk().withoutLibraries();\n      }\n      if (!myGenerationOptions.isIncludeTestSource()) {\n        sourcePathEnumerator = sourcePathEnumerator.productionOnly();\n      }\n      return sourcePathEnumerator.getSourcePathsList().getRootDirs();\n    }\n\n    private @Unmodifiable @NotNull List<VirtualFile> findClassRoots(@NotNull Set<Module> modules, @NotNull Sdk jdk) {\n      OrderEnumerator classPathEnumerator = ProjectRootManager.getInstance(myProject).orderEntries(modules).withoutModuleSourceEntries();\n      if (jdk.getSdkType() instanceof JavaSdk) {","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/java-impl/src/com/intellij/javadoc/JavadocGeneratorRunProfile.java#L337-L373","documentation":"createTempArgsFile calls FileUtil.createTempFile(\"javadoc_args\", null); if that throws IOException the runner wraps it in CantRunException('Cannot create temporary file'). Unlike the FileNotFoundException case, this fires during creation itself — the JVM could not produce a new file in the temp directory at all.","triggerScenarios":"FileUtil.createTempFile fails: java.io.tmpdir does not exist, is read-only, the disk/quota is exhausted, or file creation is blocked by policy — and javadoc generation needs its args file.","commonSituations":"CI containers with tiny read-only /tmp; tmpfs filling up during big generations; macOS/Windows security prompts denying temp writes; TMP/TMPDIR environment variables pointing at removed directories.","solutions":["Verify the temp dir exists and is writable (echo $TMPDIR; touch $TMPDIR/probe) and free space there.","Set a writable temp dir for the IDE: -Djava.io.tmpdir=... in Help | Edit Custom VM Options, then restart.","On CI, mount a larger tmpfs or set TMPDIR to a workspace directory before launching the IDE/Remote Dev build."],"exampleFix":"# CI / launch script\n# before: default TMPDIR is a small read-only /tmp\n\n# after\nexport TMPDIR=/build/idea-tmp && mkdir -p \"$TMPDIR\"","handlingStrategy":"fallback","validationCode":"try {\n  File probe = FileUtil.createTempFile(\"probe\", null);\n  probe.delete();\n} catch (IOException e) {\n  // temp dir unusable — redirect java.io.tmpdir or warn before javadoc generation\n}","typeGuard":null,"tryCatchPattern":"try { FileUtil.createTempFile(\"javadoc_args\", null); } catch (IOException e) { /* set -Djava.io.tmpdir to a writable dir and restart the IDE */ }","preventionTips":["On CI, set TMPDIR to a writable workspace directory before launching builds","Ensure tmpfs/disk quota covers temp file churn","Monitor free space on the temp partition for long-running IDE sessions"],"tags":["javadoc","temp-file","filesystem","environment","ci"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}