Repository navigation
Not Starting Up Properly Probably Due to Unix Domain Socket Length Limitations #3371
Description
Good evening! I and a couple other people on the team can say now that after upgrading to the latest VSCode Insiders / vscode-java standard/preview versions, the extension is not starting up successfully.
The "spinning" wheel keeps spinning indefinitely, and if you go to "Show Build Status" you get an absolutely empty window with no logs/status, at any point.
There are no interesting errors in any of the typical "Output" windows, for anything java. However, a Java: Open all Log Files gives at least this:
!SESSION 2023-10-30 16:02:54.536 -----------------------------------------------
eclipse.buildId=unknown
java.version=17.0.3
java.vendor=Eclipse Adoptium
BootLoader constants: OS=macosx, ARCH=aarch64, WS=cocoa, NL=en_US
Framework arguments: --pipe=/var/folders/c4/f8v01p_s2sn9_hrx6y18dlxr0000gq/T/vscode-b4e4949e2fde772119c33ebd3ad375f0e8b742abf2.sock
Command-line arguments: -data /Users/[redacted]/Library/Application Support/Code - Insiders/User/workspaceStorage/e0a072670fac3ceed984d299690f5fdc/redhat.java/jdt_ws --pipe=/var/folders/c4/f8v01p_s2sn9_hrx6y18dlxr0000gq/T/vscode-b4e4949e2fde772119c33ebd3ad375f0e8b742abf2.sock
!ENTRY org.eclipse.jdt.ls.core 1 0 2023-10-30 16:02:56.397
!MESSAGE class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is started
!ENTRY org.eclipse.jdt.ls.core 4 0 2023-10-30 16:02:56.474
!MESSAGE Unix domain path too long
!STACK 0
java.net.SocketException: Unix domain path too long
at java.base/sun.nio.ch.UnixDomainSockets.connect0(Native Method)
at java.base/sun.nio.ch.UnixDomainSockets.connect(UnixDomainSockets.java:148)
at java.base/sun.nio.ch.UnixDomainSockets.connect(UnixDomainSockets.java:144)
at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:851)
at org.eclipse.jdt.ls.core.internal.ConnectionStreamFactory$PipeStreamProvider.initializeNamedPipe(ConnectionStreamFactory.java:117)
at org.eclipse.jdt.ls.core.internal.ConnectionStreamFactory$PipeStreamProvider.<init>(ConnectionStreamFactory.java:89)
at org.eclipse.jdt.ls.core.internal.ConnectionStreamFactory.createProvider(ConnectionStreamFactory.java:269)
at org.eclipse.jdt.ls.core.internal.ConnectionStreamFactory.getSelectedStream(ConnectionStreamFactory.java:257)
at org.eclipse.jdt.ls.core.internal.ConnectionStreamFactory.getInputStream(ConnectionStreamFactory.java:275)
at org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin.startConnection(JavaLanguageServerPlugin.java:344)
at org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin.startLanguageServer(JavaLanguageServerPlugin.java:441)
at org.eclipse.jdt.ls.core.internal.LanguageServerApplication.start(LanguageServerApplication.java:54)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:651)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:588)
at org.eclipse.equinox.launcher.Main.run(Main.java:1459)
at org.eclipse.equinox.launcher.Main.main(Main.java:1432)
This makes me think like maybe something was changed where the socket lives, and when running Insiders the path just gets too big / longer than 100~ characters?
This would explain why i'm not seeing any log/error messages in "Show Build Status", since we aren't able to actually connect to the socket!
Nothing was changed between 1.23.0 and 1.24.0 over here that would make any sense, so I'm wondering if it's a VS Code Insiders issue with its temp path logic?
Environment
- Operating System: MacOS 13.5 on Silicon
- JDK version: My
java.import.gradle.java.homeandjava.jdt.ls.java.homeare at:17.0.3-tembut getting rid of these doesn't make this go away/do anything different. - Visual Studio Code version:
1.84.0-insider(No updates at the time of posting) - Java extension version:
v1.24.0and the preview one too!
Steps To Reproduce
- Have a Mac on Silicon
- Have any Java project open in VS Code Insiders w/ latest Language Server extension
- See the spinny icon spin away, and see the log above!
Current Result
Plugin does not initialize properly, with the error above, and the spinning icon continue to spin indefinitely.
Expected Result
App initalizes properly.
Activity
snjeza commentedon Oct 30, 2023
The related issue - eclipse-jdtls/eclipse.jdt.ls#2932
tthornton3-chwy commentedon Oct 30, 2023
Noice! If this is a duplicate I'm happy to close, or if it'll be good to capture it here i'm happy it staying too. Either way i've subscribed to the above, and I will happily test if there's a possible fix!
Btw:
try setting "java.transport":"stdio" in your settings.did at least semi-temporarily fix things for me, until we can try again with the new transport method!balthild commentedon Mar 20, 2025
This problem presents again in version
1.40.0. Setting"java.transport": "stdio"could fix it.Log
rgrunber commentedon Mar 21, 2025
The path is
/private/var/folders/h8/9n_pvqp529x5rqpd5wlf1xy00000gn/T/nix-shell.9H0maj/lsp-4195cf4365baf01e2d34.sock. That is 103 characters.The code ultimately calls https://github.com/openjdk/jdk21/blob/master/src/java.base/unix/native/libnio/ch/UnixDomainSockets.c#L85-L86 ( https://github.com/openjdk/jdk21/blob/890adb6410dab4606a4f26a942aed02fb2f55387/src/java.base/unix/native/libnio/ch/nio_util.h#L54-L56 ). I believe
sun_pathis held withsys/un.h. According to https://developer.apple.com/documentation/kernel/sockaddr_un/1541426-sun_path , the value is 104, so that makesMAX_UNIX_DOMAIN_PATH_LENhave a value of 102.Yes, switching to
stdiois a workaround. Technically there is code to detect this error and auto-switch tostdiobut I'm guessing the safe limit on Darwin is hard-coded to 103 and so your path doesn't trigger it (the limit should be 102 but I'm guessing that's not taken into account).Does your system have
XDG_RUNTIME_DIRenvironment variable point to/private/var/folders/...? Would you be able to shorten that environment variable ?balthild commentedon Mar 21, 2025
There's no
XDG_RUNTIME_DIRdefined. The java environment is managed bynix-direnvso I think I cannot shorten it (actually I don't know how it is implemented and why the sock is placed there...)