biomejs / biome

A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.
https://biomejs.dev
Apache License 2.0
15.19k stars 473 forks source link

🐛 Multiple VS Code sessions causing an error #131

Closed tcneuen closed 10 months ago

tcneuen commented 1 year ago

Environment information

CLI:
  Version:                      1.0.0
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v18.17.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "yarn/3.6.2"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 true

Workspace:
  Open Documents:               0

CLI:
  Version:                      1.0.0
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v18.17.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "yarn/3.6.2"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 true

Workspace:
  Open Documents:               0

Discovering running Biome servers...

Incompatible Biome Server: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

ℹ Rage discovered this running server using an incompatible version of Biome.

Server:
  Version:                      <=10.0.0

What happened?

  1. user1 starts VS Code with remote connection to Ubuntu Server 22.04.3 LTS
  2. user2 starts VS Code with remote connection to Ubuntu Server 22.04.3 LTS
  3. user2 receives permissions error relating to connecting to the the existing LSP

    [cli-stderr] data 216
    [cli-stderr] end
    [cli-stdout] end
    [cli] exit 1
    [Error - 11:56:39 AM] Biome client: couldn't create connection to server.
    Error: Command "/home/user2/.vscode-server/extensions/biomejs.biome-1.0.1-linux-x64/server/biome __print_socket" exited with code 1
    Output:
    internalError/io ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    
    × Errors occurred while executing I/O operations.
    
    Caused by:
      Permission denied (os error 13)
    
    at getSocket (/home/user2/.vscode-server/extensions/biomejs.biome-1.0.1-linux-x64/out/main.js:19599:11)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async createMessageTransports (/home/user2/.vscode-server/extensions/biomejs.biome-1.0.1-linux-x64/out/main.js:19614:16)
    at async LanguageClient2.createConnection (/home/user2/.vscode-server/extensions/biomejs.biome-1.0.1-linux-x64/out/main.js:15576:28)
    at async LanguageClient2.start (/home/user2/.vscode-server/extensions/biomejs.biome-1.0.1-linux-x64/out/main.js:15152:30)
    at async activate (/home/user2/.vscode-server/extensions/biomejs.biome-1.0.1-linux-x64/out/main.js:19406:3)
    at async p.n (/home/user2/.vscode-server/bin/6c3e3dba23e8fadc360aed75ce363ba185c49794/out/vs/workbench/api/node/extensionHostProcess.js:103:6206)
    at async p.m (/home/user2/.vscode-server/bin/6c3e3dba23e8fadc360aed75ce363ba185c49794/out/vs/workbench/api/node/extensionHostProcess.js:103:6169)
    at async p.l (/home/user2/.vscode-server/bin/6c3e3dba23e8fadc360aed75ce363ba185c49794/out/vs/workbench/api/node/extensionHostProcess.js:103:5626)
    [cli-stdout] close
    [cli] close 1
    [cli-stderr] close

Expected result

LSP would be started under a different socket/port and connected normally.

Code of Conduct

tcneuen commented 1 year ago

Forgive me if there is a setting or something I am missing that would properly handle this, but for speed & simplicity purposes another user & myself use an Ubuntu 22.04.3 server as our dev server which appears to be causing issues.

After converting from eslint/prettier I got everything working aside from quirkiness caused by yarn pnp. I can work around that and just keep a binary somewhere consistent, but when the other user logged on to install the biome extension and try out the new tools his errored and doesn't connect.

Based on the error I was guessing this was a socket conflict issue with both LSP's fighting over the same connection.

Let me know if there is anything else that could assist with this issue.

ematipico commented 1 year ago

This is a use case that we haven't encountered so far, so this may be a valid issue.

Based on the error I was guessing this was a socket conflict issue with both LSP's fighting over the same connection.

Yes, that's likely the issue. We don't actually check if there's already a connection active. That would require some change, but I ma not an expert, so I can't provide a quick fix at the moment.

ematipico commented 10 months ago

The fix will be available in the next release