Closed krzysid closed 1 year ago
Thanks for the detailed information. The void linux is currently unsupported for MATLAB (and VS Code) but we can try few things to narrow this down.
my guess is that there is some level of security on your system that is preventing our connection from LSP to MATLAB on your box. to narrow it down more, try these steps:
sudo lsof -i -P -n > lsof.txt
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME ...ENTRIES... MATLAB 1871305 userA 1120u IPv4 405765103 0t0 TCP 127.0.0.1:35737 (LISTEN)
curl -v -k https://127.0.0.1:35737
Hello, this is the curl
output:
* Trying 127.0.0.1:40721...
* Connected to 127.0.0.1 (127.0.0.1) port 40721 (#0)
* ALPN: offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN: server did not agree on a protocol. Uses default.
* Server certificate:
* subject: C=US; O=company; CN=127.0.0.1; OU=engineering
* start date: Aug 18 12:56:23 2023 GMT
* expire date: Aug 17 12:56:23 2024 GMT
* issuer: C=US; O=company; CN=127.0.0.1; OU=engineering
* SSL certificate verify result: self signed certificate (18), continuing anyway.
* using HTTP/1.x
> GET / HTTP/1.1
> Host: 127.0.0.1:40721
> User-Agent: curl/8.1.2
> Accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
< HTTP/1.1 200 OK
< Date: Fri, 18 Aug 2023 12:58:28 GMT
< Connection: Keep-Alive
< Last-Modified: Thu, 31 Mar 2016 17:30:20 GMT
< ETag: "1459445420211"
< Content-Length: 211
< X-Content-Security-Policy: default-src 'self' *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https://localhost:* https://127.0.0.1:*; style-src 'self' 'unsafe-inline' *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https://localhost:* https://127.0.0.1:*; script-src 'self' 'unsafe-inline' 'unsafe-eval' *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https://localhost:* https://127.0.0.1:*; img-src 'self' blob *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https://localhost:* https://127.0.0.1:* data:; font-src 'self' *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https://localhost:* https://127.0.0.1:* data:; frame-ancestors 'self' *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https://localhost:* https://127.0.0.1:*; frame-src 'self' https://www.getfeedback.com *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https://localhost:* https://127.0.0.1:*; connect-src 'self' *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https://localhost:* https://127.0.0.1:* wss://localhost:* wss://127.0.0.1:*
< Cache-Control: no-cache, no-store, must-revalidate
< Accept-Ranges: bytes
< X-Frame-Options: sameorigin
< Referrer-Policy: strict-origin
< Content-Security-Policy: default-src 'self' *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https://localhost:* https://127.0.0.1:*; style-src 'self' 'unsafe-inline' *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https://localhost:* https://127.0.0.1:*; script-src 'self' 'unsafe-inline' 'unsafe-eval' *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https://localhost:* https://127.0.0.1:*; img-src 'self' blob *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https://localhost:* https://127.0.0.1:* data:; font-src 'self' *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https://localhost:* https://127.0.0.1:* data:; frame-ancestors 'self' *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https://localhost:* https://127.0.0.1:*; frame-src 'self' https://www.getfeedback.com *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https://localhost:* https://127.0.0.1:*; connect-src 'self' *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https://localhost:* https://127.0.0.1:* wss://localhost:* wss://127.0.0.1:*
< Strict-Transport-Security: max-age=31536000; includeSubDomains
< Content-Type: text/html
< X-Content-Type-Options: nosniff
< Pragma: no-cache
< X-XSS-Protection: 1; mode=block
< Expires: Wed, 21 Oct 2015 07:28:00 GMT
< Set-Cookie: JSESSIONID2=DbMwIS0mRwRjkmS3; Path=/; HttpOnly; Secure; SameSite=None
<
<!doctype html>
<html>
<head>
<title>connector service</title>
<link href="/css/connector.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>The connector service is running.</h1>
</body>
</html>
* Connection #0 to host 127.0.0.1 left intact
I got the same issue using arch. For me, it does work on vscode. Same curl response as @krzysid. I will try to bisect the server's commits, I had it working a few months ago.
I thought it was breaking the connection because the response's name of the workspace/workspaceFolders
method had slashes unlike the vscode's response. But it was not the case, I tested it with the exact response.
Another thing to consider is whether the client needs to wait the matlab/connection/update/server
with connected
status before doing anything.
Alright, I found the problem! This LSP server doesn't work on newer versions of node (I was running 19.5.0). It does work on the version shipped with electron: 16.17.1
. That's why vscode worked and nvim did not.
@hamidingit Probably something inside MatlabCommunicationManager.js
.
Thanks @tiagovla for the investigation and narrowing it down!
it appears that the MATLAB language server component is impacted by newer version of Node ( most likely starting from v18.x ). The impact to user base is like this:
we are currently investigating this issue and will update this thread. For the meantime, if you are using VS Code, try to stay on v1.7x or lower versions until this is addressed. if you are using other IDEs like Neovim, try to use node version 16.x
This issue should be resolved now (e6e87cc) in v1.1.5 of the language server, and has been released in v1.1.3 of the VS Code extension.
Please let me know if you still experience this issue after updating. For now, I am closing this issue.
I get similar symptoms on Apple Silicon macOS with Matlab R2023b and Matlab vscode version 1.1.6.
(Same error message in vscode Matlab extension, similar curl HTML output).
matlabls server is visible from curl and web browser like users posted above.
Version: 1.86.0
Commit: 05047486b6df5eb8d44b2ecd70ea3bdf775fd937
Date: 2024-01-31T10:29:15.765Z
Electron: 27.2.3
ElectronBuildId: 26495564
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 23.3.0
On WIndows with Matlab R2023b, VScode 1.86.0 and Matlab extension v1.1.6:
Matlab grey window opens when I open .m script in VScode with animated Matlab L-shell logo repeating endlessly. I can open another Matlab desktop or invoke Matlab from the command line normally matlab -batch
or similar.
@scivision - it sounds like you might be using the New Desktop for MATLAB Beta. If so, there is currently a limitation which prevents the MATLAB Language Server from working with the New Desktop. This is currently being worked on, and is tracked here: mathworks/MATLAB-extension-for-vscode#24
@dklilley thanks switching to old desktop did indeed fix the problem.
The server seems to fail to refuse to connect to matlab on my machine. A few seconds after starting it just spits out
WARNING: Error while communicating with MATLAB - disconnecting
. I'm not sure what the issue is. MATLAB runs, as I can see it in htop (and is still running after the above message), and there there are normal-looking logs in the/tmp/matlabls_*
directories, as well as thematlabls_conn.js
file. Example MATLAB log:I'm using Void Linux. I'm using Neovim with Mason and nvim-lspconfig, but after a short test it doesn't seem to work in vscode either.
Relevant snippet of configuration:
What might the issue be? MATLAB takes a while (around ~20 seconds) to start on my machine, so perhaps a timeout?