{"record":{"id":"e0e176225804908e","repo":"quarkusio/quarkus","slug":"cannot-reset-file-manager","errorCode":null,"errorMessage":"Cannot reset file manager","messagePattern":"Cannot reset file manager","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/dev/filesystem/QuarkusFileManager.java","lineNumber":53,"sourceCode":"\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());\n            }\n        } catch (IOException e) {\n            throw new RuntimeException(\"Cannot reset file manager\", e);\n        }\n    }\n\n    private void ensureDirectories(Iterable<File> directories) {\n        for (File directory : directories) {\n            ensureDirectory(directory);\n        }\n    }\n\n    private void ensureDirectory(File directory) {\n        if (!directory.exists()) {\n            if (!directory.mkdirs()) {\n                throw new RuntimeException(\"Cannot create directory \" + directory);\n            }\n        }\n    }\n\n    @Override","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/dev/filesystem/QuarkusFileManager.java#L35-L71","documentation":"QuarkusFileManager.reset re-applies the compiler context to the existing file manager, including the ANNOTATION_PROCESSOR_PATH location. An IOException there is wrapped in RuntimeException 'Cannot reset file manager'. This happens on live-reload recompilation when the processor path became invalid between compilations.","triggerScenarios":"Calling reset(context) where setLocation(ANNOTATION_PROCESSOR_PATH, context.getAnnotationProcessorPaths()) throws IOException — typically a processor-path directory/JAR vanished or became unusable since construction.","commonSituations":"mvn clean executed while dev mode is running; antivirus or IDE locks making paths unreadable; quarkusio/quarkus#42908 scenario where processor paths are missing; out-of-disk conditions.","solutions":["Stop dev mode, run mvn clean install, and restart dev mode so paths exist before reset.","Ensure annotation-processor paths exist and are writable before triggering recompilation.","Avoid running mvn clean concurrently with quarkus:dev; use dev-mode tooling to clean instead.","Check disk space / AV interference on the build directory."],"exampleFix":"// before: target/ wiped while dev mode live-reloads -> reset throws\n// after: ./mvnw quarkus:dev (restart) instead of mvn clean during dev mode","handlingStrategy":"try-catch","validationCode":"for (File dir : context.getAnnotationProcessorPaths()) {\n    if (!dir.canRead()) throw new IllegalStateException(\"processor path unreadable before reset: \" + dir);\n}","typeGuard":null,"tryCatchPattern":"try {\n    fileManager.reset(context);\n} catch (RuntimeException e) {\n    if (\"Cannot reset file manager\".equals(e.getMessage())) {\n        Throwable cause = e.getCause();\n        log.errorf(\"Reset failed: %s — recreate processor paths and restart dev mode\", cause.getMessage());\n        // rebuild project and restart quarkus:dev\n    } else throw e;\n}","preventionTips":["Do not run mvn clean while quarkus:dev is active","Verify processor paths exist before triggering live reload","Watch disk space and AV scanners on target/"],"tags":["compiler","annotation-processor","io","live-reload"],"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"}