{"record":{"id":"00fcb4b3bb42c3b7","repo":"eclipse-vertx/vert.x","slug":"cannot-get-canonical-name-of-cachedir","errorCode":null,"errorMessage":"Cannot get canonical name of cacheDir","messagePattern":"Cannot get canonical name of cacheDir","errorType":"exception","errorClass":"VertxException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/file/impl/FileCache.java","lineNumber":99,"sourceCode":"    int suffix = 2;\n    while (true) {\n      String candidatePath = basePath + \"-\" + suffix;\n      File candidate = new File(candidatePath);\n      if (!candidate.exists()) {\n        return candidatePath;\n      }\n      suffix++;\n    }\n  }\n\n  private Thread shutdownHook;\n  private File cacheDir;\n\n  public FileCache(File cacheDir) {\n    try {\n      this.cacheDir = cacheDir.getCanonicalFile();\n    } catch (IOException e) {\n      throw new VertxException(\"Cannot get canonical name of cacheDir\", e);\n    }\n  }\n\n  synchronized void registerShutdownHook() {\n    Thread shutdownHook = new Thread(this::runHook);\n    this.shutdownHook = shutdownHook;\n    Runtime.getRuntime().addShutdownHook(shutdownHook);\n  }\n\n  private void runHook() {\n    synchronized (this) {\n      // no-op if cache dir has been set to null\n      if (cacheDir == null) {\n        return;\n      }\n    }\n    Thread deleteCacheDirThread = new Thread(() -> {\n      try {","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/file/impl/FileCache.java#L81-L117","documentation":"Construction failure in the FileCache constructor: File.getCanonicalFile() threw an IOException, so the cache directory's canonical path could not be resolved (typically an I/O error or unresolvable path). The VertxException wraps the original cause; the input at fault is the cacheDir File passed in.","triggerScenarios":"Thrown at vertx-core/src/main/java/io/vertx/core/file/impl/FileCache.java:99 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped cause for the underlying I/O problem","Verify the cache directory path is valid and reachable","Set vertx.cacheDirBase to a simpler, existing path"],"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-14T00:17:10.932Z"}