{"record":{"id":"cca29248e058faf2","repo":"projectlombok/lombok","slug":"cannot-obtain-canonical-path-to-parent-directory","errorCode":null,"errorMessage":"Cannot obtain canonical path to parent directory","messagePattern":"Cannot obtain canonical path to parent directory","errorType":"console","errorClass":"InvalidCommandLineException","httpStatus":null,"severity":"error","filePath":"src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java","lineNumber":93,"sourceCode":"\t\t\tlaunchContent.append(\"\\t<listAttribute key=\\\"org.eclipse.debug.ui.favoriteGroups\\\">\\n\");\n\t\t\tlaunchContent.append(\"\\t\\t<listEntry value=\\\"org.eclipse.debug.ui.launchGroup.debug\\\"/>\\n\");\n\t\t\tlaunchContent.append(\"\\t</listAttribute>\\n\");\n\t\t}\n\t\t\n\t\tlaunchContent.append(\"\\t<stringAttribute key=\\\"org.eclipse.jdt.junit.CONTAINER\\\" value=\\\"\\\"/>\\n\");\n\t\tlaunchContent.append(\"\\t<booleanAttribute key=\\\"org.eclipse.jdt.junit.KEEPRUNNING_ATTR\\\" value=\\\"false\\\"/>\\n\");\n\t\tlaunchContent.append(\"\\t<stringAttribute key=\\\"org.eclipse.jdt.junit.TESTNAME\\\" value=\\\"\\\"/>\\n\");\n\t\tlaunchContent.append(\"\\t<stringAttribute key=\\\"org.eclipse.jdt.junit.TEST_KIND\\\" value=\\\"org.eclipse.jdt.junit.loader.junit4\\\"/>\\n\");\n\t\tlaunchContent.append(\"\\t<booleanAttribute key=\\\"org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD\\\" value=\\\"true\\\"/>\\n\");\n\t}\n\t\n\tprivate void classpath() throws InvalidCommandLineException {\n\t\tlaunchContent.append(\"\\t<listAttribute key=\\\"org.eclipse.jdt.launching.CLASSPATH\\\">\\n\");\n\t\t\n\t\tString self; try {\n\t\t\tself = new File(\"..\").getCanonicalPath();\n\t\t} catch (IOException e) {\n\t\t\tthrow new InvalidCommandLineException(\"Cannot obtain canonical path to parent directory\", e);\n\t\t}\n\t\t\n\t\tString bootpath = getBootPath();\n\t\t\n\t\tlaunchContent.append(\"\\t\\t<listEntry value=\\\"&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/lombok/bin/main&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;\\\"/>\\n\");\n\t\tfor (Map.Entry<String, String> entry : args.entrySet()) {\n\t\t\tif (!entry.getKey().startsWith(\"conf.\")) continue;\n\t\t\tString v = entry.getValue();\n\t\t\tif (v.equals(\"NONE\")) continue;\n\t\t\tString[] files = v.split(Pattern.quote(File.pathSeparator));\n\t\t\tfor (String file : files) {\n\t\t\t\tString n;\n\t\t\t\ttry {\n\t\t\t\t\tn = new File(file).getCanonicalPath();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InvalidCommandLineException(\"Cannot obtain canonical path to dependency \" + file, e);\n\t\t\t\t}\n\t\t\t\tif (n.startsWith(self)) {","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/projectlombok/lombok/blob/6d6a3e9fec0a9555702561fbeb8eac836575116e/src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java#L75-L111","documentation":"CreateEclipseDebugTarget builds an Eclipse launch configuration file and needs the canonical path of the parent directory ('..'). If File.getCanonicalPath() throws IOException, it throws InvalidCommandLineException with this message.","triggerScenarios":"Running the lombok eclipse debug-target creation tool from a directory whose '..' cannot be resolved canonically (deleted cwd, IO failure resolving symlinks).","commonSituations":"Invoking the tool from a removed working directory, unusual mounts, or permission-restricted filesystems.","solutions":["Run the tool from an existing, valid working directory","Check that the parent directory exists and is readable","Inspect the wrapped IOException cause for the real reason","Avoid symlinked or network mounts if canonicalization keeps failing"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"File parent = new File(\"..\");\nif (!parent.exists()) throw new IllegalStateException(\"cwd/parent missing; cd to a valid directory first\");","typeGuard":null,"tryCatchPattern":"try { tool.go(); } catch (InvalidCommandLineException e) { if (e.getMessage().contains(\"canonical path\")) { log(\"Run from a valid, existing directory\"); } throw e; }","preventionTips":["Launch the tool from an existing project directory","Avoid running from deleted or network-mounted paths","Check cwd validity in wrapper scripts before invoking","If canonicalization keeps failing, log cwd and inspect the wrapped IOException cause"],"tags":["java","eclipse","io","launch-config"],"backgroundTag":"directory-not-found","analyzedSha":"6d6a3e9fec0a9555702561fbeb8eac836575116e","analyzedAt":"2026-09-07T23:18:01.841Z","contentChangedAt":"2026-09-07T23:18:01.841Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}