tools icon indicating copy to clipboard operation
tools copied to clipboard

πŸ› rome daemon stuck in a weird state

Open karimsa opened this issue 2 years ago β€’ 7 comments

Environment information

CLI:
  Version:                      12.0.0
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  ROME_LOG_DIR:                 unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v18.16.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "yarn/3.5.0"

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

Workspace:
  Open Documents:               0

Discovering running Rome servers...

Running Rome Server: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

β„Ή The client isn't connected to any server but rage discovered this running Rome server.

Server:
  Version:                      12.0.0
  Name:                         k
  CPU Architecture:             aarch64
  OS:                           macos

Workspace:
  Open Documents:               0

Rome Server Log:

⚠ Please review the content of the log file before sharing it publicly as it may contain sensitive information:
  * Path names that may reveal your name, a project name, or the name of your employer.
  * Source code

┐rome_cli::commands::daemon::Running Server{pid=99812}
β”œβ”€50ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€β”rome_lsp::server::initialize{capabilities=ClientCapabilities { workspace: None, text_document: None, window: None, general: None, experimental: None }, client_info=ClientInfo { name: "rome_service", version: Some("12.0.0") }}
β”‚ β”œβ”€0ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€β”˜
β”œβ”€β”rome_lsp::server::rome/rage{params=RageParams}
β”œβ”€β”˜
β”œβ”€4163ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€β”rome_lsp::server::initialize{capabilities=ClientCapabilities { workspace: None, text_document: None, window: None, general: None, experimental: None }, client_info=ClientInfo { name: "rome_service", version: Some("12.0.0") }}
β”‚ β”œβ”€0ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€β”˜
β”œβ”€22826ms INFO rome_lsp::server Sending shutdown signal
β”œβ”€22826ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Broken pipe (os error 32)
β”˜
INFO rome_cli::commands::daemon Received shutdown signal
┐rome_cli::commands::daemon::Running Server{pid=668}
β”œβ”€50ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€β”rome_lsp::server::initialize{capabilities=ClientCapabilities { workspace: None, text_document: None, window: None, general: None, experimental: None }, client_info=ClientInfo { name: "rome_service", version: Some("12.0.0") }}
β”‚ β”œβ”€0ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€β”˜
β”œβ”€β”rome_lsp::server::rome/rage{params=RageParams}
β”œβ”€β”˜
β”œβ”€3959ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€β”rome_lsp::server::initialize{capabilities=ClientCapabilities { workspace: None, text_document: None, window: None, general: None, experimental: None }, client_info=ClientInfo { name: "rome_service", version: Some("12.0.0") }}
β”‚ β”œβ”€0ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€β”˜
β”œβ”€β”rome_lsp::server::rome/rage{params=RageParams}
β”œβ”€β”˜
β”œβ”€56926ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€β”rome_lsp::server::initialize{capabilities=ClientCapabilities { workspace: None, text_document: None, window: None, general: None, experimental: None }, client_info=ClientInfo { name: "rome_service", version: Some("12.0.0") }}
β”‚ β”œβ”€0ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€β”˜
β”œβ”€65096ms INFO rome_lsp::server Sending shutdown signal
β”œβ”€65096ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Broken pipe (os error 32)
INFO rome_cli::commands::daemon Received shutdown signal
β”˜
┐rome_cli::commands::daemon::Running Server{pid=1813}
β”œβ”€50ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€β”rome_lsp::server::initialize{capabilities=ClientCapabilities { workspace: None, text_document: None, window: None, general: None, experimental: None }, client_info=ClientInfo { name: "rome_service", version: Some("12.0.0") }}
β”‚ β”œβ”€0ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€β”˜
β”œβ”€β”rome_lsp::server::rome/rage{params=RageParams}
β”œβ”€β”˜
β”œβ”€3185ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€β”rome_lsp::server::initialize{capabilities=ClientCapabilities { workspace: None, text_document: None, window: None, general: None, experimental: None }, client_info=ClientInfo { name: "rome_service", version: Some("12.0.0") }}
β”‚ β”œβ”€0ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€β”˜
β”œβ”€β”rome_lsp::server::rome/rage{params=RageParams}
β”œβ”€β”˜
β”œβ”€126980ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€β”rome_lsp::server::initialize{capabilities=ClientCapabilities { workspace: None, text_document: None, window: None, general: None, experimental: None }, client_info=ClientInfo { name: "rome_service", version: Some("12.0.0") }}
β”‚ β”œβ”€0ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€β”˜
β”œβ”€143726ms INFO rome_lsp::server Sending shutdown signal
β”œβ”€143726ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Broken pipe (os error 32)
β”˜
INFO rome_cli::commands::daemon Received shutdown signal
┐rome_cli::commands::daemon::Running Server{pid=6417}
β”œβ”€50ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€β”rome_lsp::server::initialize{capabilities=ClientCapabilities { workspace: None, text_document: None, window: None, general: None, experimental: None }, client_info=ClientInfo { name: "rome_service", version: Some("12.0.0") }}
β”‚ β”œβ”€0ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€β”˜
β”œβ”€β”rome_lsp::server::rome/rage{params=RageParams}
β”œβ”€β”˜
β”œβ”€1791ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)

Incompatible Rome Server: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

β„Ή Rage discovered this running server using an incompatible version of Rome.

Server:
  Version:                      11.0.0

What happened?

I was getting the error Extension 'Rome' is configured as formatter but it cannot format 'TypeScript'-files, so I ran yarn rome rage to see what was going on. Some interesting things:

  • It is reporting that rome 11 is running somewhere, but I am not able to find it inside of htop.
  • When I run yarn rome stop, it successfully stops it, but continues to report that rome 11 is running somewhere.
  • I have tried quitting vscode completely and running killall -9 rome rome_lsp node, but it seems to continue reporting this.
  • I have two different projects on my machine that use rome, and VSCode is perfectly happy to auto format on save for one of them, while the other reports that rome does not support TS files (both are pinned to version 12.0.0).

Turns out, this is a result of having a "bad glob" in the files.ignore field (specifically, ./src/**.html), but that was not indicated anywhere (rome rage actually said that the config was loaded correctly?).

Expected result

I expected the Rage discovered this running server using an incompatible version of Rome. to not show up, and for VSCode to report the issue with files.ignore to me.

Code of Conduct

  • [X] I agree to follow Rome's Code of Conduct

karimsa avatar May 10 '23 04:05 karimsa

Also: thank you for creating this project! I am really happy to have a truly high performance and low resource usage linter and formatter on my machine.

karimsa avatar May 10 '23 04:05 karimsa

Hi @karimsa ! Thank you for reporting this and the kind words!

Turns out, this is a result of having a "bad glob" in the files.ignore field (specifically, ./src/**.html)

Why would you think so? Could you explain a bit more?

ematipico avatar May 10 '23 06:05 ematipico

So after I remove the ./src/**.html from files.ignore, it seems to register and format TS files. Or if I fix the glob, and change it to ./src/**/*.html.

karimsa avatar May 10 '23 06:05 karimsa

I am really sure if we are able to fix the issue, unless we're able to reproduce it. The incorrect blob is also something strange.

ematipico avatar May 12 '23 17:05 ematipico

Are you able to reproduce with this rome config:

{
  "$schema": "./node_modules/rome/configuration_schema.json",
  "linter": {
    "enabled": true,
    "rules": {
      "recommended": true
    }
  },
  "formatter": {
    "enabled": true,
    "indentStyle": "tab"
  },
  "files": {
    "ignore": ["./src/**.html"]
  }
}

This causes rome to unregister itself for TS files in my vscode.

karimsa avatar May 12 '23 19:05 karimsa

Thank you. If the configuration is really the issue, what would you expect as resolution of the issue?

ematipico avatar May 17 '23 06:05 ematipico

I think the error handling should be improved - there was no indication that the configuration was the issue, the error message that I got from VSCode was misleading

karimsa avatar May 17 '23 18:05 karimsa