{"record":{"id":"5cd40a9a38c995bc","repo":"eclipse-vertx/vert.x","slug":"cachedir-has-been-removed-fileresolver-is-closing","errorCode":null,"errorMessage":"cacheDir has been removed. FileResolver is closing?","messagePattern":"cacheDir has been removed\\. FileResolver is closing\\?","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/file/impl/FileCache.java","lineNumber":252,"sourceCode":"    }\n  }\n\n  void cacheDir(String fileName) throws IOException {\n    File file = new File(getCacheDir(), fileName);\n    fileNameCheck(file);\n    file.mkdirs();\n  }\n\n  private void fileNameCheck(File file) throws IOException {\n    if (!file.getCanonicalFile().toPath().startsWith(getCacheDir().toPath())) {\n      throw new VertxException(\"File is outside of the cacheDir dir: \" + file);\n    }\n  }\n\n  private File getCacheDir() {\n    File currentCacheDir = cacheDir;\n    if (currentCacheDir == null) {\n      throw new IllegalStateException(\"cacheDir has been removed. FileResolver is closing?\");\n    }\n    return currentCacheDir;\n  }\n}\n","sourceCodeStart":234,"sourceCodeEnd":257,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/file/impl/FileCache.java#L234-L257","documentation":"Lifecycle guard in FileCache.getCacheDir: the internal cacheDir reference has been nulled (set to null) because the FileResolver that owns this cache is closing/shut down. Any cache operation reaching this method after shutdown fails fast instead of using a removed directory; the message is a sentinel, no dynamic input.","triggerScenarios":"Thrown at vertx-core/src/main/java/io/vertx/core/file/impl/FileCache.java:252 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Stop issuing file resolution/caching operations before closing the FileResolver/Vertx","Check the Vertx/FileResolver lifecycle and order shutdown after all file work completes"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fb308bd8c3f12c79f4ae89bef67fadf6c80d036e","analyzedAt":"2026-09-06T11:37:12.241Z","contentChangedAt":"2026-09-06T11:37:12.241Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}