{"record":{"id":"cc5be5cb0daee353","repo":"quarkusio/quarkus","slug":"unable-to-validate-the-application-root-for-remote","errorCode":null,"errorMessage":"Unable to validate the application root for remote-dev path: <file>","messagePattern":"Unable to validate the application root for remote-dev path: <file>","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java","lineNumber":476,"sourceCode":"    private Path resolveApplicationPath(String file) {\n        file = normalizeFile(file);\n        Path normalizedRoot = applicationRoot.toAbsolutePath().normalize();\n        Path relativePath = Path.of(file);\n        Path resolved = normalizedRoot.resolve(relativePath).normalize();\n        if (relativePath.isAbsolute() || resolved.equals(normalizedRoot) || !resolved.startsWith(normalizedRoot)\n                || file.length() >= 2 && file.charAt(1) == ':') {\n            throw new IllegalArgumentException(\"Path is not below the application root: \" + file);\n        }\n        validateExistingPathComponents(normalizedRoot, resolved, file);\n        return resolved;\n    }\n\n    private static void validateExistingPathComponents(Path normalizedRoot, Path resolved, String file) {\n        final Path realRoot;\n        try {\n            realRoot = normalizedRoot.toRealPath();\n        } catch (IOException e) {\n            throw new IllegalArgumentException(\"Unable to validate the application root for remote-dev path: \" + file, e);\n        }\n        Path current = normalizedRoot;\n        for (Path element : normalizedRoot.relativize(resolved)) {\n            current = current.resolve(element);\n            if (Files.isSymbolicLink(current)) {\n                throw new IllegalArgumentException(\"Symbolic links are not allowed in remote-dev paths: \" + file);\n            }\n            if (Files.exists(current, LinkOption.NOFOLLOW_LINKS)) {\n                try {\n                    if (!current.toRealPath().startsWith(realRoot)) {\n                        throw new IllegalArgumentException(\"Path leaves the application root: \" + file);\n                    }\n                } catch (IOException e) {\n                    throw new IllegalArgumentException(\"Unable to validate remote-dev path: \" + file, e);\n                }\n            } else {\n                break;\n            }","sourceCodeStart":458,"sourceCodeEnd":494,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java#L458-L494","documentation":"validateExistingPathComponents resolves the application root to its real path; if that fails (IOException from the filesystem), it throws this IllegalArgumentException. The server cannot verify remote-dev path safety without resolving the real root, so it refuses the operation.","triggerScenarios":"updateFile or resolveApplicationPath invoking validation while normalizedRoot.toRealPath() throws IOException — e.g. the application root directory was deleted/moved after startup, a permissions error prevents stat, or a filesystem error occurred mid-traversal.","commonSituations":"Dev server running with the build directory deleted underneath it (mvn clean while running); network-mounted root temporarily unavailable; permission changes locking out the user.","solutions":["Recreate or restore the application root directory.","Restart the dev server so applicationRoot points at an existing directory.","Check permissions on every component of the application root path.","Verify the storage backing the root (NFS/EFS) is reachable."],"exampleFix":"// before: root deleted while server runs -> toRealPath() fails\n// after (server shell): mkdir -p target/classes && restart quarkus:dev","handlingStrategy":"validation","validationCode":"Path root = Path.of(\".\").toAbsolutePath().normalize();\nif (!Files.isDirectory(root)) throw new IllegalStateException(\"application root missing: \" + root);\ntry { root.toRealPath(); } catch (IOException e) { throw new IllegalStateException(\"cannot resolve real path of root\", e); }","typeGuard":null,"tryCatchPattern":"try {\n    client.sync(path);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Unable to validate the application root\")) {\n        log.error(\"Application root missing/unreachable on server — restore it or restart dev mode\");\n    } else throw e;\n}","preventionTips":["Do not delete or move the application root while remote-dev server runs","Ensure permissions allow stat on the whole root path","Keep backing storage (NFS/EFS) reachable"],"tags":["io","remote-dev","validation","filesystem"],"backgroundTag":"ioexception-wrapped","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}