eclipse-platform / eclipse.platform.ui

Eclipse Platform
https://projects.eclipse.org/projects/eclipse.platform
Eclipse Public License 2.0
81 stars 182 forks source link

Could not write lock info file #2423

Open jonahgraham opened 2 hours ago

jonahgraham commented 2 hours ago

Let's make sure issue is not already fixed in latest builds first.

Starting Eclipse on Windows now has an exception about writing lock file (see log below). The IDE starts properly on quick inspection, but not sure if there are other side effects.

Steps to reproduce

From a fresh installation and clean workspace:

Here is some relevant log output

From <workspace>/.metadata/.log

!ENTRY org.eclipse.ui.ide 4 4 2024-10-18 19:30:09.343
!MESSAGE Could not write lock info file
!STACK 0
java.nio.file.InvalidPathException: Illegal char <:> at index 2: /C:/Users/Jonah/eclipse/cdt-main/runtime-EclipseApplication/\.metadata\.lock_info
    at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:204)
    at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:175)
    at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
    at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
    at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:231)
    at java.base/java.nio.file.Path.of(Path.java:148)
    at org.eclipse.ui.internal.ide.application.IDEApplication.getLockInfoFile(IDEApplication.java:527)
    at org.eclipse.ui.internal.ide.application.IDEApplication.createLockInfoFile(IDEApplication.java:538)
    at org.eclipse.ui.internal.ide.application.IDEApplication.writeWsLockInfo(IDEApplication.java:471)
    at org.eclipse.ui.internal.ide.application.IDEApplication.checkInstanceLocation(IDEApplication.java:251)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:165)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1481)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1454)

Tested under this environment:

Community

jonahgraham commented 2 hours ago

Looking briefly at the code and error I think the handling of paths in the new code from #2347 is different from the older code. The newer code is using java.nio classes like Path and the old code relied on java.io.File for path handling. On Linux this seems to make little difference, but on Windows there seems to be a problem in how it is handled?

jonahgraham commented 2 hours ago

I saw this first in development environment, but running just a freshly downloaded SDK shows the problem too:

command line and output from sdk ``` PS C:\Users\Jonah\eclipse\sdk-latest\eclipse> .\eclipsec -data data -consoleLog CompileCommand: exclude org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.getExtendedRange bool exclude = true WARNING: Using incubator modules: jdk.incubator.vector Oct 18, 2024 7:45:45 P.M. org.apache.aries.spifly.BaseActivator log INFO: Registered provider org.slf4j.simple.SimpleServiceProvider of service org.slf4j.spi.SLF4JServiceProvider in bundle slf4j.simple !SESSION 2024-10-18 19:45:44.545 ----------------------------------------------- eclipse.buildId=4.34.0.I20241018-0730 java.version=21.0.4 java.vendor=Eclipse Adoptium BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_CA Command-line arguments: -os win32 -ws win32 -arch x86_64 -data data -consoleLog !ENTRY org.eclipse.ui.ide 4 4 2024-10-18 19:45:47.361 !MESSAGE Could not write lock info file !ENTRY org.eclipse.ui.ide 4 4 2024-10-18 19:45:47.363 !MESSAGE Could not write lock info file !STACK 0 java.nio.file.InvalidPathException: Illegal char <:> at index 2: /C:/Users/Jonah/eclipse/sdk-latest/eclipse/data/\.metadata\.lock_info at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:204) at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:175) at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77) at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92) at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:231) at java.base/java.nio.file.Path.of(Path.java:148) at org.eclipse.ui.internal.ide.application.IDEApplication.getLockInfoFile(IDEApplication.java:527) at org.eclipse.ui.internal.ide.application.IDEApplication.createLockInfoFile(IDEApplication.java:538) at org.eclipse.ui.internal.ide.application.IDEApplication.writeWsLockInfo(IDEApplication.java:471) at org.eclipse.ui.internal.ide.application.IDEApplication.checkInstanceLocation(IDEApplication.java:251) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:165) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605) at org.eclipse.equinox.launcher.Main.run(Main.java:1481) ```