Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Blocker] With latest pre-release versions LS doesn't start-up on apple aarch64 platform #2932

Closed
gayanper opened this issue Oct 27, 2023 · 7 comments
Assignees
Labels

Comments

@gayanper
Copy link
Contributor

SESSION 2023-10-27 11:31:53.362 -----------------------------------------------
eclipse.buildId=unknown
java.version=17.0.8.1
java.vendor=Eclipse Adoptium
BootLoader constants: OS=macosx, ARCH=aarch64, WS=cocoa, NL=en_NO
Framework arguments:  --pipe=/var/folders/83/jn6q9_z14wb06_jx8jgvd7l80000gn/T/vscode-287c96db533ec944b375323466e37f2dcda3b791e2.sock
Command-line arguments:  -data /Users/<username>/Library/Application Support/Code/User/workspaceStorage/10faf2cd4fb8ef44ba05f2d917daba2d/redhat.java/jdt_ws --pipe=/var/folders/83/jn6q9_z14wb06_jx8jgvd7l80000gn/T/vscode-287c96db533ec944b375323466e37f2dcda3b791e2.sock

!ENTRY org.eclipse.jdt.ls.core 1 0 2023-10-27 11:31:55.269
!MESSAGE class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is started

!ENTRY org.eclipse.jdt.ls.core 4 0 2023-10-27 11:31:55.325
!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(Unknown Source)
	at java.base/sun.nio.ch.UnixDomainSockets.connect(Unknown Source)
	at java.base/sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
	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(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	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)

!ENTRY org.eclipse.equinox.launcher.cocoa.macosx.x86_64 2 0 2023-10-27 11:31:55.335
!MESSAGE Could not resolve module: org.eclipse.equinox.launcher.cocoa.macosx.x86_64 [37]
  Unresolved requirement: Require-Capability: eclipse.platform; filter:="(& (osgi.ws=cocoa) (osgi.os=macosx) (osgi.arch=x86_64) )"
  Unresolved requirement: Require-Capability: eclipse.platform; filter:="(& (osgi.ws=cocoa) (osgi.os=macosx) (osgi.arch=x86_64) )"


!ENTRY org.eclipse.osgi 4 0 2023-10-27 11:31:55.344
!MESSAGE Application error
!STACK 1
java.lang.IllegalStateException: Input stream must be configured.
	at org.eclipse.lsp4j.jsonrpc.Launcher$Builder.create(Launcher.java:310)
	at org.eclipse.lsp4j.jsonrpc.Launcher.createIoLauncher(Launcher.java:125)
	at org.eclipse.lsp4j.jsonrpc.Launcher.createLauncher(Launcher.java:101)
	at org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin.startConnection(JavaLanguageServerPlugin.java:352)
	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(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	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)

!ENTRY org.eclipse.jdt.ls.core 1 0 2023-10-27 11:31:55.353
!MESSAGE class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is stopping:

Extension Version: v1.25.2023102704

@fbricon
Copy link
Contributor

fbricon commented Oct 27, 2023

Caused by redhat-developer/vscode-java#3355.

try setting "java.transport":"stdio" in your settings.

@rgrunber
Copy link
Contributor

rgrunber commented Oct 30, 2023

https://github.com/microsoft/vscode-languageserver-node/blob/release/client/8.1.0/jsonrpc/src/node/main.ts#L170-L173

This might be better filed under vscode-java since JDT-LS has no control over the file path used for socket/pipe communication. Looking at https://github.com/microsoft/vscode-languageserver-node/blob/release/client/8.1.0/jsonrpc/src/node/main.ts#L175-L193 I'm thinking of a few things :

  1. We could ask vscode-languageserver-node (the library vscode-java uses for communication) if they could reduce the random suffix (21-byte gets converted to a 42 char hex).
  2. As a workaround (we can't just wait for an update) we could remove the XDG_RUNTIME_DIR (should be safe?) env from being passed in at https://github.com/redhat-developer/vscode-java/blob/6b472aea270ca024007c383e1d37b924ba1c0087/src/javaServerStarter.ts#L40 (it appears tmpdir would be shorter) . I would think that should shorten the path enough based on the path you've provided. @gayanper , can you verify what that is on the system :
    eg.
$ env | grep XDG_RUNTIME_DIR
XDG_RUNTIME_DIR=/run/user/1000

Is it something like /var/folders/83/jn6q9_z14wb06_jx8jgvd7l80000gn/T/ ?

Update: Shortening the data dir folder seems to be the guidance in VS Code itself

@testforstephen
Copy link
Contributor

As a workaround (we can't just wait for an update) we could remove the XDG_RUNTIME_DIR (should be safe?) env from being passed in at https://github.com/redhat-developer/vscode-java/blob/6b472aea270ca024007c383e1d37b924ba1c0087/src/javaServerStarter.ts#L40 (it appears tmpdir would be shorter) . I would think that should shorten the path enough based on the path you've provided. @gayanper , can you verify what that is on the system :

The pipe path for this issue is vscode-287c96db533ec944b375323466e37f2dcda3b791e2.sock, which seems not to be related to XDG_RUNTIME_DIR. See the language client code at https://github.com/microsoft/vscode-languageserver-node/blob/release/client/8.1.0/jsonrpc/src/node/main.ts#L185, the name style is obtained from os.tmpdir().

image

Another weird thing is the pipe path length for this issue is 103 characters, which is within the macOS limit (103 bytes). This indicates that the domain socket path limit might be lower on Apple Silicon. Anyway, let's create an issue on the language client first.

@testforstephen
Copy link
Contributor

Another weird thing is the pipe path length for this issue is 103 characters, which is within the macOS limit (103 bytes).

See nodejs/node#11422, it turns out the generated pipe path /var/folders/... is a symlink, which points to a longer path /private/var/folders/.... That's why it exceeds 103 characters.

I have created an issue microsoft/vscode-languageserver-node#1346 in the upstream language client. Before the upstream fix is ready, a possible temp workaround for us is to set a shorter path via env.TMPDIR, which is used by os.tmpdir() to get the temporary directory (See https://github.com/nodejs/node/blob/aa4248dc84671beb9400c0b64a9e87d92042f54e/lib/os.js#L191). However, this might affect other parts of the system that rely on os.tmpdir().

@rgrunber
Copy link
Contributor

rgrunber commented Nov 3, 2023

Looks like we should be able to update to vscode-languageclient 8.2.0-next.3 & vscode-jsonrpc 8.2.1-next.1 , which should have the needed changes.

@rgrunber
Copy link
Contributor

rgrunber commented Nov 9, 2023

This should be fixed now in the latest pre-release. Feel free to re-open if there are still issues.

@rgrunber rgrunber closed this as completed Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants