{"record":{"id":"dfce76a0a072b978","repo":"quarkusio/quarkus","slug":"cannot-initialize-file-manager","errorCode":null,"errorMessage":"Cannot initialize file manager","messagePattern":"Cannot initialize file manager","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/dev/filesystem/QuarkusFileManager.java","lineNumber":32,"sourceCode":"public abstract class QuarkusFileManager extends ForwardingJavaFileManager<StandardJavaFileManager> {\n\n    protected QuarkusFileManager(StandardJavaFileManager fileManager, Context context) {\n        super(fileManager);\n        try {\n            this.fileManager.setLocation(StandardLocation.CLASS_PATH, context.getClassPath());\n            this.fileManager.setLocation(StandardLocation.CLASS_OUTPUT, List.of(context.getOutputDirectory()));\n            if (context.getGeneratedSourcesDirectory() != null) {\n                // Paths might be missing! (see: https://github.com/quarkusio/quarkus/issues/51178)\n                ensureDirectory(context.getGeneratedSourcesDirectory());\n                this.fileManager.setLocation(StandardLocation.SOURCE_OUTPUT, List.of(context.getGeneratedSourcesDirectory()));\n            }\n            if (context.getAnnotationProcessorPaths() != null) {\n                // Paths might be missing! (see: https://github.com/quarkusio/quarkus/issues/42908)\n                ensureDirectories(context.getAnnotationProcessorPaths());\n                this.fileManager.setLocation(StandardLocation.ANNOTATION_PROCESSOR_PATH, context.getAnnotationProcessorPaths());\n            }\n        } catch (IOException e) {\n            throw new RuntimeException(\"Cannot initialize file manager\", e);\n        }\n    }\n\n    public abstract Iterable<? extends JavaFileObject> getJavaSources(Iterable<? extends File> files);\n\n    public void reset(Context context) {\n        try {\n            this.fileManager.setLocation(StandardLocation.CLASS_PATH, context.getClassPath());\n            this.fileManager.setLocation(StandardLocation.CLASS_OUTPUT, List.of(context.getOutputDirectory()));\n            if (context.getGeneratedSourcesDirectory() != null) {\n                // Paths might be missing! (see: https://github.com/quarkusio/quarkus/issues/51178)\n                ensureDirectory(context.getGeneratedSourcesDirectory());\n                this.fileManager.setLocation(StandardLocation.SOURCE_OUTPUT, List.of(context.getGeneratedSourcesDirectory()));\n            }\n            if (context.getAnnotationProcessorPaths() != null) {\n                // Paths might be missing! (see: https://github.com/quarkusio/quarkus/issues/42908)\n                ensureDirectories(context.getAnnotationProcessorPaths());\n                this.fileManager.setLocation(StandardLocation.ANNOTATION_PROCESSOR_PATH, context.getAnnotationProcessorPaths());","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/dev/filesystem/QuarkusFileManager.java#L14-L50","documentation":"QuarkusFileManager's constructor configures the underlying JavaCompiler file manager, including setting the ANNOTATION_PROCESSOR_PATH location. An IOException there means the compiler file manager refused the location setup; it is wrapped in a RuntimeException 'Cannot initialize file manager'. Compilation cannot proceed without a working file manager.","triggerScenarios":"Constructing a QuarkusFileManager subclass where fileManager.setLocation(StandardLocation.ANNOTATION_PROCESSOR_PATH, paths) throws IOException — e.g. one of the annotation-processor path entries does not exist or is invalid, and ensureDirectories could not create it.","commonSituations":"Missing annotation-processor path entries after a partial clean (quarkusio/quarkus#42908); corrupted target/classes or processor JAR paths deleted while dev mode runs; disk errors preventing directory creation.","solutions":["Run mvn clean install (or ./mvnw compile) to recreate missing processor path directories, then restart dev mode.","Ensure all paths passed as annotationProcessorPaths exist and are writable.","Check disk space and permissions on the build directories.","Restart dev mode after a clean so the file manager is constructed with valid paths."],"exampleFix":"// before: processor path dir deleted under running dev mode\n// after (shell): mvn clean && ./mvnw quarkus:dev","handlingStrategy":"validation","validationCode":"for (File dir : context.getAnnotationProcessorPaths()) {\n    if (!dir.exists() && !dir.mkdirs())\n        throw new IllegalStateException(\"processor path missing and cannot be created: \" + dir);\n    if (!dir.canRead()) throw new IllegalStateException(\"processor path unreadable: \" + dir);\n}","typeGuard":null,"tryCatchPattern":"try {\n    new QuarkusFileManagerImpl(...);\n} catch (RuntimeException e) {\n    if (\"Cannot initialize file manager\".equals(e.getMessage())) {\n        Throwable cause = e.getCause();\n        log.errorf(\"File manager init failed: %s — rebuild to restore processor paths\", cause.getMessage());\n        // rebuild then retry construction\n    } else throw e;\n}","preventionTips":["Run a full build before starting dev mode so processor paths exist","Avoid cleaning build dirs while dev mode runs","Ensure write access to target directories and free disk space"],"tags":["compiler","annotation-processor","io","dev-mode"],"backgroundTag":"ioexception-wrapped","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"}